- 16.7k
- 1
- 39
- 89
This is a problem from programming contest. The original problem can be found here on hackerearth.com .
1 <= N, K <= 10610^6
Sum of N in one test file does not exceed 10610^6
Sum of K in one test file does not exceed 10610^6
This is a problem from programming contest.
1 <= N, K <= 106
Sum of N in one test file does not exceed 106
Sum of K in one test file does not exceed 106
This is a problem from programming contest. The original problem can be found here on hackerearth.com .
1 <= N, K <= 10^6
Sum of N in one test file does not exceed 10^6
Sum of K in one test file does not exceed 10^6
SAMPLE INPUT
2
2 2
1 = 2
1 != 2
3 2
1 = 2
2 != 3
SAMPLE OUTPUT
NO
YES
Explanation
There are 2 test cases. In the first one, you cannot fulfill all relations, because equality and inequality of two number cannot be both true. In the second one, you can for example assign 10 to 1 and 2 and 20 to 3 in order to fulfill all relations.
SAMPLE INPUT
2
2 2
1 = 2
1 != 2
3 2
1 = 2
2 != 3
SAMPLE OUTPUT
NO
YES
Explanation
There are 2 test cases. In the first one, you cannot fulfill all relations, because equality and inequality of two number cannot be both true. In the second one, you can for example assign 10 to 1 and 2 and 20 to 3 in order to fulfill all relations.
- 355
- 2
- 13