message
stringlengths
2
59.7k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
37
108k
cluster
float64
20
20
__index_level_0__
int64
74
217k
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000.
instruction
0
77,598
20
155,196
Tags: implementation, math Correct Solution: ``` # codeforces # 1165A # solved 2019-10-10 23:03:52 n, x, y = map(int, str(input()).split()) b = str(input()) op = 0 for i in range(x): if i == y: if b[-i-1] == '0': op+=1 else: if b[-i-1] == '1': op+=1 print(op) ```
output
1
77,598
20
155,197
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000.
instruction
0
77,599
20
155,198
Tags: implementation, math Correct Solution: ``` n, x, y = map(int, input().rstrip().split(" ")) num = list(input()) c = 0 for i in range(1,y+1): if num[-1*i]=="1": c +=1 if num[-1*(y+1)]=="0": c +=1 for j in range(y+2,x+1): if num[-1*j]=="1": c+=1 print(c) ```
output
1
77,599
20
155,199
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000.
instruction
0
77,600
20
155,200
Tags: implementation, math Correct Solution: ``` n,x,y=map(int,input().split()) a=input() b="" for i in range(n): b+=a[n-1-i] count=0 for j in range(x): if(j==y): if(b[j]=="0"): count+=1 else: if(b[j]=="1"): count+=1 print(count) ```
output
1
77,600
20
155,201
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` n, x, y = map(int, input().split()) s = str(input()) s = list(s) s.reverse() ans = 0 for i in range(x): if s[i] == '1': if i != y: ans += 1 else: continue else: if i != y: continue else: ans += 1 print(ans) ```
instruction
0
77,601
20
155,202
Yes
output
1
77,601
20
155,203
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` n, x, y = map(int, input().split()) s = input()[-x:] num = '0' * (x - y - 1) + '1' + y * '0' ans = 0 for i in range(len(s)): if s[i] != num[i]: ans += 1 print(ans) ```
instruction
0
77,602
20
155,204
Yes
output
1
77,602
20
155,205
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` n,x,y = list(map(int,input().split())) l = list(input()) s = l[n-x:n] if s[-y-1]=='1': print(s.count('1')-1) else:print(s.count('1')+1) ```
instruction
0
77,603
20
155,206
Yes
output
1
77,603
20
155,207
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` nd, x, y = input().split() str = input() s=str index=int(nd)-int(x) X=int(x) ND=int(nd) Y=int(y) k=s[index:] sa=[] for i in k: sa.append(i) buckets = [] for i in range(0,X): if i==X-Y-1: buckets.append(1) else: buckets.append(0) ans=0 for i in range(X-1,-1,-1): if int(sa[i]) != int(buckets[i]): ans=ans+1; print(ans) ```
instruction
0
77,604
20
155,208
Yes
output
1
77,604
20
155,209
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` n, x, y = [int(i) for i in input().split()] z = (10**x) + (10**y) z = str(z) s = input()[len(z)-1:] count = 0 for i in range(len(s)): if s[i] != z[i]: count += 1 print(count) ```
instruction
0
77,605
20
155,210
No
output
1
77,605
20
155,211
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` from sys import stdin input = stdin.readline n, x, y = [int(i) for i in input().split()] s = input()[::-1] res = 0 for i in range(x): if s[i] == '1': res += 1 if s[y] == '1': res -= 1 else: res += 1 print(str(res)) ```
instruction
0
77,606
20
155,212
No
output
1
77,606
20
155,213
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` n,x,y=input().split() n,x,y=[int(n),int(x),int(y)] a=input() i=n-1 j=i-y ans=0 if a[j]=='0': ans+=1 while i>(n-x): if i!=j: if a[i]=='1': ans+=1 i-=1 print(ans) ```
instruction
0
77,607
20
155,214
No
output
1
77,607
20
155,215
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a huge decimal number consisting of n digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1. You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem. You are also given two integers 0 ≀ y < x < n. Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Input The first line of the input contains three integers n, x, y (0 ≀ y < x < n ≀ 2 β‹… 10^5) β€” the length of the number and the integers x and y, respectively. The second line of the input contains one decimal number consisting of n digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1. Output Print one integer β€” the minimum number of operations you should perform to obtain the number having remainder 10^y modulo 10^x. In other words, the obtained number should have remainder 10^y when divided by 10^x. Examples Input 11 5 2 11010100101 Output 1 Input 11 5 1 11010100101 Output 3 Note In the first example the number will be 11010100100 after performing one operation. It has remainder 100 modulo 100000. In the second example the number will be 11010100010 after performing three operations. It has remainder 10 modulo 100000. Submitted Solution: ``` n, y, x = map(int, input().split()) s = list(input()[::-1]) i = 0 c = 0 while i < x: if s[i] == '1': s[i] = '0' c += 1 i += 1 if s[x] == '0': c += 1 s[x] = '1' i = x + 1 while i < y: if s[i] == '1': c += 1 s[i] = '0' i += 1 if s[y] == '0': c += 1 s[y] = '1' print(c,"".join(s[::-1])) ```
instruction
0
77,608
20
155,216
No
output
1
77,608
20
155,217
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,889
20
155,778
Tags: number theory Correct Solution: ``` # int(input()) # [int(s) for s in input().split()] # input() from math import gcd def solve(): n = int(input()) print(25) if __name__ == "__main__": solve() ```
output
1
77,889
20
155,779
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,890
20
155,780
Tags: number theory Correct Solution: ``` n = int(input()); print("25") ```
output
1
77,890
20
155,781
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,891
20
155,782
Tags: number theory Correct Solution: ``` _ = int(input()) print(25) ```
output
1
77,891
20
155,783
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,892
20
155,784
Tags: number theory Correct Solution: ``` n = int(input()) if n == 0: print("01") elif n ==1: print("05") else: print("25") ```
output
1
77,892
20
155,785
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,893
20
155,786
Tags: number theory Correct Solution: ``` n=int(input()) if(n==0): print(1) elif(n==1): print(5) else: print(25) ```
output
1
77,893
20
155,787
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,894
20
155,788
Tags: number theory Correct Solution: ``` x=input() print("25") ```
output
1
77,894
20
155,789
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,895
20
155,790
Tags: number theory Correct Solution: ``` a = input() print(25) ```
output
1
77,895
20
155,791
Provide tags and a correct Python 3 solution for this coding contest problem. The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β€” the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions." Could you pass the interview in the machine vision company in IT City? Input The only line of the input contains a single integer n (2 ≀ n ≀ 2Β·1018) β€” the power in which you need to raise number 5. Output Output the last two digits of 5n without spaces between them. Examples Input 2 Output 25
instruction
0
77,896
20
155,792
Tags: number theory Correct Solution: ``` print(25) pass pass pass pass pass pass pass pass pass pass pass pass pass pass pass pass ```
output
1
77,896
20
155,793
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is interactive. You should guess hidden number x which is between 1 and M = 10004205361450474, inclusive. You could use up to 5 queries. In each query, you can output an increasing sequence of k ≀ x integers, each between 1 and M, inclusive, and you will obtain one of the following as an answer: * either the hidden number belongs to your query sequence, in this case you immediately win; * or you will be given where the hidden number is located with respect to your query sequence, that is, either it is less than all numbers from the sequence, greater than all numbers from the sequence, or you will be given such an i that the hidden number x is between the i-th and the (i+1)-st numbers of your sequence. See the interaction section for clarity. Be aware that the interactor is adaptive, i.e. the hidden number can depend on queries the solution makes. However, it is guaranteed that for any solution the interactor works non-distinguishable from the situation when the hidden number is fixed beforehand. Hacks are allowed only with fixed hidden number. A hack is represented by a single integer between 1 and M. In all pretests the hidden number is fixed as well. Interaction You can make up to 5 queries. To make a query print a number k (1 ≀ k ≀ 10^4) and then an increasing sequence t_0 < t_1 < … < t_{k-1} of k numbers, each between 1 and M, inclusive. If k > x, you lose. You get one integer as a response. * If it is -2, it means you made an invalid query or you lost. Exit immediately after receiving -2 and you will see Wrong answer verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream. * If it is -1, you guessed the number and should terminate too. * Otherwise you get a number i between 0 and k, inclusive, denoting where the hidden number is, with respect to the printed numbers. If i = 0, then x < t_0. If i = k, then t_{k-1} < x. Otherwise t_{i-1} < x < t_i. After printing a query do not forget to output end of line and flush the output. Otherwise you will get Idleness limit exceeded. To do this, use: * fflush(stdout) or cout.flush() in C++; * System.out.flush() in Java; * flush(output) in Pascal; * stdout.flush() in Python; * see documentation for other languages. Example Input Β  2 0 -1 Output 2 2 3 2 20 30 3 5 7 9 Note In the first example the number 5 is hidden.
instruction
0
78,291
20
156,582
Tags: dp, interactive Correct Solution: ``` from sys import stdin, stdout max_k=10000 max_shift = [max_k] for t in range(1, 5): max_shift.append(max_shift[t-1]*(max_k+1)+max_k) def get_right(left, t): # [left...right] if left >= max_k: return left + max_shift[t-1] - 1 k = left if k > max_k: k = max_k if t == 1: return left+k-1 new_left = left for i in range(k): new_left = get_right(new_left, t-1) + 2 return get_right(new_left, t-1) left = 1 right = 10004205361450474 k = 1 for t in range(5, 0, -1): if t == 1: right = get_right(left, 1) request = range(left, right+1) else: request = [] request_item = left - 1 for i in range(k): request_item = get_right(request_item+1, t-1) + 1 request.append(request_item) print(len(request), ' '.join([str(x) for x in request])) stdout.flush() reply = int(stdin.readline()) if reply in (-1,-2): exit() if reply > 0: left = request[reply-1]+1 k = left if k > max_k: k = max_k ```
output
1
78,291
20
156,583
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is interactive. You should guess hidden number x which is between 1 and M = 10004205361450474, inclusive. You could use up to 5 queries. In each query, you can output an increasing sequence of k ≀ x integers, each between 1 and M, inclusive, and you will obtain one of the following as an answer: * either the hidden number belongs to your query sequence, in this case you immediately win; * or you will be given where the hidden number is located with respect to your query sequence, that is, either it is less than all numbers from the sequence, greater than all numbers from the sequence, or you will be given such an i that the hidden number x is between the i-th and the (i+1)-st numbers of your sequence. See the interaction section for clarity. Be aware that the interactor is adaptive, i.e. the hidden number can depend on queries the solution makes. However, it is guaranteed that for any solution the interactor works non-distinguishable from the situation when the hidden number is fixed beforehand. Hacks are allowed only with fixed hidden number. A hack is represented by a single integer between 1 and M. In all pretests the hidden number is fixed as well. Interaction You can make up to 5 queries. To make a query print a number k (1 ≀ k ≀ 10^4) and then an increasing sequence t_0 < t_1 < … < t_{k-1} of k numbers, each between 1 and M, inclusive. If k > x, you lose. You get one integer as a response. * If it is -2, it means you made an invalid query or you lost. Exit immediately after receiving -2 and you will see Wrong answer verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream. * If it is -1, you guessed the number and should terminate too. * Otherwise you get a number i between 0 and k, inclusive, denoting where the hidden number is, with respect to the printed numbers. If i = 0, then x < t_0. If i = k, then t_{k-1} < x. Otherwise t_{i-1} < x < t_i. After printing a query do not forget to output end of line and flush the output. Otherwise you will get Idleness limit exceeded. To do this, use: * fflush(stdout) or cout.flush() in C++; * System.out.flush() in Java; * flush(output) in Pascal; * stdout.flush() in Python; * see documentation for other languages. Example Input Β  2 0 -1 Output 2 2 3 2 20 30 3 5 7 9 Note In the first example the number 5 is hidden.
instruction
0
78,292
20
156,584
Tags: dp, interactive Correct Solution: ``` from math import * from sys import stdout import os def get_5th(): return 1 def full_5th(k): return min(10000, k) def get_4th(): now = 1 now = now + get_5th() now = now + full_5th(now + 1) return now def full_4th(k): if k>=10000: return 10000*(10000+1) + 10000 now_seg = full_5th(k) ret = k seg_point = k -1 for i in range(k+1): ret = ret + now_seg seg_point = seg_point + now_seg + 1 now_seg = full_5th(seg_point + 1) return ret def get_3rd(): now = 1 now = now + get_4th() now = now + full_4th(now + 1) return now def full_3rd(k): if k>=10000: return full_4th(k)*(10000 + 1) + 10000 now_seg = full_4th(k) ret = k seg_point = k -1 for i in range(k+1): ret = ret + now_seg seg_point = seg_point + now_seg + 1 now_seg = full_4th(seg_point + 1) return ret def get_2nd(): now = 1 now = now + get_3rd() now = now + full_3rd(now + 1) return now def full_2nd(k): if k>=10000: return full_3rd(k)*(10000 + 1) + 10000 now_seg = full_3rd(k) ret = k seg_point = k -1 for i in range(k+1): ret = ret + now_seg seg_point = seg_point +now_seg + 1 now_seg = full_3rd(seg_point + 1) return ret def get_1st(): now = 1 now = now + get_2nd() now = now + full_2nd(now + 1) return now def get_list(l, full, one): if l == 1: return [1 + one()] point_num = min(l, 10000) ret = [] now_seg = full(l) seg_point = l - 1 for i in range(point_num): seg_point = seg_point + now_seg + 1 ret.append(seg_point) now_seg = full(seg_point + 1) return ret def output(lis): n = len(lis) out = "%d "%(n) for idx, x in enumerate(lis): out = out + "%d "%x test = None if test == None: print("%s\n"%out) stdout.flush() pt = int(input()) else : pt = n for idx, x in enumerate(lis): if test == x: pt = -1 break if test < x: pt = idx break if pt == -1: l,r = -1,-1 elif pt == n: l,r = lis[n-1], -1 elif pt == 0: l,r = -1, lis[0] else : l,r = lis[pt-1],lis[pt] print(pt,l,r) if pt != -1: return 1 if pt == 0 else lis[pt-1] + 1 return pt def check(l, now): temp = output(now) if temp == -1: os._exit(0) ret = max(l, temp) return ret if __name__ == '__main__': l,r = 1, 10004205361450474 #first query now = get_list(l,full_2nd, get_2nd) l = check(l, now) #second query now = get_list(l, full_3rd, get_3rd) l = check(l, now) #3rd query now = get_list(l, full_4th, get_4th) l = check(l, now) #4th query now = get_list(l, full_5th, get_5th) l = check(l, now) #5th query output([x+l for x in range(min(l, 10000))]) ```
output
1
78,292
20
156,585
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is interactive. You should guess hidden number x which is between 1 and M = 10004205361450474, inclusive. You could use up to 5 queries. In each query, you can output an increasing sequence of k ≀ x integers, each between 1 and M, inclusive, and you will obtain one of the following as an answer: * either the hidden number belongs to your query sequence, in this case you immediately win; * or you will be given where the hidden number is located with respect to your query sequence, that is, either it is less than all numbers from the sequence, greater than all numbers from the sequence, or you will be given such an i that the hidden number x is between the i-th and the (i+1)-st numbers of your sequence. See the interaction section for clarity. Be aware that the interactor is adaptive, i.e. the hidden number can depend on queries the solution makes. However, it is guaranteed that for any solution the interactor works non-distinguishable from the situation when the hidden number is fixed beforehand. Hacks are allowed only with fixed hidden number. A hack is represented by a single integer between 1 and M. In all pretests the hidden number is fixed as well. Interaction You can make up to 5 queries. To make a query print a number k (1 ≀ k ≀ 10^4) and then an increasing sequence t_0 < t_1 < … < t_{k-1} of k numbers, each between 1 and M, inclusive. If k > x, you lose. You get one integer as a response. * If it is -2, it means you made an invalid query or you lost. Exit immediately after receiving -2 and you will see Wrong answer verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream. * If it is -1, you guessed the number and should terminate too. * Otherwise you get a number i between 0 and k, inclusive, denoting where the hidden number is, with respect to the printed numbers. If i = 0, then x < t_0. If i = k, then t_{k-1} < x. Otherwise t_{i-1} < x < t_i. After printing a query do not forget to output end of line and flush the output. Otherwise you will get Idleness limit exceeded. To do this, use: * fflush(stdout) or cout.flush() in C++; * System.out.flush() in Java; * flush(output) in Pascal; * stdout.flush() in Python; * see documentation for other languages. Example Input Β  2 0 -1 Output 2 2 3 2 20 30 3 5 7 9 Note In the first example the number 5 is hidden.
instruction
0
78,293
20
156,586
Tags: dp, interactive Correct Solution: ``` #!/usr/bin/python3 import math import sys MAX = 10004205361450474 QMAX = 10000 LOCAL = False def inp(): return sys.stdin.readline().rstrip() ANS = -1 ROUNDS = 0 if LOCAL: ANS = int(inp()) assert ANS <= MAX def do_query(values): global ROUNDS if LOCAL: print('QUERY {}...{} (len={})'.format( values[0], values[-1], len(values))) ROUNDS += 1 if max(values) > MAX: print('Value too large: {}'.format(max(values))) resp = -2 try: i = values.index(ANS) print('CORRECT! ROUNDS={}'.format(ROUNDS)) resp = -1 except ValueError: if ROUNDS == 5: print('NOT SOLVED IN 5 ROUNDS.') resp = -2 else: resp = len(values) for i, v in enumerate(values): if ANS < v: resp = i break print(' => {}'.format(resp)) else: print(len(values), *values, flush=True) resp = int(inp()) if resp < 0: # print(CACHE) sys.exit() return resp def trim_query(query): if max(query) <= MAX: return query res = [q for q in query if q <= MAX] if max(query) != MAX: res.append(MAX) return res CACHE = [{}, {1: 5, 7: 2045, 2047: 20468426, 20468428: 120488427, 120488429: 220508428, 220508430: 320528429, 320528431: 420548430, 420548432: 520568431, 520568433: 620588432, 620588434: 720608433, 720608435: 820628434, 820628436: 920648435, 920648437: 1020668436, 1020668438: 1120688437, 1120688439: 1220708438, 1220708440: 1320728439, 1320728441: 1420748440, 1420748442: 1520768441, 1520768443: 1620788442, 1620788444: 1720808443, 1720808445: 1820828444, 1820828446: 1920848445, 1920848447: 2020868446, 2020868448: 2120888447, 2120888449: 2220908448, 2220908450: 2320928449, 2320928451: 2420948450, 2420948452: 2520968451, 2520968453: 2620988452, 2620988454: 2721008453, 2721008455: 2821028454, 2821028456: 2921048455, 2921048457: 3021068456, 3021068458: 3121088457, 3121088459: 3221108458, 3221108460: 3321128459, 3321128461: 3421148460, 3421148462: 3521168461, 3521168463: 3621188462, 3621188464: 3721208463, 3721208465: 3821228464, 3821228466: 3921248465, 3921248467: 4021268466, 4021268468: 4121288467, 4121288469: 4221308468, 4221308470: 4321328469, 4321328471: 4421348470, 4421348472: 4521368471, 4521368473: 4621388472, 4621388474: 4721408473, 4721408475: 4821428474, 4821428476: 4921448475, 4921448477: 5021468476, 5021468478: 5121488477, 5121488479: 5221508478, 5221508480: 5321528479, 5321528481: 5421548480, 5421548482: 5521568481, 5521568483: 5621588482, 5621588484: 5721608483, 5721608485: 5821628484, 5821628486: 5921648485, 5921648487: 6021668486, 6021668488: 6121688487, 6121688489: 6221708488, 6221708490: 6321728489, 6321728491: 6421748490, 6421748492: 6521768491, 6521768493: 6621788492, 6621788494: 6721808493, 6721808495: 6821828494, 6821828496: 6921848495, 6921848497: 7021868496, 7021868498: 7121888497, 7121888499: 7221908498, 7221908500: 7321928499, 7321928501: 7421948500, 7421948502: 7521968501, 7521968503: 7621988502, 7621988504: 7722008503, 7722008505: 7822028504, 7822028506: 7922048505, 7922048507: 8022068506, 8022068508: 8122088507, 8122088509: 8222108508, 8222108510: 8322128509, 8322128511: 8422148510, 8422148512: 8522168511, 8522168513: 8622188512, 8622188514: 8722208513, 8722208515: 8822228514, 8822228516: 8922248515, 8922248517: 9022268516, 9022268518: 9122288517, 9122288519: 9222308518, 9222308520: 9322328519, 9322328521: 9422348520, 9422348522: 9522368521, 9522368523: 9622388522, 9622388524: 9722408523, 9722408525: 9822428524, 9822428526: 9922448525, 9922448527: 10022468526, 10022468528: 10122488527, 10122488529: 10222508528, 10222508530: 10322528529, 10322528531: 10422548530, 10422548532: 10522568531, 10522568533: 10622588532, 10622588534: 10722608533, 10722608535: 10822628534, 10822628536: 10922648535, 10922648537: 11022668536, 11022668538: 11122688537, 11122688539: 11222708538, 11222708540: 11322728539, 11322728541: 11422748540, 11422748542: 11522768541, 11522768543: 11622788542, 11622788544: 11722808543, 11722808545: 11822828544, 11822828546: 11922848545, 11922848547: 12022868546, 12022868548: 12122888547, 12122888549: 12222908548, 12222908550: 12322928549, 12322928551: 12422948550, 12422948552: 12522968551, 12522968553: 12622988552, 12622988554: 12723008553, 12723008555: 12823028554, 12823028556: 12923048555, 12923048557: 13023068556, 13023068558: 13123088557, 13123088559: 13223108558, 13223108560: 13323128559, 13323128561: 13423148560, 13423148562: 13523168561, 13523168563: 13623188562, 13623188564: 13723208563, 13723208565: 13823228564, 13823228566: 13923248565, 13923248567: 14023268566, 14023268568: 14123288567, 14123288569: 14223308568, 14223308570: 14323328569, 14323328571: 14423348570, 14423348572: 14523368571, 14523368573: 14623388572, 14623388574: 14723408573, 14723408575: 14823428574, 14823428576: 14923448575, 14923448577: 15023468576, 15023468578: 15123488577, 15123488579: 15223508578, 15223508580: 15323528579, 15323528581: 15423548580, 15423548582: 15523568581, 15523568583: 15623588582, 15623588584: 15723608583, 15723608585: 15823628584, 15823628586: 15923648585, 15923648587: 16023668586, 16023668588: 16123688587, 16123688589: 16223708588, 16223708590: 16323728589, 16323728591: 16423748590, 16423748592: 16523768591, 16523768593: 16623788592, 16623788594: 16723808593, 16723808595: 16823828594, 16823828596: 16923848595, 16923848597: 17023868596, 17023868598: 17123888597, 17123888599: 17223908598, 17223908600: 17323928599, 17323928601: 17423948600, 17423948602: 17523968601, 17523968603: 17623988602, 17623988604: 17724008603, 17724008605: 17824028604, 17824028606: 17924048605, 17924048607: 18024068606, 18024068608: 18124088607, 18124088609: 18224108608, 18224108610: 18324128609, 18324128611: 18424148610, 18424148612: 18524168611, 18524168613: 18624188612, 18624188614: 18724208613, 18724208615: 18824228614, 18824228616: 18924248615, 18924248617: 19024268616, 19024268618: 19124288617, 19124288619: 19224308618, 19224308620: 19324328619, 19324328621: 19424348620, 19424348622: 19524368621, 19524368623: 19624388622, 19624388624: 19724408623, 19724408625: 19824428624, 19824428626: 19924448625, 19924448627: 20024468626, 20024468628: 20124488627, 20124488629: 20224508628, 20224508630: 20324528629, 20324528631: 20424548630, 20424548632: 20524568631, 20524568633: 20624588632, 20624588634: 20724608633, 20724608635: 20824628634, 20824628636: 20924648635, 20924648637: 21024668636, 21024668638: 21124688637, 21124688639: 21224708638, 21224708640: 21324728639, 21324728641: 21424748640, 21424748642: 21524768641, 21524768643: 21624788642, 21624788644: 21724808643, 21724808645: 21824828644, 21824828646: 21924848645, 21924848647: 22024868646, 22024868648: 22124888647, 22124888649: 22224908648, 22224908650: 22324928649, 22324928651: 22424948650, 22424948652: 22524968651, 22524968653: 22624988652, 22624988654: 22725008653, 22725008655: 22825028654, 22825028656: 22925048655, 22925048657: 23025068656, 23025068658: 23125088657, 23125088659: 23225108658, 23225108660: 23325128659, 23325128661: 23425148660, 23425148662: 23525168661, 23525168663: 23625188662, 23625188664: 23725208663, 23725208665: 23825228664, 23825228666: 23925248665, 23925248667: 24025268666, 24025268668: 24125288667, 24125288669: 24225308668, 24225308670: 24325328669, 24325328671: 24425348670, 24425348672: 24525368671, 24525368673: 24625388672, 24625388674: 24725408673, 24725408675: 24825428674, 24825428676: 24925448675, 24925448677: 25025468676, 25025468678: 25125488677, 25125488679: 25225508678, 25225508680: 25325528679, 25325528681: 25425548680, 25425548682: 25525568681, 25525568683: 25625588682, 25625588684: 25725608683, 25725608685: 25825628684, 25825628686: 25925648685, 25925648687: 26025668686, 26025668688: 26125688687, 26125688689: 26225708688, 26225708690: 26325728689, 26325728691: 26425748690, 26425748692: 26525768691, 26525768693: 26625788692, 26625788694: 26725808693, 26725808695: 26825828694, 26825828696: 26925848695, 26925848697: 27025868696, 27025868698: 27125888697, 27125888699: 27225908698, 27225908700: 27325928699, 27325928701: 27425948700, 27425948702: 27525968701, 27525968703: 27625988702, 27625988704: 27726008703, 27726008705: 27826028704, 27826028706: 27926048705, 27926048707: 28026068706, 28026068708: 28126088707, 28126088709: 28226108708, 28226108710: 28326128709, 28326128711: 28426148710, 28426148712: 28526168711, 28526168713: 28626188712, 28626188714: 28726208713, 28726208715: 28826228714, 28826228716: 28926248715, 28926248717: 29026268716, 29026268718: 29126288717, 29126288719: 29226308718, 29226308720: 29326328719, 29326328721: 29426348720, 29426348722: 29526368721, 29526368723: 29626388722, 29626388724: 29726408723, 29726408725: 29826428724, 29826428726: 29926448725, 29926448727: 30026468726, 30026468728: 30126488727, 30126488729: 30226508728, 30226508730: 30326528729, 30326528731: 30426548730, 30426548732: 30526568731, 30526568733: 30626588732, 30626588734: 30726608733, 30726608735: 30826628734, 30826628736: 30926648735, 30926648737: 31026668736, 31026668738: 31126688737, 31126688739: 31226708738, 31226708740: 31326728739, 31326728741: 31426748740, 31426748742: 31526768741, 31526768743: 31626788742, 31626788744: 31726808743, 31726808745: 31826828744, 31826828746: 31926848745, 31926848747: 32026868746, 32026868748: 32126888747, 32126888749: 32226908748, 32226908750: 32326928749, 32326928751: 32426948750, 32426948752: 32526968751, 32526968753: 32626988752, 32626988754: 32727008753, 32727008755: 32827028754, 32827028756: 32927048755, 32927048757: 33027068756, 33027068758: 33127088757, 33127088759: 33227108758, 33227108760: 33327128759, 33327128761: 33427148760, 33427148762: 33527168761, 33527168763: 33627188762, 33627188764: 33727208763, 33727208765: 33827228764, 33827228766: 33927248765, 33927248767: 34027268766, 34027268768: 34127288767, 34127288769: 34227308768, 34227308770: 34327328769, 34327328771: 34427348770, 34427348772: 34527368771, 34527368773: 34627388772, 34627388774: 34727408773, 34727408775: 34827428774, 34827428776: 34927448775, 34927448777: 35027468776, 35027468778: 35127488777, 35127488779: 35227508778, 35227508780: 35327528779, 35327528781: 35427548780, 35427548782: 35527568781, 35527568783: 35627588782, 35627588784: 35727608783, 35727608785: 35827628784, 35827628786: 35927648785, 35927648787: 36027668786, 36027668788: 36127688787, 36127688789: 36227708788, 36227708790: 36327728789, 36327728791: 36427748790, 36427748792: 36527768791, 36527768793: 36627788792, 36627788794: 36727808793, 36727808795: 36827828794, 36827828796: 36927848795, 36927848797: 37027868796, 37027868798: 37127888797, 37127888799: 37227908798, 37227908800: 37327928799, 37327928801: 37427948800, 37427948802: 37527968801, 37527968803: 37627988802, 37627988804: 37728008803, 37728008805: 37828028804, 37828028806: 37928048805, 37928048807: 38028068806, 38028068808: 38128088807, 38128088809: 38228108808, 38228108810: 38328128809, 38328128811: 38428148810, 38428148812: 38528168811, 38528168813: 38628188812, 38628188814: 38728208813, 38728208815: 38828228814, 38828228816: 38928248815, 38928248817: 39028268816, 39028268818: 39128288817, 39128288819: 39228308818, 39228308820: 39328328819, 39328328821: 39428348820, 39428348822: 39528368821, 39528368823: 39628388822, 39628388824: 39728408823, 39728408825: 39828428824, 39828428826: 39928448825, 39928448827: 40028468826, 40028468828: 40128488827, 40128488829: 40228508828, 40228508830: 40328528829, 40328528831: 40428548830, 40428548832: 40528568831, 40528568833: 40628588832, 40628588834: 40728608833, 40728608835: 40828628834, 40828628836: 40928648835, 40928648837: 41028668836, 41028668838: 41128688837, 41128688839: 41228708838, 41228708840: 41328728839, 41328728841: 41428748840, 41428748842: 41528768841, 41528768843: 41628788842, 41628788844: 41728808843, 41728808845: 41828828844, 41828828846: 41928848845, 41928848847: 42028868846, 42028868848: 42128888847, 42128888849: 42228908848, 42228908850: 42328928849, 42328928851: 42428948850, 42428948852: 42528968851, 42528968853: 42628988852, 42628988854: 42729008853, 42729008855: 42829028854, 42829028856: 42929048855, 42929048857: 43029068856, 43029068858: 43129088857, 43129088859: 43229108858, 43229108860: 43329128859, 43329128861: 43429148860, 43429148862: 43529168861, 43529168863: 43629188862, 43629188864: 43729208863, 43729208865: 43829228864, 43829228866: 43929248865, 43929248867: 44029268866, 44029268868: 44129288867, 44129288869: 44229308868, 44229308870: 44329328869, 44329328871: 44429348870, 44429348872: 44529368871, 44529368873: 44629388872, 44629388874: 44729408873, 44729408875: 44829428874, 44829428876: 44929448875, 44929448877: 45029468876, 45029468878: 45129488877, 45129488879: 45229508878, 45229508880: 45329528879, 45329528881: 45429548880, 45429548882: 45529568881, 45529568883: 45629588882, 45629588884: 45729608883, 45729608885: 45829628884, 45829628886: 45929648885, 45929648887: 46029668886, 46029668888: 46129688887, 46129688889: 46229708888, 46229708890: 46329728889, 46329728891: 46429748890, 46429748892: 46529768891, 46529768893: 46629788892, 46629788894: 46729808893, 46729808895: 46829828894, 46829828896: 46929848895, 46929848897: 47029868896, 47029868898: 47129888897, 47129888899: 47229908898, 47229908900: 47329928899, 47329928901: 47429948900, 47429948902: 47529968901, 47529968903: 47629988902, 47629988904: 47730008903, 47730008905: 47830028904, 47830028906: 47930048905, 47930048907: 48030068906, 48030068908: 48130088907, 48130088909: 48230108908, 48230108910: 48330128909, 48330128911: 48430148910, 48430148912: 48530168911, 48530168913: 48630188912, 48630188914: 48730208913, 48730208915: 48830228914, 48830228916: 48930248915, 48930248917: 49030268916, 49030268918: 49130288917, 49130288919: 49230308918, 49230308920: 49330328919, 49330328921: 49430348920, 49430348922: 49530368921, 49530368923: 49630388922, 49630388924: 49730408923, 49730408925: 49830428924, 49830428926: 49930448925, 49930448927: 50030468926, 50030468928: 50130488927, 50130488929: 50230508928, 50230508930: 50330528929, 50330528931: 50430548930, 50430548932: 50530568931, 50530568933: 50630588932, 50630588934: 50730608933, 50730608935: 50830628934, 50830628936: 50930648935, 50930648937: 51030668936, 51030668938: 51130688937, 51130688939: 51230708938, 51230708940: 51330728939, 51330728941: 51430748940, 51430748942: 51530768941, 51530768943: 51630788942, 51630788944: 51730808943, 51730808945: 51830828944, 51830828946: 51930848945, 51930848947: 52030868946, 52030868948: 52130888947, 52130888949: 52230908948, 52230908950: 52330928949, 52330928951: 52430948950, 52430948952: 52530968951, 52530968953: 52630988952, 52630988954: 52731008953, 52731008955: 52831028954, 52831028956: 52931048955, 52931048957: 53031068956, 53031068958: 53131088957, 53131088959: 53231108958, 53231108960: 53331128959, 53331128961: 53431148960, 53431148962: 53531168961, 53531168963: 53631188962, 53631188964: 53731208963, 53731208965: 53831228964, 53831228966: 53931248965, 53931248967: 54031268966, 54031268968: 54131288967, 54131288969: 54231308968, 54231308970: 54331328969, 54331328971: 54431348970, 54431348972: 54531368971, 54531368973: 54631388972, 54631388974: 54731408973, 54731408975: 54831428974, 54831428976: 54931448975, 54931448977: 55031468976, 55031468978: 55131488977, 55131488979: 55231508978, 55231508980: 55331528979, 55331528981: 55431548980, 55431548982: 55531568981, 55531568983: 55631588982, 55631588984: 55731608983, 55731608985: 55831628984, 55831628986: 55931648985, 55931648987: 56031668986, 56031668988: 56131688987, 56131688989: 56231708988, 56231708990: 56331728989, 56331728991: 56431748990, 56431748992: 56531768991, 56531768993: 56631788992, 56631788994: 56731808993, 56731808995: 56831828994, 56831828996: 56931848995, 56931848997: 57031868996, 57031868998: 57131888997, 57131888999: 57231908998, 57231909000: 57331928999, 57331929001: 57431949000, 57431949002: 57531969001, 57531969003: 57631989002, 57631989004: 57732009003, 57732009005: 57832029004, 57832029006: 57932049005, 57932049007: 58032069006, 58032069008: 58132089007, 58132089009: 58232109008, 58232109010: 58332129009, 58332129011: 58432149010, 58432149012: 58532169011, 58532169013: 58632189012, 58632189014: 58732209013, 58732209015: 58832229014, 58832229016: 58932249015, 58932249017: 59032269016, 59032269018: 59132289017, 59132289019: 59232309018, 59232309020: 59332329019, 59332329021: 59432349020, 59432349022: 59532369021, 59532369023: 59632389022, 59632389024: 59732409023, 59732409025: 59832429024, 59832429026: 59932449025, 59932449027: 60032469026, 60032469028: 60132489027, 60132489029: 60232509028, 60232509030: 60332529029, 60332529031: 60432549030, 60432549032: 60532569031, 60532569033: 60632589032, 60632589034: 60732609033, 60732609035: 60832629034, 60832629036: 60932649035, 60932649037: 61032669036, 61032669038: 61132689037, 61132689039: 61232709038, 61232709040: 61332729039, 61332729041: 61432749040, 61432749042: 61532769041, 61532769043: 61632789042, 61632789044: 61732809043, 61732809045: 61832829044, 61832829046: 61932849045, 61932849047: 62032869046, 62032869048: 62132889047, 62132889049: 62232909048, 62232909050: 62332929049, 62332929051: 62432949050, 62432949052: 62532969051, 62532969053: 62632989052, 62632989054: 62733009053, 62733009055: 62833029054, 62833029056: 62933049055, 62933049057: 63033069056, 63033069058: 63133089057, 63133089059: 63233109058, 63233109060: 63333129059, 63333129061: 63433149060, 63433149062: 63533169061, 63533169063: 63633189062, 63633189064: 63733209063, 63733209065: 63833229064, 63833229066: 63933249065, 63933249067: 64033269066, 64033269068: 64133289067, 64133289069: 64233309068, 64233309070: 64333329069, 64333329071: 64433349070, 64433349072: 64533369071, 64533369073: 64633389072, 64633389074: 64733409073, 64733409075: 64833429074, 64833429076: 64933449075, 64933449077: 65033469076, 65033469078: 65133489077, 65133489079: 65233509078, 65233509080: 65333529079, 65333529081: 65433549080, 65433549082: 65533569081, 65533569083: 65633589082, 65633589084: 65733609083, 65733609085: 65833629084, 65833629086: 65933649085, 65933649087: 66033669086, 66033669088: 66133689087, 66133689089: 66233709088, 66233709090: 66333729089, 66333729091: 66433749090, 66433749092: 66533769091, 66533769093: 66633789092, 66633789094: 66733809093, 66733809095: 66833829094, 66833829096: 66933849095, 66933849097: 67033869096, 67033869098: 67133889097, 67133889099: 67233909098, 67233909100: 67333929099, 67333929101: 67433949100, 67433949102: 67533969101, 67533969103: 67633989102, 67633989104: 67734009103, 67734009105: 67834029104, 67834029106: 67934049105, 67934049107: 68034069106, 68034069108: 68134089107, 68134089109: 68234109108, 68234109110: 68334129109, 68334129111: 68434149110, 68434149112: 68534169111, 68534169113: 68634189112, 68634189114: 68734209113, 68734209115: 68834229114, 68834229116: 68934249115, 68934249117: 69034269116, 69034269118: 69134289117, 69134289119: 69234309118, 69234309120: 69334329119, 69334329121: 69434349120, 69434349122: 69534369121, 69534369123: 69634389122, 69634389124: 69734409123, 69734409125: 69834429124, 69834429126: 69934449125, 69934449127: 70034469126, 70034469128: 70134489127, 70134489129: 70234509128, 70234509130: 70334529129, 70334529131: 70434549130, 70434549132: 70534569131, 70534569133: 70634589132, 70634589134: 70734609133, 70734609135: 70834629134, 70834629136: 70934649135, 70934649137: 71034669136, 71034669138: 71134689137, 71134689139: 71234709138, 71234709140: 71334729139, 71334729141: 71434749140, 71434749142: 71534769141, 71534769143: 71634789142, 71634789144: 71734809143, 71734809145: 71834829144, 71834829146: 71934849145, 71934849147: 72034869146, 72034869148: 72134889147, 72134889149: 72234909148, 72234909150: 72334929149, 72334929151: 72434949150, 72434949152: 72534969151, 72534969153: 72634989152, 72634989154: 72735009153, 72735009155: 72835029154, 72835029156: 72935049155, 72935049157: 73035069156, 73035069158: 73135089157, 73135089159: 73235109158, 73235109160: 73335129159, 73335129161: 73435149160, 73435149162: 73535169161, 73535169163: 73635189162, 73635189164: 73735209163, 73735209165: 73835229164, 73835229166: 73935249165, 73935249167: 74035269166, 74035269168: 74135289167, 74135289169: 74235309168, 74235309170: 74335329169, 74335329171: 74435349170, 74435349172: 74535369171, 74535369173: 74635389172, 74635389174: 74735409173, 74735409175: 74835429174, 74835429176: 74935449175, 74935449177: 75035469176, 75035469178: 75135489177, 75135489179: 75235509178, 75235509180: 75335529179, 75335529181: 75435549180, 75435549182: 75535569181, 75535569183: 75635589182, 75635589184: 75735609183, 75735609185: 75835629184, 75835629186: 75935649185, 75935649187: 76035669186, 76035669188: 76135689187, 76135689189: 76235709188, 76235709190: 76335729189, 76335729191: 76435749190, 76435749192: 76535769191, 76535769193: 76635789192, 76635789194: 76735809193, 76735809195: 76835829194, 76835829196: 76935849195, 76935849197: 77035869196, 77035869198: 77135889197, 77135889199: 77235909198, 77235909200: 77335929199, 77335929201: 77435949200, 77435949202: 77535969201, 77535969203: 77635989202, 77635989204: 77736009203, 77736009205: 77836029204, 77836029206: 77936049205, 77936049207: 78036069206, 78036069208: 78136089207, 78136089209: 78236109208, 78236109210: 78336129209, 78336129211: 78436149210, 78436149212: 78536169211, 78536169213: 78636189212, 78636189214: 78736209213, 78736209215: 78836229214, 78836229216: 78936249215, 78936249217: 79036269216, 79036269218: 79136289217, 79136289219: 79236309218, 79236309220: 79336329219, 79336329221: 79436349220, 79436349222: 79536369221, 79536369223: 79636389222, 79636389224: 79736409223, 79736409225: 79836429224, 79836429226: 79936449225, 79936449227: 80036469226, 80036469228: 80136489227, 80136489229: 80236509228, 80236509230: 80336529229, 80336529231: 80436549230, 80436549232: 80536569231, 80536569233: 80636589232, 80636589234: 80736609233, 80736609235: 80836629234, 80836629236: 80936649235, 80936649237: 81036669236, 81036669238: 81136689237, 81136689239: 81236709238, 81236709240: 81336729239, 81336729241: 81436749240, 81436749242: 81536769241, 81536769243: 81636789242, 81636789244: 81736809243, 81736809245: 81836829244, 81836829246: 81936849245, 81936849247: 82036869246, 82036869248: 82136889247, 82136889249: 82236909248, 82236909250: 82336929249, 82336929251: 82436949250, 82436949252: 82536969251, 82536969253: 82636989252, 82636989254: 82737009253, 82737009255: 82837029254, 82837029256: 82937049255, 82937049257: 83037069256, 83037069258: 83137089257, 83137089259: 83237109258, 83237109260: 83337129259, 83337129261: 83437149260, 83437149262: 83537169261, 83537169263: 83637189262, 83637189264: 83737209263, 83737209265: 83837229264, 83837229266: 83937249265, 83937249267: 84037269266, 84037269268: 84137289267, 84137289269: 84237309268, 84237309270: 84337329269, 84337329271: 84437349270, 84437349272: 84537369271, 84537369273: 84637389272, 84637389274: 84737409273, 84737409275: 84837429274, 84837429276: 84937449275, 84937449277: 85037469276, 85037469278: 85137489277, 85137489279: 85237509278, 85237509280: 85337529279, 85337529281: 85437549280, 85437549282: 85537569281, 85537569283: 85637589282, 85637589284: 85737609283, 85737609285: 85837629284, 85837629286: 85937649285, 85937649287: 86037669286, 86037669288: 86137689287, 86137689289: 86237709288, 86237709290: 86337729289, 86337729291: 86437749290, 86437749292: 86537769291, 86537769293: 86637789292, 86637789294: 86737809293, 86737809295: 86837829294, 86837829296: 86937849295, 86937849297: 87037869296, 87037869298: 87137889297, 87137889299: 87237909298, 87237909300: 87337929299, 87337929301: 87437949300, 87437949302: 87537969301, 87537969303: 87637989302, 87637989304: 87738009303, 87738009305: 87838029304, 87838029306: 87938049305, 87938049307: 88038069306, 88038069308: 88138089307, 88138089309: 88238109308, 88238109310: 88338129309, 88338129311: 88438149310, 88438149312: 88538169311, 88538169313: 88638189312, 88638189314: 88738209313, 88738209315: 88838229314, 88838229316: 88938249315, 88938249317: 89038269316, 89038269318: 89138289317, 89138289319: 89238309318, 89238309320: 89338329319, 89338329321: 89438349320, 89438349322: 89538369321, 89538369323: 89638389322, 89638389324: 89738409323, 89738409325: 89838429324, 89838429326: 89938449325, 89938449327: 90038469326, 90038469328: 90138489327, 90138489329: 90238509328, 90238509330: 90338529329, 90338529331: 90438549330, 90438549332: 90538569331, 90538569333: 90638589332, 90638589334: 90738609333, 90738609335: 90838629334, 90838629336: 90938649335, 90938649337: 91038669336, 91038669338: 91138689337, 91138689339: 91238709338, 91238709340: 91338729339, 91338729341: 91438749340, 91438749342: 91538769341, 91538769343: 91638789342, 91638789344: 91738809343, 91738809345: 91838829344, 91838829346: 91938849345, 91938849347: 92038869346, 92038869348: 92138889347, 92138889349: 92238909348, 92238909350: 92338929349, 92338929351: 92438949350, 92438949352: 92538969351, 92538969353: 92638989352, 92638989354: 92739009353, 92739009355: 92839029354, 92839029356: 92939049355, 92939049357: 93039069356, 93039069358: 93139089357, 93139089359: 93239109358, 93239109360: 93339129359, 93339129361: 93439149360, 93439149362: 93539169361, 93539169363: 93639189362, 93639189364: 93739209363, 93739209365: 93839229364, 93839229366: 93939249365, 93939249367: 94039269366, 94039269368: 94139289367, 94139289369: 94239309368, 94239309370: 94339329369, 94339329371: 94439349370, 94439349372: 94539369371, 94539369373: 94639389372, 94639389374: 94739409373, 94739409375: 94839429374, 94839429376: 94939449375, 94939449377: 95039469376, 95039469378: 95139489377, 95139489379: 95239509378, 95239509380: 95339529379, 95339529381: 95439549380, 95439549382: 95539569381, 95539569383: 95639589382, 95639589384: 95739609383, 95739609385: 95839629384, 95839629386: 95939649385, 95939649387: 96039669386, 96039669388: 96139689387, 96139689389: 96239709388, 96239709390: 96339729389, 96339729391: 96439749390, 96439749392: 96539769391, 96539769393: 96639789392, 96639789394: 96739809393, 96739809395: 96839829394, 96839829396: 96939849395, 96939849397: 97039869396, 97039869398: 97139889397, 97139889399: 97239909398, 97239909400: 97339929399, 97339929401: 97439949400, 97439949402: 97539969401, 97539969403: 97639989402, 97639989404: 97740009403, 97740009405: 97840029404, 97840029406: 97940049405, 97940049407: 98040069406, 98040069408: 98140089407, 98140089409: 98240109408, 98240109410: 98340129409, 98340129411: 98440149410, 98440149412: 98540169411, 98540169413: 98640189412, 98640189414: 98740209413, 98740209415: 98840229414, 98840229416: 98940249415, 98940249417: 99040269416, 99040269418: 99140289417, 99140289419: 99240309418, 99240309420: 99340329419, 99340329421: 99440349420, 99440349422: 99540369421, 99540369423: 99640389422, 99640389424: 99740409423, 99740409425: 99840429424, 99840429426: 99940449425, 99940449427: 100040469426, 100040469428: 100140489427, 100140489429: 100240509428, 100240509430: 100340529429, 100340529431: 100440549430, 100440549432: 100540569431, 100540569433: 100640589432, 100640589434: 100740609433, 100740609435: 100840629434, 100840629436: 100940649435, 100940649437: 101040669436, 101040669438: 101140689437, 101140689439: 101240709438, 101240709440: 101340729439, 101340729441: 101440749440, 101440749442: 101540769441, 101540769443: 101640789442, 101640789444: 101740809443, 101740809445: 101840829444, 101840829446: 101940849445, 101940849447: 102040869446, 102040869448: 102140889447, 102140889449: 102240909448, 102240909450: 102340929449, 102340929451: 102440949450, 102440949452: 102540969451, 102540969453: 102640989452, 102640989454: 102741009453, 102741009455: 102841029454, 102841029456: 102941049455, 102941049457: 103041069456, 103041069458: 103141089457, 103141089459: 103241109458, 103241109460: 103341129459, 103341129461: 103441149460, 103441149462: 103541169461, 103541169463: 103641189462, 103641189464: 103741209463, 103741209465: 103841229464, 103841229466: 103941249465, 103941249467: 104041269466, 104041269468: 104141289467, 104141289469: 104241309468, 104241309470: 104341329469, 104341329471: 104441349470, 104441349472: 104541369471, 104541369473: 104641389472, 104641389474: 104741409473, 104741409475: 104841429474, 104841429476: 104941449475, 104941449477: 105041469476, 105041469478: 105141489477, 105141489479: 105241509478, 105241509480: 105341529479, 105341529481: 105441549480, 105441549482: 105541569481, 105541569483: 105641589482, 105641589484: 105741609483, 105741609485: 105841629484, 105841629486: 105941649485, 105941649487: 106041669486, 106041669488: 106141689487, 106141689489: 106241709488, 106241709490: 106341729489, 106341729491: 106441749490, 106441749492: 106541769491, 106541769493: 106641789492, 106641789494: 106741809493, 106741809495: 106841829494, 106841829496: 106941849495, 106941849497: 107041869496, 107041869498: 107141889497, 107141889499: 107241909498, 107241909500: 107341929499, 107341929501: 107441949500, 107441949502: 107541969501, 107541969503: 107641989502, 107641989504: 107742009503, 107742009505: 107842029504, 107842029506: 107942049505, 107942049507: 108042069506, 108042069508: 108142089507, 108142089509: 108242109508, 108242109510: 108342129509, 108342129511: 108442149510, 108442149512: 108542169511, 108542169513: 108642189512, 108642189514: 108742209513, 108742209515: 108842229514, 108842229516: 108942249515, 108942249517: 109042269516, 109042269518: 109142289517, 109142289519: 109242309518, 109242309520: 109342329519, 109342329521: 109442349520, 109442349522: 109542369521, 109542369523: 109642389522, 109642389524: 109742409523, 109742409525: 109842429524, 109842429526: 109942449525, 109942449527: 110042469526, 110042469528: 110142489527, 110142489529: 110242509528, 110242509530: 110342529529, 110342529531: 110442549530, 110442549532: 110542569531, 110542569533: 110642589532, 110642589534: 110742609533, 110742609535: 110842629534, 110842629536: 110942649535, 110942649537: 111042669536, 111042669538: 111142689537, 111142689539: 111242709538, 111242709540: 111342729539, 111342729541: 111442749540, 111442749542: 111542769541, 111542769543: 111642789542, 111642789544: 111742809543, 111742809545: 111842829544, 111842829546: 111942849545, 111942849547: 112042869546, 112042869548: 112142889547, 112142889549: 112242909548, 112242909550: 112342929549, 112342929551: 112442949550, 112442949552: 112542969551, 112542969553: 112642989552, 112642989554: 112743009553, 112743009555: 112843029554, 112843029556: 112943049555, 112943049557: 113043069556, 113043069558: 113143089557, 113143089559: 113243109558, 113243109560: 113343129559, 113343129561: 113443149560, 113443149562: 113543169561, 113543169563: 113643189562, 113643189564: 113743209563, 113743209565: 113843229564, 113843229566: 113943249565, 113943249567: 114043269566, 114043269568: 114143289567, 114143289569: 114243309568, 114243309570: 114343329569, 114343329571: 114443349570, 114443349572: 114543369571, 114543369573: 114643389572, 114643389574: 114743409573, 114743409575: 114843429574, 114843429576: 114943449575, 114943449577: 115043469576, 115043469578: 115143489577, 115143489579: 115243509578, 115243509580: 115343529579, 115343529581: 115443549580, 115443549582: 115543569581, 115543569583: 115643589582, 115643589584: 115743609583, 115743609585: 115843629584, 115843629586: 115943649585, 115943649587: 116043669586, 116043669588: 116143689587, 116143689589: 116243709588, 116243709590: 116343729589, 116343729591: 116443749590, 116443749592: 116543769591, 116543769593: 116643789592, 116643789594: 116743809593, 116743809595: 116843829594, 116843829596: 116943849595, 116943849597: 117043869596, 117043869598: 117143889597, 117143889599: 117243909598, 117243909600: 117343929599, 117343929601: 117443949600, 117443949602: 117543969601, 117543969603: 117643989602, 117643989604: 117744009603, 117744009605: 117844029604, 117844029606: 117944049605, 117944049607: 118044069606, 118044069608: 118144089607, 118144089609: 118244109608, 118244109610: 118344129609, 118344129611: 118444149610, 118444149612: 118544169611, 118544169613: 118644189612, 118644189614: 118744209613, 118744209615: 118844229614, 118844229616: 118944249615, 118944249617: 119044269616, 119044269618: 119144289617, 119144289619: 119244309618, 119244309620: 119344329619, 119344329621: 119444349620, 119444349622: 119544369621, 119544369623: 119644389622, 119644389624: 119744409623, 119744409625: 119844429624, 119844429626: 119944449625, 119944449627: 120044469626, 120044469628: 120144489627, 120144489629: 120244509628, 120244509630: 120344529629, 120344529631: 120444549630, 120444549632: 120544569631, 120544569633: 120644589632, 120644589634: 120744609633, 120744609635: 120844629634, 120844629636: 120944649635, 120944649637: 121044669636, 121044669638: 121144689637, 121144689639: 121244709638, 121244709640: 121344729639, 121344729641: 121444749640, 121444749642: 121544769641, 121544769643: 121644789642, 121644789644: 121744809643, 121744809645: 121844829644, 121844829646: 121944849645, 121944849647: 122044869646, 122044869648: 122144889647, 122144889649: 122244909648, 122244909650: 122344929649, 122344929651: 122444949650, 122444949652: 122544969651, 122544969653: 122644989652, 122644989654: 122745009653, 122745009655: 122845029654, 122845029656: 122945049655, 122945049657: 123045069656, 123045069658: 123145089657, 123145089659: 123245109658, 123245109660: 123345129659, 123345129661: 123445149660, 123445149662: 123545169661, 123545169663: 123645189662, 123645189664: 123745209663, 123745209665: 123845229664, 123845229666: 123945249665, 123945249667: 124045269666, 124045269668: 124145289667, 124145289669: 124245309668, 124245309670: 124345329669, 124345329671: 124445349670, 124445349672: 124545369671, 124545369673: 124645389672, 124645389674: 124745409673, 124745409675: 124845429674, 124845429676: 124945449675, 124945449677: 125045469676, 125045469678: 125145489677, 125145489679: 125245509678, 125245509680: 125345529679, 125345529681: 125445549680, 125445549682: 125545569681, 125545569683: 125645589682, 125645589684: 125745609683, 125745609685: 125845629684, 125845629686: 125945649685, 125945649687: 126045669686, 126045669688: 126145689687, 126145689689: 126245709688, 126245709690: 126345729689, 126345729691: 126445749690, 126445749692: 126545769691, 126545769693: 126645789692, 126645789694: 126745809693, 126745809695: 126845829694, 126845829696: 126945849695, 126945849697: 127045869696, 127045869698: 127145889697, 127145889699: 127245909698, 127245909700: 127345929699, 127345929701: 127445949700, 127445949702: 127545969701, 127545969703: 127645989702, 127645989704: 127746009703, 127746009705: 127846029704, 127846029706: 127946049705, 127946049707: 128046069706, 128046069708: 128146089707, 128146089709: 128246109708, 128246109710: 128346129709, 128346129711: 128446149710, 128446149712: 128546169711, 128546169713: 128646189712, 128646189714: 128746209713, 128746209715: 128846229714, 128846229716: 128946249715, 128946249717: 129046269716, 129046269718: 129146289717, 129146289719: 129246309718, 129246309720: 129346329719, 129346329721: 129446349720, 129446349722: 129546369721, 129546369723: 129646389722, 129646389724: 129746409723, 129746409725: 129846429724, 129846429726: 129946449725, 129946449727: 130046469726, 130046469728: 130146489727, 130146489729: 130246509728, 130246509730: 130346529729, 130346529731: 130446549730, 130446549732: 130546569731, 130546569733: 130646589732, 130646589734: 130746609733, 130746609735: 130846629734, 130846629736: 130946649735, 130946649737: 131046669736, 131046669738: 131146689737, 131146689739: 131246709738, 131246709740: 131346729739, 131346729741: 131446749740, 131446749742: 131546769741, 131546769743: 131646789742, 131646789744: 131746809743, 131746809745: 131846829744, 131846829746: 131946849745, 131946849747: 132046869746, 132046869748: 132146889747, 132146889749: 132246909748, 132246909750: 132346929749, 132346929751: 132446949750, 132446949752: 132546969751, 132546969753: 132646989752, 132646989754: 132747009753, 132747009755: 132847029754, 132847029756: 132947049755, 132947049757: 133047069756, 133047069758: 133147089757, 133147089759: 133247109758, 133247109760: 133347129759, 133347129761: 133447149760, 133447149762: 133547169761, 133547169763: 133647189762, 133647189764: 133747209763, 133747209765: 133847229764, 133847229766: 133947249765, 133947249767: 134047269766, 134047269768: 134147289767, 134147289769: 134247309768, 134247309770: 134347329769, 134347329771: 134447349770, 134447349772: 134547369771, 134547369773: 134647389772, 134647389774: 134747409773, 134747409775: 134847429774, 134847429776: 134947449775, 134947449777: 135047469776, 135047469778: 135147489777, 135147489779: 135247509778, 135247509780: 135347529779, 135347529781: 135447549780, 135447549782: 135547569781, 135547569783: 135647589782, 135647589784: 135747609783, 135747609785: 135847629784, 135847629786: 135947649785, 135947649787: 136047669786, 136047669788: 136147689787, 136147689789: 136247709788, 136247709790: 136347729789, 136347729791: 136447749790, 136447749792: 136547769791, 136547769793: 136647789792, 136647789794: 136747809793, 136747809795: 136847829794, 136847829796: 136947849795, 136947849797: 137047869796, 137047869798: 137147889797, 137147889799: 137247909798, 137247909800: 137347929799, 137347929801: 137447949800, 137447949802: 137547969801, 137547969803: 137647989802, 137647989804: 137748009803, 137748009805: 137848029804, 137848029806: 137948049805, 137948049807: 138048069806, 138048069808: 138148089807, 138148089809: 138248109808, 138248109810: 138348129809, 138348129811: 138448149810, 138448149812: 138548169811, 138548169813: 138648189812, 138648189814: 138748209813, 138748209815: 138848229814, 138848229816: 138948249815, 138948249817: 139048269816, 139048269818: 139148289817, 139148289819: 139248309818, 139248309820: 139348329819, 139348329821: 139448349820, 139448349822: 139548369821, 139548369823: 139648389822, 139648389824: 139748409823, 139748409825: 139848429824, 139848429826: 139948449825, 139948449827: 140048469826, 140048469828: 140148489827, 140148489829: 140248509828, 140248509830: 140348529829, 140348529831: 140448549830, 140448549832: 140548569831, 140548569833: 140648589832, 140648589834: 140748609833, 140748609835: 140848629834, 140848629836: 140948649835, 140948649837: 141048669836, 141048669838: 141148689837, 141148689839: 141248709838, 141248709840: 141348729839, 141348729841: 141448749840, 141448749842: 141548769841, 141548769843: 141648789842, 141648789844: 141748809843, 141748809845: 141848829844, 141848829846: 141948849845, 141948849847: 142048869846, 142048869848: 142148889847, 142148889849: 142248909848, 142248909850: 142348929849, 142348929851: 142448949850, 142448949852: 142548969851, 142548969853: 142648989852, 142648989854: 142749009853, 142749009855: 142849029854, 142849029856: 142949049855, 142949049857: 143049069856, 143049069858: 143149089857, 143149089859: 143249109858, 143249109860: 143349129859, 143349129861: 143449149860, 143449149862: 143549169861, 143549169863: 143649189862, 143649189864: 143749209863, 143749209865: 143849229864, 143849229866: 143949249865, 143949249867: 144049269866, 144049269868: 144149289867, 144149289869: 144249309868, 144249309870: 144349329869, 144349329871: 144449349870, 144449349872: 144549369871, 144549369873: 144649389872, 144649389874: 144749409873, 144749409875: 144849429874, 144849429876: 144949449875, 144949449877: 145049469876, 145049469878: 145149489877, 145149489879: 145249509878, 145249509880: 145349529879, 145349529881: 145449549880, 145449549882: 145549569881, 145549569883: 145649589882, 145649589884: 145749609883, 145749609885: 145849629884, 145849629886: 145949649885, 145949649887: 146049669886, 146049669888: 146149689887, 146149689889: 146249709888, 146249709890: 146349729889, 146349729891: 146449749890, 146449749892: 146549769891, 146549769893: 146649789892, 146649789894: 146749809893, 146749809895: 146849829894, 146849829896: 146949849895, 146949849897: 147049869896, 147049869898: 147149889897, 147149889899: 147249909898, 147249909900: 147349929899, 147349929901: 147449949900, 147449949902: 147549969901, 147549969903: 147649989902, 147649989904: 147750009903, 147750009905: 147850029904, 147850029906: 147950049905, 147950049907: 148050069906, 148050069908: 148150089907, 148150089909: 148250109908, 148250109910: 148350129909, 148350129911: 148450149910, 148450149912: 148550169911, 148550169913: 148650189912, 148650189914: 148750209913, 148750209915: 148850229914, 148850229916: 148950249915, 148950249917: 149050269916, 149050269918: 149150289917, 149150289919: 149250309918, 149250309920: 149350329919, 149350329921: 149450349920, 149450349922: 149550369921, 149550369923: 149650389922, 149650389924: 149750409923, 149750409925: 149850429924, 149850429926: 149950449925, 149950449927: 150050469926, 150050469928: 150150489927, 150150489929: 150250509928, 150250509930: 150350529929, 150350529931: 150450549930, 150450549932: 150550569931, 150550569933: 150650589932, 150650589934: 150750609933, 150750609935: 150850629934, 150850629936: 150950649935, 150950649937: 151050669936, 151050669938: 151150689937, 151150689939: 151250709938, 151250709940: 151350729939, 151350729941: 151450749940, 151450749942: 151550769941, 151550769943: 151650789942, 151650789944: 151750809943, 151750809945: 151850829944, 151850829946: 151950849945, 151950849947: 152050869946, 152050869948: 152150889947, 152150889949: 152250909948, 152250909950: 152350929949, 152350929951: 152450949950, 152450949952: 152550969951, 152550969953: 152650989952, 152650989954: 152751009953, 152751009955: 152851029954, 152851029956: 152951049955, 152951049957: 153051069956, 153051069958: 153151089957, 153151089959: 153251109958, 153251109960: 153351129959, 153351129961: 153451149960, 153451149962: 153551169961, 153551169963: 153651189962, 153651189964: 153751209963, 153751209965: 153851229964, 153851229966: 153951249965, 153951249967: 154051269966, 154051269968: 154151289967, 154151289969: 154251309968, 154251309970: 154351329969, 154351329971: 154451349970, 154451349972: 154551369971, 154551369973: 154651389972, 154651389974: 154751409973, 154751409975: 154851429974, 154851429976: 154951449975, 154951449977: 155051469976, 155051469978: 155151489977, 155151489979: 155251509978, 155251509980: 155351529979, 155351529981: 155451549980, 155451549982: 155551569981, 155551569983: 155651589982, 155651589984: 155751609983, 155751609985: 155851629984, 155851629986: 155951649985, 155951649987: 156051669986, 156051669988: 156151689987, 156151689989: 156251709988, 156251709990: 156351729989, 156351729991: 156451749990, 156451749992: 156551769991, 156551769993: 156651789992, 156651789994: 156751809993, 156751809995: 156851829994, 156851829996: 156951849995, 156951849997: 157051869996, 157051869998: 157151889997, 157151889999: 157251909998, 157251910000: 157351929999, 157351930001: 157451950000, 157451950002: 157551970001, 157551970003: 157651990002, 157651990004: 157752010003, 157752010005: 157852030004, 157852030006: 157952050005, 157952050007: 158052070006, 158052070008: 158152090007, 158152090009: 158252110008, 158252110010: 158352130009, 158352130011: 158452150010, 158452150012: 158552170011, 158552170013: 158652190012, 158652190014: 158752210013, 158752210015: 158852230014, 158852230016: 158952250015, 158952250017: 159052270016, 159052270018: 159152290017, 159152290019: 159252310018, 159252310020: 159352330019, 159352330021: 159452350020, 159452350022: 159552370021, 159552370023: 159652390022, 159652390024: 159752410023, 159752410025: 159852430024, 159852430026: 159952450025, 159952450027: 160052470026, 160052470028: 160152490027, 160152490029: 160252510028, 160252510030: 160352530029, 160352530031: 160452550030, 160452550032: 160552570031, 160552570033: 160652590032, 160652590034: 160752610033, 160752610035: 160852630034, 160852630036: 160952650035, 160952650037: 161052670036, 161052670038: 161152690037, 161152690039: 161252710038, 161252710040: 161352730039, 161352730041: 161452750040, 161452750042: 161552770041, 161552770043: 161652790042, 161652790044: 161752810043, 161752810045: 161852830044, 161852830046: 161952850045, 161952850047: 162052870046, 162052870048: 162152890047, 162152890049: 162252910048, 162252910050: 162352930049, 162352930051: 162452950050, 162452950052: 162552970051, 162552970053: 162652990052, 162652990054: 162753010053, 162753010055: 162853030054, 162853030056: 162953050055, 162953050057: 163053070056, 163053070058: 163153090057, 163153090059: 163253110058, 163253110060: 163353130059, 163353130061: 163453150060, 163453150062: 163553170061, 163553170063: 163653190062, 163653190064: 163753210063, 163753210065: 163853230064, 163853230066: 163953250065, 163953250067: 164053270066, 164053270068: 164153290067, 164153290069: 164253310068, 164253310070: 164353330069, 164353330071: 164453350070, 164453350072: 164553370071, 164553370073: 164653390072, 164653390074: 164753410073, 164753410075: 164853430074, 164853430076: 164953450075, 164953450077: 165053470076, 165053470078: 165153490077, 165153490079: 165253510078, 165253510080: 165353530079, 165353530081: 165453550080, 165453550082: 165553570081, 165553570083: 165653590082, 165653590084: 165753610083, 165753610085: 165853630084, 165853630086: 165953650085, 165953650087: 166053670086, 166053670088: 166153690087, 166153690089: 166253710088, 166253710090: 166353730089, 166353730091: 166453750090, 166453750092: 166553770091, 166553770093: 166653790092, 166653790094: 166753810093, 166753810095: 166853830094, 166853830096: 166953850095, 166953850097: 167053870096, 167053870098: 167153890097, 167153890099: 167253910098, 167253910100: 167353930099, 167353930101: 167453950100, 167453950102: 167553970101, 167553970103: 167653990102, 167653990104: 167754010103, 167754010105: 167854030104, 167854030106: 167954050105, 167954050107: 168054070106, 168054070108: 168154090107, 168154090109: 168254110108, 168254110110: 168354130109, 168354130111: 168454150110, 168454150112: 168554170111, 168554170113: 168654190112, 168654190114: 168754210113, 168754210115: 168854230114, 168854230116: 168954250115, 168954250117: 169054270116, 169054270118: 169154290117, 169154290119: 169254310118, 169254310120: 169354330119, 169354330121: 169454350120, 169454350122: 169554370121, 169554370123: 169654390122, 169654390124: 169754410123, 169754410125: 169854430124, 169854430126: 169954450125, 169954450127: 170054470126, 170054470128: 170154490127, 170154490129: 170254510128, 170254510130: 170354530129, 170354530131: 170454550130, 170454550132: 170554570131, 170554570133: 170654590132, 170654590134: 170754610133, 170754610135: 170854630134, 170854630136: 170954650135, 170954650137: 171054670136, 171054670138: 171154690137, 171154690139: 171254710138, 171254710140: 171354730139, 171354730141: 171454750140, 171454750142: 171554770141, 171554770143: 171654790142, 171654790144: 171754810143, 171754810145: 171854830144, 171854830146: 171954850145, 171954850147: 172054870146, 172054870148: 172154890147, 172154890149: 172254910148, 172254910150: 172354930149, 172354930151: 172454950150, 172454950152: 172554970151, 172554970153: 172654990152, 172654990154: 172755010153, 172755010155: 172855030154, 172855030156: 172955050155, 172955050157: 173055070156, 173055070158: 173155090157, 173155090159: 173255110158, 173255110160: 173355130159, 173355130161: 173455150160, 173455150162: 173555170161, 173555170163: 173655190162, 173655190164: 173755210163, 173755210165: 173855230164, 173855230166: 173955250165, 173955250167: 174055270166, 174055270168: 174155290167, 174155290169: 174255310168, 174255310170: 174355330169, 174355330171: 174455350170, 174455350172: 174555370171, 174555370173: 174655390172, 174655390174: 174755410173, 174755410175: 174855430174, 174855430176: 174955450175, 174955450177: 175055470176, 175055470178: 175155490177, 175155490179: 175255510178, 175255510180: 175355530179, 175355530181: 175455550180, 175455550182: 175555570181, 175555570183: 175655590182, 175655590184: 175755610183, 175755610185: 175855630184, 175855630186: 175955650185, 175955650187: 176055670186, 176055670188: 176155690187, 176155690189: 176255710188, 176255710190: 176355730189, 176355730191: 176455750190, 176455750192: 176555770191, 176555770193: 176655790192, 176655790194: 176755810193, 176755810195: 176855830194, 176855830196: 176955850195, 176955850197: 177055870196, 177055870198: 177155890197, 177155890199: 177255910198, 177255910200: 177355930199, 177355930201: 177455950200, 177455950202: 177555970201, 177555970203: 177655990202, 177655990204: 177756010203, 177756010205: 177856030204, 177856030206: 177956050205, 177956050207: 178056070206, 178056070208: 178156090207, 178156090209: 178256110208, 178256110210: 178356130209, 178356130211: 178456150210, 178456150212: 178556170211, 178556170213: 178656190212, 178656190214: 178756210213, 178756210215: 178856230214, 178856230216: 178956250215, 178956250217: 179056270216, 179056270218: 179156290217, 179156290219: 179256310218, 179256310220: 179356330219, 179356330221: 179456350220, 179456350222: 179556370221, 179556370223: 179656390222, 179656390224: 179756410223, 179756410225: 179856430224, 179856430226: 179956450225, 179956450227: 180056470226, 180056470228: 180156490227, 180156490229: 180256510228, 180256510230: 180356530229, 180356530231: 180456550230, 180456550232: 180556570231, 180556570233: 180656590232, 180656590234: 180756610233, 180756610235: 180856630234, 180856630236: 180956650235, 180956650237: 181056670236, 181056670238: 181156690237, 181156690239: 181256710238, 181256710240: 181356730239, 181356730241: 181456750240, 181456750242: 181556770241, 181556770243: 181656790242, 181656790244: 181756810243, 181756810245: 181856830244, 181856830246: 181956850245, 181956850247: 182056870246, 182056870248: 182156890247, 182156890249: 182256910248, 182256910250: 182356930249, 182356930251: 182456950250, 182456950252: 182556970251, 182556970253: 182656990252, 182656990254: 182757010253, 182757010255: 182857030254, 182857030256: 182957050255, 182957050257: 183057070256, 183057070258: 183157090257, 183157090259: 183257110258, 183257110260: 183357130259, 183357130261: 183457150260, 183457150262: 183557170261, 183557170263: 183657190262, 183657190264: 183757210263, 183757210265: 183857230264, 183857230266: 183957250265, 183957250267: 184057270266, 184057270268: 184157290267, 184157290269: 184257310268, 184257310270: 184357330269, 184357330271: 184457350270, 184457350272: 184557370271, 184557370273: 184657390272, 184657390274: 184757410273, 184757410275: 184857430274, 184857430276: 184957450275, 184957450277: 185057470276, 185057470278: 185157490277, 185157490279: 185257510278, 185257510280: 185357530279, 185357530281: 185457550280, 185457550282: 185557570281, 185557570283: 185657590282, 185657590284: 185757610283, 185757610285: 185857630284, 185857630286: 185957650285, 185957650287: 186057670286, 186057670288: 186157690287, 186157690289: 186257710288, 186257710290: 186357730289, 186357730291: 186457750290, 186457750292: 186557770291, 186557770293: 186657790292, 186657790294: 186757810293, 186757810295: 186857830294, 186857830296: 186957850295, 186957850297: 187057870296, 187057870298: 187157890297, 187157890299: 187257910298, 187257910300: 187357930299, 187357930301: 187457950300, 187457950302: 187557970301, 187557970303: 187657990302, 187657990304: 187758010303, 187758010305: 187858030304, 187858030306: 187958050305, 187958050307: 188058070306, 188058070308: 188158090307, 188158090309: 188258110308, 188258110310: 188358130309, 188358130311: 188458150310, 188458150312: 188558170311, 188558170313: 188658190312, 188658190314: 188758210313, 188758210315: 188858230314, 188858230316: 188958250315, 188958250317: 189058270316, 189058270318: 189158290317, 189158290319: 189258310318, 189258310320: 189358330319, 189358330321: 189458350320, 189458350322: 189558370321, 189558370323: 189658390322, 189658390324: 189758410323, 189758410325: 189858430324, 189858430326: 189958450325, 189958450327: 190058470326, 190058470328: 190158490327, 190158490329: 190258510328, 190258510330: 190358530329, 190358530331: 190458550330, 190458550332: 190558570331, 190558570333: 190658590332, 190658590334: 190758610333, 190758610335: 190858630334, 190858630336: 190958650335, 190958650337: 191058670336, 191058670338: 191158690337, 191158690339: 191258710338, 191258710340: 191358730339, 191358730341: 191458750340, 191458750342: 191558770341, 191558770343: 191658790342, 191658790344: 191758810343, 191758810345: 191858830344, 191858830346: 191958850345, 191958850347: 192058870346, 192058870348: 192158890347, 192158890349: 192258910348, 192258910350: 192358930349, 192358930351: 192458950350, 192458950352: 192558970351, 192558970353: 192658990352, 192658990354: 192759010353, 192759010355: 192859030354, 192859030356: 192959050355, 192959050357: 193059070356, 193059070358: 193159090357, 193159090359: 193259110358, 193259110360: 193359130359, 193359130361: 193459150360, 193459150362: 193559170361, 193559170363: 193659190362, 193659190364: 193759210363, 193759210365: 193859230364, 193859230366: 193959250365, 193959250367: 194059270366, 194059270368: 194159290367, 194159290369: 194259310368, 194259310370: 194359330369, 194359330371: 194459350370, 194459350372: 194559370371, 194559370373: 194659390372, 194659390374: 194759410373, 194759410375: 194859430374, 194859430376: 194959450375, 194959450377: 195059470376, 195059470378: 195159490377, 195159490379: 195259510378, 195259510380: 195359530379, 195359530381: 195459550380, 195459550382: 195559570381, 195559570383: 195659590382, 195659590384: 195759610383, 195759610385: 195859630384, 195859630386: 195959650385, 195959650387: 196059670386, 196059670388: 196159690387, 196159690389: 196259710388, 196259710390: 196359730389, 196359730391: 196459750390, 196459750392: 196559770391, 196559770393: 196659790392, 196659790394: 196759810393, 196759810395: 196859830394, 196859830396: 196959850395, 196959850397: 197059870396, 197059870398: 197159890397, 197159890399: 197259910398, 197259910400: 197359930399, 197359930401: 197459950400, 197459950402: 197559970401, 197559970403: 197659990402, 197659990404: 197760010403, 197760010405: 197860030404, 197860030406: 197960050405, 197960050407: 198060070406, 198060070408: 198160090407, 198160090409: 198260110408, 198260110410: 198360130409, 198360130411: 198460150410, 198460150412: 198560170411, 198560170413: 198660190412, 198660190414: 198760210413, 198760210415: 198860230414, 198860230416: 198960250415, 198960250417: 199060270416, 199060270418: 199160290417, 199160290419: 199260310418, 199260310420: 199360330419, 199360330421: 199460350420, 199460350422: 199560370421, 199560370423: 199660390422, 199660390424: 199760410423, 199760410425: 199860430424, 199860430426: 199960450425, 199960450427: 200060470426, 200060470428: 200160490427, 200160490429: 200260510428, 200260510430: 200360530429, 200360530431: 200460550430, 200460550432: 200560570431, 200560570433: 200660590432, 200660590434: 200760610433, 200760610435: 200860630434, 200860630436: 200960650435, 200960650437: 201060670436, 201060670438: 201160690437, 201160690439: 201260710438, 201260710440: 201360730439, 201360730441: 201460750440, 201460750442: 201560770441, 201560770443: 201660790442, 201660790444: 201760810443, 201760810445: 201860830444, 201860830446: 201960850445, 201960850447: 202060870446, 202060870448: 202160890447, 202160890449: 202260910448, 202260910450: 202360930449, 202360930451: 202460950450, 202460950452: 202560970451, 202560970453: 202660990452, 202660990454: 202761010453, 202761010455: 202861030454, 202861030456: 202961050455, 202961050457: 203061070456, 203061070458: 203161090457, 203161090459: 203261110458, 203261110460: 203361130459, 203361130461: 203461150460, 203461150462: 203561170461, 203561170463: 203661190462, 203661190464: 203761210463, 203761210465: 203861230464, 203861230466: 203961250465, 203961250467: 204061270466, 204061270468: 204161290467, 204161290469: 204261310468, 204261310470: 204361330469, 204361330471: 204461350470, 204461350472: 204561370471, 204561370473: 204661390472, 204661390474: 204761410473, 204761410475: 204861430474}, {1: 2045, 2047: 204761410473, 204761410475: 1205061440474}, {1: 204761410473, 204761410475: 10004205361450474}, {1: 10004205361450474}] def plan_round(low, rounds_left, need_query): cache = CACHE[rounds_left - 1] if rounds_left >= 2 and not need_query and low in cache: return None, cache[low] if low >= QMAX: if rounds_left == 1: result = (list(range(low, low + QMAX)), low + QMAX - 1) else: _, left_max = plan_round(low, rounds_left - 1, False) width = left_max - low + 1 query = [low + width] for _ in range(QMAX - 1): query.append(query[-1] + 1 + width) right_max = query[-1] + width result = (query, right_max) elif rounds_left == 1: result = (list(range(low, low + low)), low + low - 1) else: _, left_max = plan_round(low, rounds_left - 1, False) query = [left_max + 1] for _ in range(low - 1): _, mid_max = plan_round(query[-1] + 1, rounds_left - 1, False) query.append(mid_max + 1) _, right_max = plan_round(query[-1] + 1, rounds_left - 1, False) result = (query, right_max) if rounds_left >= 2: cache[low] = result[1] return result def do_round(low, rounds_left): query, high = plan_round(low, rounds_left, True) query = trim_query(query) pos = do_query(query) if pos == 0: do_round(low, rounds_left - 1) else: do_round(query[pos - 1] + 1, rounds_left - 1) # def do_initial(minimum, rounds_left): # query = [minimum] # for _ in range(min(minimum, 10000) - 1): # query.append(query[-1] + 1) # qend = query[-1] # query_stack = [query] # qend_stack = [qend] # for _ in range(rounds_left - 1): # query = query_stack[-1] # qend = qend_stack[-1] # print(f'{minimum}...{qend}: ({query[0]}, {query[-1]})') # width = qend - minimum + 1 # nquery = [qend + 1] # for _ in range(min(minimum, 10000) - 1): # nquery.append(nquery[-1] + width + 1) # query_stack.append(nquery) # qend_stack.append(nquery[-1] + width) # query = query_stack.pop() # qend = qend_stack.pop() # print(f'{minimum}...{qend}: ({query[0]}, {query[-1]})') # query = trim_query(query) # pos = do_query(query) # if pos == len(query): # do_initial(query[-1] + 1, rounds_left - 1) # return # while query_stack: # base = minimum if pos == 0 else query[pos - 1] + 1 # off = base - minimum # query = trim_query([q + off for q in query_stack.pop()]) # qend = qend_stack.pop() # pos = do_query(query) def main(): do_round(1, 5) # pos = do_query([122549]) # if pos == 1: # do_initial(122550, 4) # return # pos = do_query([48]) # if pos == 1: # do_initial(49, 3) # return # pos = do_query([5]) # if pos == 1: # do_initial(6, 2) # pos = do_query([2]) # if pos == 1: # do_query([3, 4]) # else: # do_query([1]) if __name__ == '__main__': main() ```
output
1
78,293
20
156,587
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,552
20
157,104
Tags: binary search, greedy, number theory Correct Solution: ``` s,k=[int(i) for i in input().split()] a=[-1,0,1,1] i=3 while a[i]<=pow(10,9): i+=1 a.append(0) if i<=k: for j in range(1,i): a[i]+=a[j] else: for j in range(i-k,i): a[i]+=a[j] b=[] for j in range(i,0,-1): if a[j]<=s: b.append(a[j]) s-=a[j] if s==0: b.append(0) break print(len(b)) for i in b: print(i,end=' ') ```
output
1
78,552
20
157,105
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,553
20
157,106
Tags: binary search, greedy, number theory Correct Solution: ``` s,k=map(int,input().split()) f=[0] f.append(1) while(True): cur=sum(f[-k:]) if cur>s: break f.append(cur) f=list(set(f)) f.sort() ans=[] i=len(f)-1 while(s and i>0): if f[i]<=s: s-=f[i] ans.append(f[i]) i-=1 print(len(ans)+1) print(*(ans+[0])) #Copied ```
output
1
78,553
20
157,107
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,554
20
157,108
Tags: binary search, greedy, number theory Correct Solution: ``` """ Template written to be used by Python Programmers. Use at your own risk!!!! Owned by enraged(rating - 5 star at CodeChef and Specialist at Codeforces). """ import sys from functools import lru_cache, cmp_to_key from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log from collections import defaultdict as dd, deque, Counter as c from itertools import combinations as comb, permutations as perm from bisect import bisect_left as bl, bisect_right as br, bisect # sys.setrecursionlimit(2*pow(10, 6)) # sys.stdin = open("input.txt", "r") # sys.stdout = open("output.txt", "w") mod = pow(10, 9) + 7 mod2 = 998244353 def data(): return sys.stdin.readline().strip() def out(var): sys.stdout.write(str(var)) def outln(var): sys.stdout.write(str(var)+"\n") def l(): return list(sp()) def sl(): return list(ssp()) def sp(): return map(int, data().split()) def ssp(): return map(str, data().split()) def l1d(n, val=0): return [val for i in range(n)] def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)] def k_bonacci(n): if n < k: return 0 if n == k: return 1 if n in dp.keys(): return dp[n] dp[n] = 0 for i in range(n-k, n): dp[n] += k_bonacci(i) return dp[n] s, k = sp() answer = [] if k <= 32: dp = dd(int) i = 1 while True: dp[i] = k_bonacci(i) if dp[i] >= pow(10, 9): break i += 1 arr = list(dp.values()) while s > 0: temp = bl(arr, s) if arr[temp] > s: temp -= 1 s -= arr[temp] answer.append(arr[temp]) else: i = 32 while i >= 0 and s > 0: if pow(2, i) <= s: s -= pow(2, i) answer.append(pow(2, i)) i -= 1 if len(answer) < 2: answer.insert(0, 0) outln(len(answer)) print(*answer) ```
output
1
78,554
20
157,109
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,555
20
157,110
Tags: binary search, greedy, number theory Correct Solution: ``` s,k=map(int,input().split()) F = [0,1] b = set() while True: f = sum(F[-k:]) if f > s: break F.append(f) for i in reversed(F): if i <= s: b.add(i) s -= i print(len(b)) print (' '.join(map(str,b))) ```
output
1
78,555
20
157,111
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,556
20
157,112
Tags: binary search, greedy, number theory Correct Solution: ``` from sys import stdin,stdout,setrecursionlimit from functools import lru_cache, cmp_to_key from heapq import merge, heapify, heappop, heappush from math import * from collections import defaultdict as dd, deque, Counter as C from itertools import combinations as comb, permutations as perm , accumulate from bisect import bisect_left as bl, bisect_right as br, bisect from time import perf_counter from fractions import Fraction import copy import time starttime = time.time() mod = int(pow(10, 9) + 7) mod2 = 998244353 # from sys import stdin # input = stdin.readline #def data(): return sys.stdin.readline().strip() def data(): return input() def num():return int(input()) def L(): return list(sp()) def sl(): return list(ssp()) def sp(): return map(int, data().split()) def ssp(): return map(str, data().split()) def l1d(n, val=0): return [val for i in range(n)] def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)] def pmat(A): for ele in A: print(*ele,end="\n") def pmat2(A): for ele in A: for j in ele: print(j,end='') print() def iseven(n): return n%2==0 def seive(r): prime=[1 for i in range(r+1)] prime[0]=0 prime[1]=0 for i in range(r+1): if(prime[i]): for j in range(2*i,r+1,i): prime[j]=0 return prime #solution s,k=sp() f=[0,1] while True: cur=sum(f[-k:]) if cur>s: break f.append(cur) f=list(set(f));f.sort() i=len(f)-1;ans=[] while(s and i>0): if f[i]<=s: s-=f[i] ans.append(f[i]) i-=1 print(len(ans)+1) print(*ans+[0]) #Copied endtime = time.time() #print(f"Runtime of the program is {endtime - starttime}") ```
output
1
78,556
20
157,113
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,557
20
157,114
Tags: binary search, greedy, number theory Correct Solution: ``` s, k = map(int, input().split()) p, t, l = [0], [0, 1, 1], 2 while t[l] < s: t.append((t[l] << 1) - (0 if l < k else t[l - k])) l += 1 t.reverse() for i in t: if i > s: continue p.append(i) s -= i if s == 0: break print(len(p)) print(' '.join(map(str, p))) ```
output
1
78,557
20
157,115
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,558
20
157,116
Tags: binary search, greedy, number theory Correct Solution: ``` import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline def binarySearch(arr,l,r,val): while l<=r: mid=(l+r)//2 if arr[mid]==val: ans=mid break elif arr[mid]<val: ans=mid l=mid+1 else: r=mid-1 return ans def fib(k,s): arr=[] i=1 temp=True l=0 while temp: if k>i: arr.append(0) l+=1 if arr[-1]>s: arr.pop() l-=1 break i=k elif k==i: arr.append(1) l+=1 if arr[-1]>s: arr.pop() l-=1 break i+=1 else: if l<=k: num=sum(arr) arr.append(num) l+=1 if arr[-1]>s: arr.pop() l-=1 break else: num+=arr[-1] num-=arr[-k-1] arr.append(num) l+=1 if arr[-1]>s: arr.pop() l-=1 break i+=1 return arr s,k=list(map(int,input().split())) arr=fib(k,s) l=len(arr)-1 ans=arr[l] lis=[ans] while ans<s: temp=s-ans ind=binarySearch(arr,0,l,temp) ans+=arr[ind] lis.append(arr[ind]) answer=[] a=len(lis) if a==1: lis.append(0) a+=1 for i in range(1,a+1): answer.append(lis[-i]) print(a) print(" ".join(str(x) for x in answer)) ```
output
1
78,558
20
157,117
Provide tags and a correct Python 3 solution for this coding contest problem. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16
instruction
0
78,559
20
157,118
Tags: binary search, greedy, number theory Correct Solution: ``` s, k = map(int, input().split()) freq = [1] while freq[-1] < s: x = 0 for i in range(max(0, len(freq)-k), len(freq)): x += freq[i] freq.append(x) res = [0] idx = len(freq) - 1 while s != 0: while freq[idx] > s: idx -= 1 res.append(freq[idx]) s -= freq[idx] print(len(res)) print(*res) ```
output
1
78,559
20
157,119
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16 Submitted Solution: ``` def power(a, b): if b == 0: return 1 elif b % 2 == 0: a_1 = a * a return pow(a_1, b // 2) return a * pow(a, b - 1) def k_fib(s, k): result = [0] if k >= 40: fibs = [power(2, i) for i in range(40)] else: fibs = [0] * (k - 1) + [1] while fibs[len(fibs) - 1] < s: fibs.append(sum(fibs[-k:])) while s > 0: if fibs[len(fibs) - 1] <= s: result.append(fibs[len(fibs) - 1]) s -= fibs[len(fibs) - 1] fibs.pop() return result S, K = [int(j) for j in input().split()] print(len(k_fib(S, K))) print(*k_fib(S, K)) ```
instruction
0
78,561
20
157,122
Yes
output
1
78,561
20
157,123
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16 Submitted Solution: ``` [s, k] = [int(x) for x in input().split()] numbers = [1] numbers.append(1) last = 1 index = 1 while last <= s: l_index = index-k if l_index >= 0: last = last * 2 - numbers[l_index] else: last *= 2 # print(last, l_index) if last <= s: numbers.append(last) index += 1 numbers.reverse() numbers.append(0) # for s in range(0, 100000): output = [] for i in numbers: if i <= s: s -= i output.append(i) print(len(output)) print(" ".join([str(x) for x in output])) ```
instruction
0
78,562
20
157,124
Yes
output
1
78,562
20
157,125
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16 Submitted Solution: ``` s,k=map(int,input().split()) a=[] series=[] n=0 seq=[] while sum(series)<=s: if n+1<k: series.append(0) elif n+1==k: series.append(1) else: series.append(sum(series[n-k:n])) n+=1 for i in series: if i not in seq: seq.append(i) while(s!=0): temp=0 seq.sort(reverse=True) a.append(seq[0]) s-=seq.pop(0) while sum(seq)>=s and s!=0: x=seq.pop(0);temp=1 if temp==1:seq.append(x);seq.sort() print(len(a)) print(*a) ```
instruction
0
78,565
20
157,130
No
output
1
78,565
20
157,131
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Numbers k-bonacci (k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: * F(k, n) = 0, for integer n, 1 ≀ n < k; * F(k, k) = 1; * F(k, n) = F(k, n - 1) + F(k, n - 2) + ... + F(k, n - k), for integer n, n > k. Note that we determine the k-bonacci numbers, F(k, n), only for integer values of n and k. You've got a number s, represent it as a sum of several (at least two) distinct k-bonacci numbers. Input The first line contains two integers s and k (1 ≀ s, k ≀ 109; k > 1). Output In the first line print an integer m (m β‰₯ 2) that shows how many numbers are in the found representation. In the second line print m distinct integers a1, a2, ..., am. Each printed integer should be a k-bonacci number. The sum of printed integers must equal s. It is guaranteed that the answer exists. If there are several possible answers, print any of them. Examples Input 5 2 Output 3 0 2 3 Input 21 5 Output 3 4 1 16 Submitted Solution: ``` import math,sys #from itertools import permutations, combinations;import heapq,random; from collections import defaultdict,deque import bisect as bi def yes():print('YES') def no():print('NO') #sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w'); def I():return (int(sys.stdin.readline())) def In():return(map(int,sys.stdin.readline().split())) def Sn():return sys.stdin.readline().strip() #sys.setrecursionlimit(1500) def dict(a): d={} for x in a: if d.get(x,-1)!=-1: d[x]+=1 else: d[x]=1 return d def find_gt(a, x): 'Find leftmost value greater than x' i = bi.bisect_left(a, x) if i != len(a): return i else: return -1 def main(): try: s,n=In() if n<=32: l=[0]*(n+1) l[n]=1 for i in range(n+1,n+34): total=0 for j in range(i-n,i): total+=l[j] l.append(total) ans=[] j=len(l)-1 while s>0: if l[j]<=s and l[j]!=0: ans.append(l[j]) s-=l[j] j-=1 if len(ans)==1: ans.append(0) print(len(ans)) print(*ans) else: ans=[] j=30 while s: t=pow(2,j) if t<=s: ans.append(t) s%=t j-=1 if len(ans)==1: ans.append(0) print(len(ans)) print(*ans) except: pass M = 998244353 P = 1000000007 if __name__ == '__main__': # for _ in range(I()):main() for _ in range(1):main() #End# # ******************* All The Best ******************* # ```
instruction
0
78,566
20
157,132
No
output
1
78,566
20
157,133
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,588
20
157,176
Tags: brute force, greedy Correct Solution: ``` s = input() i = 0 while i < len(s): if i < len(s)-2 and s[i] == '1' and s[i+1] == '4' and s[i+2] == '4': i += 3 elif i < len(s)-1 and s[i] == '1' and s[i+1] == '4': i += 2 elif s[i] == '1': i += 1 else: break if i == len(s): print('YES') else: print('NO') ```
output
1
78,588
20
157,177
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,589
20
157,178
Tags: brute force, greedy Correct Solution: ``` n = input() n = n.replace('144',' ') n = n.replace('14'," ") n = n.replace("1",' ') if set(n) == {" "}: print("YES") else: print("NO") ```
output
1
78,589
20
157,179
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,590
20
157,180
Tags: brute force, greedy Correct Solution: ``` num = input() judge = True for i in list(num): if i != '1' and i != '4': judge = False break if '444' in num or num[0] == '4' or num[0:1] == '44': judge = False if judge: print('YES') else: print('NO') ```
output
1
78,590
20
157,181
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,591
20
157,182
Tags: brute force, greedy Correct Solution: ``` s = input() n = len(s) i = 0 f = 1 while i < n: if i == 0 and s[i] != '1': f = 0 break if i == 1 and s[i] != '1' and s[i]!= '4': f = 0 break if i >= 2: if s[i] == '1': i += 1 continue elif s[i] == '4' and s[i-1] == '1': i += 1 continue elif s[i] == '4' and s[i-1] == '4' and s[i-2] == '1': i += 1 continue else: f = 0 break i += 1 if f: print("YES") else: print("NO") ```
output
1
78,591
20
157,183
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,592
20
157,184
Tags: brute force, greedy Correct Solution: ``` s = input() s = list(s) i = len(s) - 1 f = 0 while i >= 0: if len(s) >= 3 and s[i] == '4' and s[i - 1] == '4' and s[i - 2] == '1' : s.pop(i) s.pop(i - 1) s.pop(i - 2) i = i - 3 elif len(s) >= 2 and s[i] == '4' and s[i - 1] == '1' : s.pop(i) s.pop(i - 1) i = i - 2 elif s[i] == '1': s.pop(i) i = i - 1 else : f = 1 break if f == 1: print("NO") elif f == 0 and len(s) == 0: print("YES") ```
output
1
78,592
20
157,185
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,593
20
157,186
Tags: brute force, greedy Correct Solution: ``` n = input() c = len(n) flag = 0 i = 0 while(i<c): if(i<c-2 and n[i]=='1' and n[i+1]=='4' and n[i+2]=='4'): i+=3 elif(i<c-1 and n[i]=='1' and n[i+1]=='4'): i+=2 elif(n[i]=='1'): i+=1 else: flag = 1 break if(flag==0): print('YES') else: print('NO') ```
output
1
78,593
20
157,187
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,594
20
157,188
Tags: brute force, greedy Correct Solution: ``` n = input() c = 0 if not n[0] == '1': print('NO') elif not n.count('1')+n.count('4')==len(n): print('NO') else: for i in range(len(n)): if n[i]=='4': if not (n[i-1]=='1' or (n[i-1]=='4' and n[i-2]=='1')): print('NO') c=1 break if not c: print('YES') ```
output
1
78,594
20
157,189
Provide tags and a correct Python 3 solution for this coding contest problem. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO
instruction
0
78,595
20
157,190
Tags: brute force, greedy Correct Solution: ``` inpt = str(input()) while inpt != '': if inpt[:3] == '144': inpt = inpt[3:] elif inpt[:2] == '14': inpt = inpt[2:] elif inpt [0] == '1': inpt = inpt[1:] else: print('NO') break if inpt == '': print ('YES') ```
output
1
78,595
20
157,191
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` s = input() streak4 = 0 bad = False if s[0] != '1': bad = True for c in s: if c == '1': streak4 = 0 elif c == '4': if streak4 == 2: bad = True break else: streak4 += 1 else: bad = True break if bad: print("NO") else: print("YES") ```
instruction
0
78,596
20
157,192
Yes
output
1
78,596
20
157,193
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` def func(s): for x in s: if x != '1' and x != '4': return False if s[0] == '4': return False if s.find("444") != -1: return False return True s = input() if (func(s)): print("YES") else: print("NO") ```
instruction
0
78,597
20
157,194
Yes
output
1
78,597
20
157,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` n=input() ans="YES" while len(n)!=0: if n[:3] == "144": n=n[3:] elif n[:2] == "14": n=n[2:] elif n[:1] == "1": n=n[1:] else: ans="NO" break print(ans) ```
instruction
0
78,598
20
157,196
Yes
output
1
78,598
20
157,197
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` S=input() v=0 v1=0 c=0 for i in range(len(S)) : if S[i]=='1' : if v1>=1 : v1=0 v=1 else : v=v+1 else : if v==0 or v1>=2 or S[i]!='4' : c=1 break else : v1=v1+1 if c==0 : print('YES') else : print('NO') ```
instruction
0
78,599
20
157,198
Yes
output
1
78,599
20
157,199
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` n = str(input()) x,y,z = 0,0,0 x += n.count("144") y += n.count("14") z += n.count("1") print("YES" if len(n) == 3*x+2*y+z-x-y else "N0") ```
instruction
0
78,600
20
157,200
No
output
1
78,600
20
157,201
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` import re mat = re.compile(r'([02356789]*)') res = mat.findall('114114') if res: print ("NO") else: print ("YES") ```
instruction
0
78,601
20
157,202
No
output
1
78,601
20
157,203
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` n = input() if int(n.replace("144","0").replace("14","0").replace("1","0")) == 0: print ("YES") else: print ("NO") ```
instruction
0
78,602
20
157,204
No
output
1
78,602
20
157,205
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not. You're given a number. Determine if it is a magic number or not. Input The first line of input contains an integer n, (1 ≀ n ≀ 109). This number doesn't contain leading zeros. Output Print "YES" if n is a magic number or print "NO" if it's not. Examples Input 114114 Output YES Input 1111 Output YES Input 441231 Output NO Submitted Solution: ``` s = input() a = "YES" for i in s: if ((i != '1') and (i != '4')): a = 'NO' break print(a) ```
instruction
0
78,603
20
157,206
No
output
1
78,603
20
157,207