This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n,m=map(int,input().split())
while n>0:
i=n-1
j=0
while j<n:
if (i&(j+m))==i:
break
j=j+1
for _ in range(j+1):
print(n-j+_-1,m+_)
n=n-j-1
m=m+j+1
# | 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... |