Transforming Pairs
시간 제한: 2000ms메모리 제한: 2048MB출처: USACO 2025 February PlatinumBOJ 33739
문제
Answer () independent queries each of the following form:
You are given four integers (). In one operation you can either do , or . Determine the minimum number of operations to transform into , or if it is impossible to do so, output .
입력
The first line contains .
The next lines each contain four integers .
출력
The answer for each query on a separate line.
예제
예제 1
입력
4 5 -3 -1 -3 5 3 5 2 5 3 8 19 5 3 5 3
출력
2 -1 3 0
코드를 제출하려면 로그인하세요.