This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
def main():
k = int(raw_input())
c = int(raw_input())
L = []
for i in range (c) :
s = map(int, raw_input().split())
L.append(s[::])
for i in range (c) :
m = L[i][0]
n = L[i][1]
if (m <= n and n > m + (k-m+1)/2) or (m > n and m > n + (k-n)/2 +1) :
print 0
else :
print 1
return 0
main()
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |