problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03319
u038854253
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['def sunuke_sum(arg):\n sum_digit = 0\n for char in arg:\n sum_digit += int(char)\n return sum_digit\n\n\ninput_num = int(input())\n\nsunuke_list = []\nmin_sunuke_div = 10 ** 20\nfor d in reversed(range(1, 16)):\n for n in reversed(range(10, 100)):\n i = n * (10 ** d) + (10 ** d - 1)\n sunuke_div = i / sunuke_sum(str(i))\n if min_sunuke_div >= sunuke_div:\n sunuke_list.append(i)\n min_sunuke_div = sunuke_div\n\nfor i in reversed(range(1, 101)):\n sunuke_div = i / sunuke_sum(str(i))\n if min_sunuke_div >= sunuke_div:\n sunuke_list.append(i)\n min_sunuke_div = sunuke_div\n\nsunuke_list.reverse()\n\nfor i in range(0, input_num):\n print(sunuke_list[i])\n', 'input_line = input().split()\n\nnum_array = int(input_line[0])\nnum_equal = int(input_line[1])\n\ninput_line = input()\narray_str = input_line.split()\n\narray = list(map(int, array_str))\n\nfor index, number in enumerate(array):\n if number == 1:\n index_min = index\n break\n\n# from forward\n\nequalized = 1\ni = 1\nwhile equalized < num_array:\n equalized += (num_equal - 1)\n # print(i, equalized)\n i += 1\n\nprint(i - 1)\n']
['Runtime Error', 'Accepted']
['s797120708', 's572311595']
[3064.0, 14584.0]
[17.0, 50.0]
[714, 430]
p03319
u050428930
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N,K=map(int,input().split())\nprint(-(1-N)//(K-1))\n', 'N,K=map(int,input().split())\nif N-1%(K-1):\n n=0\nelse:\n n=1\nprint((N-1)//(K-1)+n)\n', 'N,K=map(int,input().split())\nprint(-((1-N)//(K-1)))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s023602135', 's911301044', 's932217517']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[50, 87, 52]
p03319
u057964173
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import sys\ndef input(): return sys.stdin.readline().strip()\n\ndef resolve():\n n,k=map(int, input().split())\n l=list(map(int,input().split()))\n cnt=0\n if n<=k:\n print(1)\n else:\n\n while True:\n n-=k\n n+=1\n cnt+=1\n if n<=k:\n cnt+=1\n print(cnt)\n break\nreso', 'import sys\ndef input(): return sys.stdin.readline().strip()\n\ndef resolve():\n n,k=map(int, input().split())\n l=list(map(int,input().split()))\n cnt=0\n while True:\n if n<=k:\n cnt+=1\n print(cnt)\n break\n n -= k\n n += 1\n cnt += 1\nresolve()']
['Runtime Error', 'Accepted']
['s332370180', 's920397450']
[2940.0, 13812.0]
[17.0, 45.0]
[368, 306]
p03319
u076306174
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\n\nN,K=map(int, inp[0].split()) \nA=list(map(int, inp[0].split())) \n\n\nif N==K:\n print(1)\nelse:\n print(math.ceil((N-1)/(K-1)))\n', 'import math\n\nN,K=map(int, input().split()) \nA=list(map(int, input().split())) \n\n\nif N==K:\n print(1)\nelse:\n print(math.ceil((N-1)/(K-1)))\n']
['Runtime Error', 'Accepted']
['s365862707', 's981251964']
[2940.0, 13812.0]
[17.0, 40.0]
[302, 304]
p03319
u077003677
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
["import sys\nimport os\n\ndef file_input():\n f = open('ARC099/input.txt', 'r')\n sys.stdin = f\n\ndef main():\n #file_input()\n # int(input())\n N,K=map(int, input().split())\n A_li=list(map(int, input().split()))\n # print(min)\n\n print(-(-(N-K)//(K-1)))\n\nif __name__ == '__main__':\n main()\n", "import sys\nimport os\n\ndef file_input():\n f = open('ARC099/input.txt', 'r')\n sys.stdin = f\n\ndef main():\n #file_input()\n # int(input())\n N,K=map(int, input().split())\n A_li=list(map(int, input().split()))\n # print(min)\n\n print(-(-N//(K-1))\n\nif __name__ == '__main__':\n main()\n", "import sys\nimport os\n\ndef file_input():\n f = open('ARC099/input.txt', 'r')\n sys.stdin = f\n\ndef main():\n #file_input()\n # int(input())\n N,K=map(int, input().split())\n A_li=list(map(int, input().split()))\n # print(min)\n\n print(-(-(N-K)//(K-1))+1)\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s422861600', 's580492960', 's701117041']
[13880.0, 2940.0, 13880.0]
[39.0, 17.0, 40.0]
[306, 301, 308]
p03319
u090406054
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\na=list(map(int,input().split()))\ns=0\nfor i in range(n):\n if a[i]==1:\n s+=(i+1)\n break\n\nif s%k!=0 and n%k!=0:\n print(n//k+1)\nelif s%k!=0 and n%k==0:\n print(n//k)\nelse:\n print(n//k+2)\n\n', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\ns=0\nfor i in range(n):\n if a[i]==1:\n s+=(i+1)\n break\n\nif s%k!=0 and n%k!=0:\n print(n//k+1)\nelif s%k!=0 and n%k==0:\n print(n//k)\nelif s%k==0 and n%k==0:\n print(n//k+1)\nelse:\n print(n//k+2)\n', 'def main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n cnt = 1\n field = K\n for i in range(N):\n if field >= N:\n break\n field += K-1\n cnt += 1\n print(cnt)\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s513568542', 's927210982', 's325052143']
[14008.0, 14008.0, 13880.0]
[46.0, 46.0, 45.0]
[222, 261, 271]
p03319
u135116520
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\nN,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint(math.floor(N/K))', 'N,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint((N-1)/(K-1))\n', 'N,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint(math.ceil((N-1)/(K-1)))', 'import math\nN,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint(math.ceil((N-1)/(K-1)))']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s280704842', 's657191079', 's972487133', 's693927271']
[13812.0, 14008.0, 13880.0, 13812.0]
[40.0, 40.0, 40.0, 40.0]
[96, 81, 91, 103]
p03319
u136090046
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['from math import ceil\n\nn, k = map(int, input().split())\narray = [int(x) for x in input().split()]\n\nif n <= k:\n print(1)\n exit()\nres = 0\n\nrange_left = array.index(1)\nrange_right = n - range_left - 1\nprint(range_left, range_right)\n\nk -= 1\nif range_left == 0:\n res += ceil(range_right / k)\n print(res)\n exit()\nelif range_right == 0:\n res += ceil(range_left / k)\n print(res)\n exit()\n\nif range_left <= k:\n res += 1\n range_right -= (k - range_left)\n res += ceil(range_right / k)\nelse:\n res += ceil(range_left / k)\n tmp = 0\n while tmp < range_left:\n tmp += k\n range_right -= tmp % range_left\n res += ceil(range_right / k)\nprint(res)\n', 'import math\n\nn, k = map(int, input().split())\narray = [int(x) for x in input().split()]\n\ntmp = array.index(1)\n\nif tmp == 0:\n res1 = 0\n res2 = math.ceil((n-1)/(k-1))\nelif tmp == n-1:\n res1 = math.ceil((n-1)/(k-1))\n res2 = 0\nelse:\n res1 = math.ceil((tmp)/(k-1))\n res2 = math.ceil((n-tmp-1)/(k-1))\n\nprint(res1,res2)\n', 'from math import ceil\n\nn, k = map(int, input().split())\narray = [int(x) for x in input().split()]\n\nif n <= k:\n print(1)\n exit()\nres = 0\n\nrange_left = array.index(1)\nrange_right = n - range_left - 1\n\nk -= 1\nif range_left == 0:\n res += ceil(range_right / k)\n print(res)\n exit()\nelif range_right == 0:\n res += ceil(range_left / k)\n print(res)\n exit()\n\nif range_left <= k:\n res += 1\n range_right -= (k - range_left)\n res += ceil(range_right / k)\nelse:\n res += ceil(range_left / k)\n tmp = 0\n while tmp < range_left:\n tmp += k\n range_right -= tmp % range_left\n res += ceil(range_right / k)\nprint(res)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s243206481', 's629829853', 's554196854']
[13812.0, 13812.0, 13812.0]
[46.0, 45.0, 48.0]
[812, 331, 781]
p03319
u170324846
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\nN, K = map(int, input().split())\nA = input().split()\nt = A.index("1")\nprint(t)\nif (N - 1) % (K - 1) == 0 and t % (K - 1) == 0 and t != 0 and t != N - 1 and K != 2:\n print(math.ceil((N - 1)/(K - 1)) + 1)\n print(1)\nelse:\n print(math.ceil((N - 1)/(K - 1)))', 'import math\nN, K = map(int, input().split())\nA = input().split()\nt = A.index("1")\nif (N - 1) % (K - 1) == 0 and t % (K - 1) == 0 and t != 0 and t != N - 1 and K != 2:\n print(math.ceil((N - 1)/(K - 1)) + 1)\nelse:\n print(math.ceil((N - 1)/(K - 1)))\n']
['Wrong Answer', 'Accepted']
['s910004028', 's944085785']
[10420.0, 10420.0]
[26.0, 25.0]
[268, 249]
p03319
u184070848
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import numpy as np\nfrom math import ceil\n\nN, K = tuple(map(int, input().split()))\nA = np.array([int(x) for x in input().split()])\n\nI = np.argmin(A)\nD = min(N - I, I) - 1\nC = K - 1\nsmall_part = ceil(D / C)\nrem = C * small_part - D\n\nprint(small_part + ceil((N - rem) / C))', 'import numpy as np\nfrom math import ceil\n\nN, K = tuple(map(int, input().split()))\nA = np.array([int(x) for x in input().split()])\n\nI = np.argmin(A)\nD = min(N - I, I)\nC = K - 1\nsmall_part = ceil(D / C)\nrem = C * small_part - D\n\nprint(small_part + ceil((N - rem) / C))', 'import numpy as np\nfrom math import ceil\n\nN, K = tuple(map(int, input().split()))\nA = np.array([int(x) for x in input().split()])\n\nI = np.argmin(A)\nD = max(1, min(N - I, I) - 1)\nC = K - 1\nsmall_part = ceil(D / C)\ndone = C * small_part + 1\n\nprint(small_part + ceil((N - done) / C))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s008860281', 's778880894', 's901675172']
[23444.0, 23436.0, 23392.0]
[260.0, 191.0, 188.0]
[270, 266, 280]
p03319
u226233437
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int,input().split())\nprint((N-1)//(K-1))', 'import math\nN, K = map(int,input().split())\nprint(math.ceil((N-1)/(K-1)))']
['Wrong Answer', 'Accepted']
['s823007825', 's441711217']
[3064.0, 3060.0]
[17.0, 18.0]
[51, 73]
p03319
u227082700
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k,*_=open(0);print(((int(n)-2)//(int(k)-1))+1)', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nprint((n-2)//(k-1)+1)']
['Runtime Error', 'Accepted']
['s291418845', 's672705458']
[4084.0, 14004.0]
[18.0, 40.0]
[48, 83]
p03319
u252883287
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import numpy as np\nprint(0)', "def ii():\n return int(input())\n\n\ndef lii():\n return list(map(int, input().split(' ')))\n\n\ndef lvi(N):\n l = []\n for _ in range(N):\n l.append(ii())\n return l\n\n\ndef lv(N):\n l = []\n for _ in range(N):\n l.append(input())\n return l\n\n\ndef main():\n N, K = lii()\n a = lii()\n min_ix = None\n for i, v in enumerate(a):\n if v == 1:\n min_ix = i\n break\n\n def t(n, k):\n if n <= 0: return 0, 0\n\n ans = n // k\n if n % k:\n ans += 1\n return ans, n % k\n\n if N-1 - min_ix >= K-1 and min_ix >= K-1:\n ans1, p1 = t(min_ix, K-1)\n ans2, p2 = t(N-1 - min_ix, K-1)\n ans = ans1 + ans2\n if p1 > 0 and p2 > 0 and p1 + p2 <= K-1:\n ans -= 1\n return ans\n\n elif min_ix < K-1:\n d = K-1 - min_ix\n ans, _ = t(N-1 - min_ix - d, K-1)\n return 1 + ans\n\n elif N-1 - min_ix < K-1:\n d = K-1 - (N-1 - min_ix)\n ans, _ = t(min_ix - d, K-1)\n return ans + 1\n\n\nif __name__ == '__main__':\n print(main())"]
['Wrong Answer', 'Accepted']
['s155575786', 's857739710']
[12424.0, 13812.0]
[150.0, 43.0]
[27, 1070]
p03319
u257374434
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['\n\n\ndef n_snuke(n):\n return n /sum(map(int,str(n)))\n\n\n# (100o+10x+y)/(o+x+y) > (100o+99)/(o+9+9)\n# 100o*18+(10x+y)(o+18) > 100o(x+y) +99(o+x+y)\n\n\n#\n#1 - 10 , 19,29,39,49,59,69,79,89,99\n\n\n# print(i,n_snuke(i))\n\n\nK = int(input())\ntmp =0\n\ntmp_list = []\nfor i in range(K*3):\n tmp = tmp+ 10**(len(str(tmp+1))-1)\n tmp_list.append(tmp)\n #print(tmp,n_snuke(tmp))\nr_list = [tmp_list[-1]]\nfor i in reversed(range(len(tmp_list)-1)):\n if n_snuke(r_list[-1]) >= n_snuke(tmp_list[i]):\n r_list.append(tmp_list[i])\n\nfor i in reversed(r_list[-K:]):\n print(i)\n', 'import math\nN, K = list(map(int, input().split()))\nprint(math.ceil((N-1)/(K-1)))']
['Runtime Error', 'Accepted']
['s783502164', 's903685833']
[3064.0, 3060.0]
[17.0, 18.0]
[594, 80]
p03319
u268792407
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\nprint((n-k)//(k-1) +1)', 'n,k=map(int,input().split())\nprint((n-2)//(k-1) +1)']
['Wrong Answer', 'Accepted']
['s509726841', 's299767001']
[2940.0, 2940.0]
[17.0, 17.0]
[51, 51]
p03319
u276204978
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nif A.index(1) + N - A.index(1) - 1 < K:\n print(1)\nelse:\n print(int(np.ceil(A.index(1)/(K-1))+np.ceil((N - A.index(1) - 1)/(K-1))))', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\n \nprint((N-2)//(K-1)+1)']
['Runtime Error', 'Accepted']
['s002624247', 's446463589']
[13880.0, 13940.0]
[42.0, 41.0]
[206, 92]
p03319
u278886389
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\n\nN,K = map(int,input().split(" "))\n\nprint(math.ceil((N-1)/K-1))', 'import math\n\nN,K = map(int,input().split(" "))\n\nprint(math.ceil((N-1)/(K-1)))']
['Wrong Answer', 'Accepted']
['s780636779', 's196560306']
[3060.0, 3060.0]
[17.0, 17.0]
[75, 77]
p03319
u285443936
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA =list(map(int, input().split()))\n\nif K >= N:\n print(1)\n exit()\n\nidx = A.index(1)\nR = (N - 1 - idx) // (K - 1) if (N - 1 - idx) % (K - 1) == 0 else (N -1 - idx) // (K - 1) + 1 \nL = (idx - 0) // (K - 1) if (idx - 0) % (K - 1) == 0 else (idx - 0) // (K - 1)\nprint(R, L)\nprint(R + L)', 'N, K = map(int, input().split())\nA =list(map(int, input().split()))\n\nif K >= N:\n print(1)\n exit()\n\nidx = A.index(1)\nif 0 <= idx <= K - 1 or N - 1 - (K - 1) <= idx <= N - 1:\n ans = N // (K - 1) if N % (K - 1) == 0 else N // (K - 1) + 1\n print(ans)\n exit()\n\nR = (N - 1 - idx) // (K - 1) if (N - 1 - idx) % (K - 1) == 0 else (N -1 - idx) // (K - 1) + 1 \nL = (idx - 0) // (K - 1) if (idx - 0) % (K - 1) == 0 else (idx - 0) // (K - 1)\nprint(R + L)']
['Wrong Answer', 'Accepted']
['s956260690', 's032030958']
[13812.0, 14008.0]
[41.0, 42.0]
[316, 447]
p03319
u287500079
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int, input().split())\na=[int(i) for in input().split()]\nif n==k:\n print(1)\nelse:\n k-=1\n print((n+k-1)//k)', 'n,k=map(int, input().split())\na=[int(i) for i in input().split()]\nif n==k:\n print(1)\nelse:\n k-=1\n print((n+k-2)//k)']
['Runtime Error', 'Accepted']
['s626150233', 's673688134']
[2940.0, 13880.0]
[17.0, 44.0]
[122, 124]
p03319
u301624971
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
["from math import ceil\ndef myAnswer(N:int,K:int,A:list) -> int:\n return ceil(N-1 + K -1)\n\ndef modelAnswer():\n return\ndef main():\n N,K = map(int,input().split())\n A = list(map(int,input().split()))\n print(myAnswer(N,K,A[:]))\nif __name__ == '__main__':\n main()", "from math import ceil\ndef myAnswer(N:int,K:int,A:list) -> int:\n return ceil((N - 1)/(K - 1))\n\n\ndef modelAnswer():\n return\ndef main():\n N,K = map(int,input().split())\n A = list(map(int,input().split()))\n print(myAnswer(N,K,A[:]))\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Accepted']
['s788003984', 's899163365']
[13812.0, 13812.0]
[41.0, 40.0]
[269, 275]
p03319
u311636831
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nm=min(A)\na=A.index(m)\ntmp=0\ntmp+=math.ceil(a/(K-1))\ntmp+=math.ceil((N-a-1)/(K-1))', 'import math\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nans = math.ceil((N-K) / (K - 1)) + 1\nprint(ans)\n ']
['Wrong Answer', 'Accepted']
['s451367076', 's104174957']
[13812.0, 13812.0]
[43.0, 40.0]
[164, 130]
p03319
u339199690
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import sys\n\nN, K = map(int, input().split())\nA = list(map(int, sys.stdin.readline().rsplit()))\n\nprint((N - 1) // (K - 1))\n', 'import sys, math\n\nN, K = map(int, input().split())\nA = list(map(int, sys.stdin.readline().rsplit()))\n\nprint(math.ceil((N - 1) / (K - 1)))\n']
['Wrong Answer', 'Accepted']
['s550830077', 's574883435']
[13876.0, 13876.0]
[39.0, 40.0]
[122, 138]
p03319
u340781749
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n, k = map(int, input().split())\nprint((n - 2) // (k - 2) + 1)\n', 'n, k = map(int, input().split())\nprint((n - 2) // (k - 1) + 1)\n']
['Runtime Error', 'Accepted']
['s889271078', 's646284826']
[2940.0, 2940.0]
[17.0, 17.0]
[63, 63]
p03319
u355853184
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\n\nN, K = map(int, input().split())\nA_list = list(map(int, input().split()))\n\nans = (N-1)//(K-1)\nif K != N:\n print(ans)\nelse:\n print(1)\n\n\npos_1 = 0 \nfor i in range(N):\n if A_list[i] == 1:\n pos_1 = i\n\nans1 = math.ceil((pos_1)/(K-1)) + math.ceil((N-1-pos_1)/(K-1))\nans2 = math.ceil((pos_1-1)/(K-1)) + math.ceil((N-1-pos_1+1)/(K-1))\nans3 = math.ceil((pos_1+1)/(K-1)) + math.ceil((N-1-pos_1-1)/(K-1))\n\nif K != N:\n print(min(ans1, ans2, ans3))\nelse:\n print(1)', 'import math\n\nN, K = map(int, input().split())\nA_list = list(map(int, input().split()))\n\nans = (N-1)//(K-1)\nif K != N:\n print(ans)\nelse:\n print(1)', 'import math\n\nN, K = map(int, input().split())\nA_list = list(map(int, input().split()))\n\nans = math.ceil((N-1)/(K-1))\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s032967594', 's196899030', 's775810511']
[20320.0, 20480.0, 20632.0]
[60.0, 48.0, 51.0]
[486, 151, 127]
p03319
u394721319
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
["n,k = map(int,input().split())\nl = list(map(int,input().split()))\n\na = l.index(min(l))\nb = a\n\ncount = 0\nwhile b>0:\n b -= k-1\n count += 1\n print('a')\n\nwhile a<n-1:\n a += k-1\n count += 1\n print('b')\n\nprint(count)\n", 'n,k = map(int,input().split())\nl = list(map(int,input().split()))\n\na = l.index(min(l))\nb = a\n\np = n//2\ncount = 0\nif p>a:\n while b>0:\n b -= k-1\n count += 1\n\n while a<n-1+b:\n a += k-1\n count += 1\n\nelse:\n while a<n-1:\n a += k-1\n count += 1\n\n while b>a-n+1:\n b -= k-1\n count += 1\n\nprint(count)\n']
['Wrong Answer', 'Accepted']
['s989055166', 's526047092']
[13880.0, 14008.0]
[76.0, 54.0]
[229, 358]
p03319
u442030035
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = input().split()\ncount = 0\nif N = K:\n print(1)\nelse:\n count += 1\n rem = N-K\n add = 1 if (N-K)%(K-1) else 0\n count += (N-K)//(K-1) + add\n print(count)', 'import math\n\nN, K = map(int, input().split())\nA = input()\nprint(math.ceil((N-1)/(K-1)))\n']
['Runtime Error', 'Accepted']
['s058067990', 's622705418']
[2940.0, 4724.0]
[17.0, 18.0]
[203, 88]
p03319
u452786862
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['\nK = int(input())\naaa = 1\nans_array = []\n\ndef sunuke(n):\n re = 0\n tmp = n\n while n:\n re += n % 10\n n = n//10\n re = tmp/re\n print(re)\n\ndef print_sunuke():\n global aaa\n num = aaa % 10\n if num == 0:\n aaa += 1\n print_sunuke()\n return\n nine = aaa // 10\n ans = str(num) + "9" * nine\n aaa += 1\n ans_array.append(int(ans))\n\n\n\n\nfor i in range(10000):\n\n print_sunuke()\n\nans_array.append(1899)\nans_array.append(2899)\nans_array.append(3899)\nans_array.append(4899)\nans_array.append(5899)\nans_array.append(6899)\nans_array.append(7899)\nans_array.append(8899)\nans_array.append(9899)\nans_array.append(18999)\nans_array.append(28999)\nans_array.append(38999)\nans_array.append(48999)\nans_array.append(58999)\nans_array.append(68999)\nans_array.append(78999)\nans_array.append(88999)\nans_array.append(98999)\nans_array.append(189999)\nans_array.append(289999)\nans_array.append(389999)\nans_array.append(489999)\nans_array.append(589999)\nans_array.append(689999)\nans_array.append(789999)\nans_array.append(889999)\nans_array.append(989999)\nans_array.append(1899999)\nans_array.append(2899999)\nans_array.append(3899999)\nans_array.append(4899999)\nans_array.append(5899999)\nans_array.append(6899999)\nans_array.append(7899999)\nans_array.append(8899999)\nans_array.append(9899999)\n\nans_array.append(18999999)\nans_array.append(28999999)\nans_array.append(38999999)\nans_array.append(48999999)\nans_array.append(58999999)\nans_array.append(68999999)\nans_array.append(78999999)\nans_array.append(88999999)\nans_array.append(98999999)\n\nans_array.append(189999999)\nans_array.append(289999999)\nans_array.append(389999999)\nans_array.append(489999999)\nans_array.append(589999999)\nans_array.append(689999999)\nans_array.append(789999999)\nans_array.append(889999999)\nans_array.append(989999999)\nans_array.append(1899999999)\nans_array.append(2899999999)\nans_array.append(3899999999)\nans_array.append(4899999999)\nans_array.append(5899999999)\nans_array.append(6899999999)\nans_array.append(7899999999)\nans_array.append(8899999999)\nans_array.append(9899999999)\n\nans_array.append(18999999999)\nans_array.append(28999999999)\nans_array.append(38999999999)\nans_array.append(48999999999)\nans_array.append(58999999999)\nans_array.append(68999999999)\nans_array.append(78999999999)\nans_array.append(88999999999)\nans_array.append(98999999999)\n\n\nans_array.sort()\n\nfor i in range(K):\n print(ans_array[i])\n\n\n\n', '# n = int(input())\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n# d = [list(map(int, input().split())) for _ in range(n)]\n\n\nif (N-1)%(K-1):\n ans =(N-1)//(K-1)+1\nelse:\n ans = (N-1) // (K - 1)\n\n\nprint(ans)\n\n\n# K = int(input())\n\n\n']
['Runtime Error', 'Accepted']
['s508051106', 's403363923']
[3192.0, 14008.0]
[18.0, 40.0]
[2411, 270]
p03319
u453642820
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['from math import ceil\nN,K=map(int,input().split())\nA=list(map(int,input().split()))\na=A.index(1)\nif N==2:\n print(1)\nelse:\n print(min(ceil(a/(K-1))+ceil((N-1-a)/(K-1)),1+ceil((a-1)/(K-1))+ceil((N-1-(a+1))/(K-1))),ceil((N-1)/(K-1)))', 'from math import ceil\nN,K=map(int,input().split())\nA=list(map(int,input().split()))\na=A.index(1)\nprint(min(ceil(a/(K-1))+ceil((N-1-a)/(K-1)),ceil((N-1)/(K-1))))']
['Wrong Answer', 'Accepted']
['s942265383', 's956880714']
[13812.0, 13812.0]
[41.0, 41.0]
[236, 160]
p03319
u467826805
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k = int(input().split())\nprint((n+k-3)/(k-1))\n', 'n,k = map(int,input().split())\nprint((n+k-3)/(k-1))\n', 'n,k = map(int(),input().split())\nprint((n+k-3)/(k-1))\n', 'n,k = int(input().split)\nprint((n+k-3)/(k-1))', 'n,k = map(int,input().split())\nprint((n+k-3)//(k-1))\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s045027402', 's114885382', 's316390577', 's496197629', 's429216006']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[48, 52, 54, 45, 53]
p03319
u470542271
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nimport math\n\nmath.ceil((n-1) / (k-1))\n', 'n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nimport math\n\nprint(math.ceil((n-1) / (k-1)))\n']
['Wrong Answer', 'Accepted']
['s249675617', 's121979560']
[13880.0, 13880.0]
[41.0, 40.0]
[108, 115]
p03319
u472883337
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nlis = list(map(int, input().split()))\nl = lis.index(1)\ni = 0\nj = 0\nr = (l + 1) % K\nR = (N - l) % K\n\nif r >= R:\n while l - i * K + i > 0:\n i += 1\n\n while l + r + j * K - j < N - 1:\n j += 1\n \n print(i + j)\n \nelse:\n while l - R - i * K + i > 0:\n i += 1\n\n while l + j * K - j < N - 1:\n j += 1\n \n print(i + j)', 'N, K = map(int, input().split())\nlis = list(map(int, input().split()))\nl = lis.index(1)\nLis = list(reversed(lis))\nL = Lis.index(1)\ni = 0\nj = 0\n\nif l + 1 >= K:\n r = (l + 1 - K) % (K - 1)\n if r != 0:\n r = K - 1 - r\nelse:\n r = K - l - 1\n \nif L + 1 >= K:\n R = K - (L + 1 - K) % (K - 1)\n if R != 0:\n R = K - 1 - R\nelse:\n R = K - L - 1\n\n\nif r >= R:\n if r == K - 1:\n r = 0\n \n while l - i * K + i > 0:\n i += 1\n\n while l + r + j * K - j < N - 1:\n j += 1\n \nelse:\n if R == K - 1:\n R = 0\n \n while L - i * K + i > 0:\n i += 1\n\n while L + R + j * K - j < N - 1:\n j += 1\n \nprint(max(1, i + j))\n']
['Wrong Answer', 'Accepted']
['s390332831', 's889998703']
[20500.0, 20592.0]
[60.0, 59.0]
[358, 623]
p03319
u496131003
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int,input().split())\nA = list(map(int,input().split()))\nn = A.index(min(A))\nn2 = N-1-n\na,b = divmod(n,K-1)\nc,d = divmod(n2,K-1)\nif b == d == 0:\n print(a+c)\nelif b+d < K\n print(a+c+1)\nelse:\n print(a+c+2)', 'N, K = map(int,input().split())\nA = list(map(int,input().split()))\nn = A.index(min(A))\nn2 = N-1-n\na,b = divmod(n,K-1)\nc,d = divmod(n2,K-1)\nif b == d == 0:\n print(a+c)\nelif b+d < K:\n print(a+c+1)\nelse:\n print(a+c+2)']
['Runtime Error', 'Accepted']
['s617913707', 's999704187']
[2940.0, 14008.0]
[17.0, 44.0]
[222, 223]
p03319
u499106786
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['args = int(input().rstrip())\n\ndef snuke(number):\n temp = list(str(number))\n arr = [ int(t) for t in temp] \n return sum(arr)\n\ndef find_snuke(args):\n result = []\n i = 1\n while len(result) < args:\n push = True\n for power in range(0,len(str(i))):\n if((i+10**power)/snuke(i+10**power))<(i/snuke(i)):\n push = False\n break\n if push:\n result.append(i)\n i=i+1\n \n return result\n\narr = find_snuke(args)\nfor a in arr:\n print(a)', 'import math\ndef find_min(length, window_size):\n return math.ceil((length-window_size)/(window_size-1)) + 1\n\nargs = input().split(" ")\nlength = int(args[0])\nwindow_size = int(args[1].rstrip())\narray = input().split(" ")\n\nprint(find_min(length, window_size))']
['Runtime Error', 'Accepted']
['s700196064', 's934042635']
[3064.0, 10420.0]
[17.0, 25.0]
[529, 259]
p03319
u526094365
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nif K == 1:\n print(N - 1)\nelif N == K:\n print(1)\nelse:\n if (N - K) % (K - 1) != 0:\n print((N - K) // (K - 1) + 1)\n else:\n print((N - K) // (K - 1))\n', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\nif (N-1) % (K-1) == 0:\n print((N-1)//(K-1))\nelse:\n print((N-1)//(K-1)+1)\n']
['Wrong Answer', 'Accepted']
['s562748051', 's224742375']
[13880.0, 13880.0]
[40.0, 41.0]
[243, 144]
p03319
u532806301
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['print(-(-(N-1)//(K-1)))', 'N,K = map(int, input().split())\nprint(-(-(N-1)//(K-1)))']
['Runtime Error', 'Accepted']
['s612955750', 's623768139']
[2940.0, 3060.0]
[17.0, 17.0]
[23, 55]
p03319
u536034761
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nmini = min(A)\nidx = N + 1\nmid = N / 2\n\nfor i, a in enumerate(A):\n if a == mini and abs(idx - mid) > abs(i - mid):\n idx = i\n\nans = i // (K - 1)\nrem = i % (K - 1)\nif rem:\n ans += 1\n if (N - i - 1 - (K - rem)) // (K - 1) > 0:\n ans += (N - i - 1 - (K - rem)) // (K - 1)\n if (N - i - 1 - (K - rem)) % (K - 1) != 0:\n ans += 1\nelse:\n if (N - i - 1) // (K - 1) > 0:\n ans += (N - i - 1) // (K - 1)\n if (N - i - 1) % (K - 1) != 0::\n ans += 1\nprint(ans)', 'N,K=map(int,input().split())\nprint((N-1)//(K-1)+1)if(N-1)%(K-1)else print((N-1)//(K-1))']
['Runtime Error', 'Accepted']
['s256320119', 's556308386']
[9000.0, 9156.0]
[25.0, 26.0]
[543, 87]
p03319
u539517139
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\nprint((n-1)//(k-1))', 'n,k=map(int,input().split())\nprint(-1*((1-n)//(k-1)))']
['Wrong Answer', 'Accepted']
['s148615353', 's058501278']
[2940.0, 3316.0]
[17.0, 21.0]
[48, 53]
p03319
u569272329
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\nx = A.index(1)+1\nleft = x//K + 1 if x % K != 0 else 0\nright = (N-x+1)//K + 1 if (N-x+1) % K != 0 else 0\nprint(left+right)\n', 'from math import ceil\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nprint(ceil((N-1)/(K-1)))\n']
['Wrong Answer', 'Accepted']
['s451556724', 's404640957']
[13880.0, 13812.0]
[41.0, 40.0]
[191, 117]
p03319
u588558668
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\na=list(map(int,input().split()))\nfor i in range(n):\n if a[i]==1:\n x=i\n y=n-1-i\nimport math\n\nprint(math.ceil(n-1,k))', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nfor i in range(n):\n if a[i]==1:\n x=i\n y=n-1-i\nimport math\n\nprint(math.ceil(n-1/k-1))', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nfor i in range(n):\n if a[i]==1:\n x=i\n y=n-1-i\nimport math\n\nprint(math.ceil((n-1)/(k-1)))\n\n\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s456255956', 's738789408', 's740591618']
[13880.0, 13812.0, 14008.0]
[48.0, 50.0, 49.0]
[151, 153, 160]
p03319
u590672038
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n, k = map(int, input().split())\nprint((n - 2) / (k - 1) + 1)', 'n, k = map(int, input().split())\nprint((n - 2) // (k - 1) + 1)\n']
['Wrong Answer', 'Accepted']
['s387704218', 's169174200']
[2940.0, 2940.0]
[17.0, 17.0]
[61, 63]
p03319
u593567568
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N,K = map(int,input().split())\nA = list(map(int,input().split()))\n\none = A.index(1)\n\nans = None\nif one == 0 or one == N-1:\n ans = -(-(N-1) // (K-1))\nelse:\n left = -(-i // (K-1))\n right = -(-(N - i - 1 - (i % (K-1)))//(K-1))\n ans = left + right\n \nprint(ans)\n \n ', 'N,K = map(int,input().split())\nA = list(map(int,input().split()))\n\nans = -(-(N-1) // (K-1))\n \nprint(ans)\n \n \n']
['Runtime Error', 'Accepted']
['s338910812', 's540863918']
[13812.0, 13880.0]
[40.0, 40.0]
[267, 112]
p03319
u607563136
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k = map(int,input().split())\na = list(map(int,input().split()))\n\nni = a.index(1)\n\nans = ni//(k-1)+1 +(n-ni-1 + (ni-1)%(k-1))//(k-1)\nprint(ans)', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\n\nni = a.index(1)\n\nans = ni//(k-1) +(n-ni-1 + ni%(k-1))//(k-1)\nprint(ans)', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\n\nni = a.index(1)\n\nans = ni//(k-1)+1 +(n-ni-1 + ni%(k-1))//(k-1)+1\nprint(ans)', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\nprint((n+(k-1)-1-1)//(k-1))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s379770095', 's678087279', 's692734223', 's664580299']
[20552.0, 20452.0, 20376.0, 20412.0]
[51.0, 54.0, 51.0, 52.0]
[144, 138, 142, 93]
p03319
u614181788
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k = map(int,input().split())\na = list(map(int,input().split()))\nif k == n:\n print(1)\nelse:\n print(1+math.ceil((n-k)/(k-1)))', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\nans = 1\nans += -(-(n-k)//(k-1))\nprint(ans)']
['Runtime Error', 'Accepted']
['s193085719', 's945970472']
[13812.0, 20324.0]
[41.0, 50.0]
[131, 108]
p03319
u619819312
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\na=list(map(int,input().split()))\nprint((n+1)//k)', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nprint((n-k-1)//(k-1)+2)']
['Wrong Answer', 'Accepted']
['s253864821', 's043193764']
[13880.0, 13880.0]
[41.0, 42.0]
[77, 85]
p03319
u629350026
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\na=list(map(int,input().split()))\nimport numpy as np\na=np.array(a)\ntemp=np.argmin(a)\nimport math\nif n==k:\n print(1)\nelse:\n print(math.ceil(temp/(k-1))+math.ceil((n-temp-1-(temp+1)%(k-1))/(k-1)))\n', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nimport numpy as np\na=np.array(a)\ntemp=np.argmin(a)\nimport math\nif n==k:\n print(1)\nelse:\n print(math.ceil(temp/(k-1))+math.ceil((n-temp-k+temp%(k-1))/(k-1)))\n', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nimport numpy as np\na=np.array(a)\ntemp=np.argmin(a)\nimport math\nif n==k:\n print(1)\nelse:\n print(math.ceil(temp/(k-1))+math.ceil((n-temp-1-(k-temp-1)%(k-1))/(k-1)))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s066013566', 's371948705', 's099071714']
[17200.0, 17176.0, 17196.0]
[178.0, 181.0, 179.0]
[225, 221, 227]
p03319
u670961163
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\nk, m = map(int, input().split())\nx = math.ceil((k-1)/(n-1))\n\nprint(x)', 'import math\nk, m = map(int, input().split())\nx = math.ceil((k-1)/(m-1))\n \nprint(x)']
['Runtime Error', 'Accepted']
['s703767313', 's463894383']
[3060.0, 3064.0]
[18.0, 17.0]
[81, 82]
p03319
u687574784
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k = list(map(int, input().split()))\na = list(map(int, input().split()))\n\n\nidx = a.index(min(a))\nright = n - idx - 1\nleft = idx\n\nq1,r1 = divmod(left, k-1)\nq2,r2 = divmod(right, k-1)\nprint(q1, q2, r1, r2)\nprint(q1 + q2 + min(r1,1) + min(r2,1))', 'n,k = list(map(int, input().split()))\na = list(map(int, input().split()))\n\n\nidx = a.index(min(a))\n\nans = 10**12\nfor i in range(k):\n right = n - idx - 1 - i\n left = max(idx - k + 1 + i, 0)\n \n q1,r1 = divmod(left, k-1)\n q2,r2 = divmod(right, k-1)\n ans = min(ans, q1 + q2 + min(r1,1) + min(r2,1))\n\nprint(ans+1)']
['Wrong Answer', 'Accepted']
['s333315222', 's858169563']
[20528.0, 20636.0]
[55.0, 170.0]
[275, 357]
p03319
u697690147
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['index = a.index(1)\ncnt = 0\n\nif (n==k):\n print(1)\nelse:\n if index <= (k - 1):\n cnt += 1\n i = k - 1\n while i <= (len(a) - 2):\n i += (k-1)\n cnt += 1\n elif index >= (n - k):\n cnt += 1\n i = n - k\n while i >= 1:\n i -= (k-1)\n cnt += 1\n else:\n i = index\n while i >= 1:\n i -= (k-1)\n cnt += 1\n\n i = index\n while i <= (len(a) - 2):\n i += (k-1)\n cnt += 1\n\n print(cnt)', 'import math\nn, k = list(map(int, input().split()))\na = list(map(int, input().split()))\n\nprint(math.ceil((n-1)/(k-1)))']
['Runtime Error', 'Accepted']
['s197123680', 's306808510']
[8928.0, 20464.0]
[27.0, 48.0]
[528, 117]
p03319
u703823201
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = int((N-1)/(K-1))\n\nif (N-1)%(K-1) == 0:\n print(ans+1)\nelse:\n print(ans)', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = int((N-1)/(K-1))\n\nif (N-1)%(K-1) == 0:\n print(ans)\nelse:\n print(ans+1)']
['Wrong Answer', 'Accepted']
['s802262130', 's686953344']
[20452.0, 20508.0]
[52.0, 50.0]
[152, 152]
p03319
u703890795
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n \nprint((N-1)//(K-1))', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nprint(N//K)', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\nimport math\nprint(math.ceil((N-1)/(K-1)))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s461191831', 's776868932', 's015892152']
[13880.0, 13880.0, 13880.0]
[40.0, 39.0, 40.0]
[90, 81, 110]
p03319
u704845096
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['a,b=map(int,input().split())\nprint((a-b)//(b-1)+(1 if a%b > 0 else 0))', 'import math;a,b=map(int,input().split());print(math.ceil((a-1)/(b-1)))']
['Wrong Answer', 'Accepted']
['s918945036', 's374820903']
[3060.0, 3060.0]
[17.0, 17.0]
[70, 70]
p03319
u742899538
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = list(map(int, input().split()))\nA = [0] + list(map(int, input().split()))\n\n\nzero_index = 0\nfor i in range(len(A)):\n if A[i] == 1:\n zero_index = i\n break\n\ncount = 0\n\n\nzero_left_index = len(A)\n\nzero_left_index -= K\ncount += 1\nwhile zero_left_index > zero_index:\n zero_left_index -= (K - 1)\n count += 1\n\n\n\n\nif zero_index != 1 and zero_left_index > 0:\n zero_left_index -= K\n count += 1\n while zero_left_index > 0:\n zero_left_index -= (K - 1)\n count += 1', 'N, K = list(map(int, input().split()))\nA = [0] + list(map(int, input().split()))\n\n\nzero_index = 0\nfor i in range(len(A)):\n if A[i] == 1:\n zero_index = i\n break\n\ncount = 0\n\n\nzero_left_index = len(A)\n\nzero_left_index -= K\ncount += 1\nwhile zero_left_index > zero_index:\n zero_left_index -= (K - 1)\n count += 1\n\n\n\n\nif zero_index != 1 and zero_left_index > 1:\n \n # count += 1\n while zero_left_index > 1:\n zero_left_index -= (K - 1)\n count += 1\nprint(count)']
['Wrong Answer', 'Accepted']
['s817767631', 's596512737']
[13880.0, 13812.0]
[53.0, 49.0]
[893, 910]
p03319
u762420987
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int, input().split())\nAlist = list(map(int, input().split()))\nif K >= N:\n print(1)\nelse:\n from math import ceil\n one = Alist.index(1)\n left = N\n right = N - one - 1\n print(ceil(left / K) + ceil(right / K))\n', 'N, K = map(int, input().split())\nAlist = list(map(int, input().split()))\nif K >= N:\n print(1)\nelse:\n from math import ceil\n one = Alist.index(1)\n left = N\n right = N - one - 1\n print(ceil(left / K) + ceil(right / K))\n', 'from math import ceil\nN, K = map(int, input().split())\nAlist = list(map(int, input().split()))\nprint(ceil((N-1)/(K-1)))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s476677504', 's488774659', 's570202036']
[13812.0, 14004.0, 13812.0]
[40.0, 41.0, 40.0]
[235, 235, 119]
p03319
u767664985
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\none = A.index(1)\n\nprint(math.ceil((one+1)/(K-1)) + math.ceil((N-one)/(K-1)))\n', 'from math import ceil\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nif K >= N:\n print(1)\n exit()\n\none = A.index(1)\nprint(one)\nprint(ceil((one)/(K-1)) + ceil((N-one-1)/(K-1)))\n', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\ni = A.index(1)\nprint(i // K + (N - i + 1) // K)\n', 'from math import ceil\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\none = A.index(1)\nprint(ceil((one+1)/(K-1)) + ceil((N-one)/(K-1)))\n', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\ni = A.index(1)\nprint(i // (K - 1) + (N - i - 1) // (K - 1))\n', 'from math import ceil\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\none = A.index(1)\nprint(ceil((N-1)/(K-1)))\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s287158993', 's324526457', 's573949552', 's779818986', 's990174282', 's699128682']
[13812.0, 13812.0, 14008.0, 13812.0, 14008.0, 13812.0]
[41.0, 40.0, 41.0, 41.0, 40.0, 41.0]
[160, 206, 118, 159, 130, 135]
p03319
u782654209
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
["N,K=map(int,input().split(' '))\nA=list(map(int,input().split(' ')))\nans=0\nposition=0\nwhile True:\n\tif ans==0:\n\t\tposition+=K\n\t\tans+=1\n\telse:\n\t\tif position>=N-1:\n\t\t\tbreak\n\t\telse:\n\t\t\tposition+=K-1\n\t\t\tans+=1\nprint(ans)\n", "N,K=map(int,input().split(' '))\nA=list(map(int,input.split(' ')))\ncount=0\nsum=0\nwhile sum<N:\n\tif count==0:\n\t\tsum+=K\n\telse:\n\t\tsum+=(K-1)\n\tcount+=1\nprint(count)", "N,K=map(int,input().split(' '))\nA=list(map(int,input().split(' ')))\ncount=0\nsum=0\nwhile sum<N:\n\tif count==0:\n\t\tsum+=K\n\telse:\n\t\tsum+=(K-1)\n\tcount+=1\nprint(count)"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s424163439', 's540504135', 's550530515']
[13880.0, 3060.0, 14008.0]
[51.0, 17.0, 51.0]
[214, 158, 160]
p03319
u842964692
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N,K=map(int,input().split())\nA=list(map(int,input().split()))\n\nif N<=K:\n print(1)\nelif (N-3)%(K-1)==0:\n print((N-3)//(K-1))\nelse:\n print((N-3)//(K-1)+1)', 'N,K=map(int,input().split())\nA=list(map(int,input().split()))\n\nif N<=K:\n print(1)\nelif (N-K)%(K-1)==0:\n print(1+(N-K)//(K-1))\nelse:\n print(1+(N-K)//(K-1)+1)\n']
['Wrong Answer', 'Accepted']
['s606333208', 's187504650']
[13880.0, 13880.0]
[39.0, 40.0]
[161, 166]
p03319
u848647227
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['ar = list(map(int,input().split(" ")))\ni = ar.index(1)\ncount = 0\nam = 0\nif i % (m - 1) == 0:\n count += i // (m - 1)\nelse:\n count += i // (m - 1) + 1\n am += i % (m - 1)\nif (n - 1 - i) % (m - 1) == 0:\n count += (n - 1 - i) // (m - 1)\nelse:\n count += (n - 1 - i) // (m - 1) + 1\n am += (n - 1 - i) % (m - 1)\nif am >= m - 1:\n count -= 1\nprint(count)', 'n,m = map(int,input().split(" "))\nar = list(map(int,input().split(" ")))\ni = ar.index(1)\nif n <= m:\n print(1)\n exit()\ncount = 0\nam = 0\ncount += i // (m - 1)\nam += i % (m - 1)\ncount += (n - 1 - i) // (m - 1)\nam += (n - 1 - i) % (m - 1)\nif am <= m - 1 and am > 0:\n count += 1\nif am > m - 1:\n count += 2\nprint(count)']
['Runtime Error', 'Accepted']
['s283428029', 's484746485']
[9144.0, 20636.0]
[27.0, 56.0]
[365, 325]
p03319
u852367841
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import numpy as np\nn, k = map(int, input().split())\na_list = list(map(int, input().split()))\n\nif n == k:\n ans = 1\nelse:\n m = int(n / (k - 1))\n s = k\n for i in range(1, m+2):\n s += (k - 1) \n print(s)\n if s >= n:\n ans = i + 1\n break\n else:\n pass\n\nprint(ans)\n', 'import numpy as np\nn, k = map(int, input().split())\na_list = list(map(int, input().split()))\n\n\ns = k\nfor i in range(1, n+1):\n if s >= n:\n print(i)\n break\n else:\n s += (k - 1)\n']
['Wrong Answer', 'Accepted']
['s958217779', 's683502692']
[23352.0, 24976.0]
[208.0, 321.0]
[329, 242]
p03319
u859897687
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\na=list(map(int,input().split()))\nm=a.find(1)\nans=m//(k-1)+(n-m-1)//(k-1)\nkk=m%(k-1)+(n-m-1)%(k-1)+1\nans+=1+(kk>k)\nprint(ans)', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nm=a.index(1)\nans=m//(k-1)+(n-m-1)//(k-1)\nkk=m%(k-1)+(n-m-1)%(k-1)+1\nif m!=0 and m!=n-1:\n if kk>1:\n ans+=1+(kk>k)\nelse:\n ans+=(ans*(k-1)+1<n)\nprint(ans)']
['Runtime Error', 'Accepted']
['s964598750', 's185762341']
[14008.0, 13880.0]
[40.0, 41.0]
[153, 218]
p03319
u865741247
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\nN,K = list(map(int,input().split(" ")))\nlengths = [] \nnums = list(map(int,input().split(" ")))\ncounts = []\nco = [0,0]\nminnum = min(nums)\nind = 0\n\nfor num in nums:\n if num == 1:\n ind += 1\n else:\n co[ind] += 1\n\nprint(co)\nans = 0\n# print(counts)\nK = K -1\nfor count in co:\n ans += int(math.ceil(count/K))\nprint(ans)', 'import math\nN,M = list(map(int,input().split(" ")))\ntemp = input()\nans = int(math.ceil((N-1)/(M-1)))\nprint(ans)']
['Wrong Answer', 'Accepted']
['s688693329', 's751628799']
[13812.0, 4724.0]
[60.0, 18.0]
[346, 111]
p03319
u874723578
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['import math\nN, K, *A = map(int, open(0).read().split())\nprint(math.ceil((N-1)//(K-1)))\n', 'import math\nN, K = map(int, input().split())\nprint(math.ceil((N-1)/(K-1)))\n']
['Wrong Answer', 'Accepted']
['s966562652', 's909798369']
[13852.0, 3060.0]
[40.0, 19.0]
[87, 75]
p03319
u882620594
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N, K = map(int,input().split())\nA = list(map(int,input().split()))\nprint(str((N-1) // (K-1)))', 'N, K = map(int,input().split())\nA = list(map(int,input().split()))\nans = (N-1) // (K-1) if (N-1)%(K-1) == 0 else (N-1) // (K-1) + 1\nprint(str(ans))']
['Wrong Answer', 'Accepted']
['s415510082', 's279412758']
[13880.0, 14008.0]
[39.0, 44.0]
[93, 147]
p03319
u884982181
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['N = int(input())\na =[1,2,3,4,5,6,7,8,9]\nfor i in range(1,10000):\n b = 10**i - 1\n for j in range(1,10):\n a.append(b + j * 10 ** i)\n \nfor i in range(N):\n print(a[i])', 'N,K = map(int, input().split())\na = list(map(int, input().split()))\nans = 0\nc = a.index(1)\nnaga = len(a)-K\nif naga <= 0:\n print(1)\nelse:\n d = c-0\n if d != 0:\n V = K-1\n ans += d // V\n if d % V != 0:\n ans += 1\n e = N-1-c\n if e != 0:\n V = K-1\n ans += e // V\n if e % V != 0:\n ans += 1\n ans1 = 0\n ans2 = 0\n if d < K-1:\n ans1 += 1\n e = e -(K-d-1)\n if e < 0:\n V = K-1\n ans += e // V\n if e % V != 0:\n ans1 += 1\n else:\n ans1 = 999999999999999999999999999999\n if e < K-1:\n ans2 += 1\n d = d -(K-e-1)\n if d < 0:\n V = K-1\n ans += d // V\n if e % V != 0:\n ans2 += 1\n else:\n ans2 = 999999999999999999999999999999\n print(min(ans,ans1,ans2))', 'N,K = map(int, input().split())\na = list(map(int, input().split()))\nans = 0\nc = a.index(1)\nnaga = len(a)-K\nif naga <= 0:\n print(1)\nelse:\n d = c-0\n if d != 0:\n V = K-1\n ans += d // V\n if d % V != 0:\n ans += 1\n e = N-1-c\n if e != 0:\n V = K-1\n ans += e // V\n if e % V != 0:\n ans += 1\n ans1 = 0\n ans2 = 0\n if d <= K-1:\n ans1 += 1\n ex = e -(K-d-1)\n if ex >= 0:\n V = K-1\n ans1 += ex // V\n if ex % V != 0:\n ans1 += 1\n else:\n ans1 = 999999999999999999999999999999\n if e <= K-1:\n ans2 += 1\n dx = d -(K-e-1)\n if dx >= 0:\n V = K-1\n ans2 += dx // V\n if dx % V != 0:\n ans2 += 1\n else:\n ans2 = 999999999999999999999999999999\n ans3 = 0\n ans4 = 999999999999999999\n V = K-1\n for i in range(K):\n ans3 = 0\n dx = d- i\n ex = e - (K - i - 1)\n ans3 += 1\n if dx > 0:\n if ex > 0:\n ans3 += ex//V\n if ex % V != 0:\n ans3 += 1\n ans3 += dx//V\n if dx % V != 0:\n ans3 += 1\n ans4 = min(ans4,ans3)\n print(min(ans,ans1,ans2,ans4))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s482540720', 's687339815', 's675212510']
[3060.0, 14008.0, 14008.0]
[17.0, 41.0, 79.0]
[170, 739, 1088]
p03319
u888092736
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n, k = map(int, input().split())\na = list(map(int, input().split()))\nif n == k:\n print(1)\n exit()\npos_1 = a.index(1)\nleft = (pos_1 + k - 2) // (k - 1)\nright = (n - pos_1 + k - 3) // (k - 1)\nprint(left, right)\nprint(left + right)', 'N, K = map(int, input().split())\nA = input()\nans = (N - 1) // (K - 1)\nif (N - 1) % (K - 1) == 0:\n print(ans)\nelse:\n print(ans + 1)\n']
['Wrong Answer', 'Accepted']
['s255203501', 's846033664']
[13880.0, 4724.0]
[42.0, 18.0]
[234, 137]
p03319
u896726004
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n, k = map(int, input())\n\nif (n-1)%(k-1)==0:\n print((n-1)//(k-1))\nelse:\n print((n-1)//(k-1)+1)', 'n, k = map(int, input().split())\n\nif (n-1)%(k-1)==0:\n print((n-1)//(k-1))\nelse:\n print((n-1)//(k-1)+1)']
['Runtime Error', 'Accepted']
['s825535586', 's221851821']
[3060.0, 3060.0]
[17.0, 17.0]
[100, 108]
p03319
u896741788
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\nl=list(map(int,input().split()))\ni=l.index(1)\nk-=1\na=-(-i//k)+0 if i%k!=1 else -1\nb=-(-(n-i-1)//k)+0 if (n-i-1)%k!=1 else -1\nprint(a+b)', 'n,k=map(int,input().split())\nl=list(map(int,input().split()))\ni=l.index(1)\nk-=1\na=-(-i//k)- int(i%k==1)\nb=-(-(n-i-1)//k)- int((n-i-1)%k==1)\nprint(a+b)', 'n,k=map(int,input().split())\nprint(-((1-n)//(k-1)))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s062056371', 's145058723', 's714482208']
[14008.0, 13880.0, 3060.0]
[41.0, 41.0, 17.0]
[164, 151, 51]
p03319
u916098128
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k = map(int,input().split())\nprint( ( (n-1 + k-2)//(k-1) )+1 )', 'n,k = map(int,input().split())\nprint( ( (n-1 + k-2)//(k-1) ) )']
['Wrong Answer', 'Accepted']
['s089321730', 's677298300']
[3060.0, 2940.0]
[17.0, 17.0]
[64, 62]
p03319
u944209426
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int, input().split())\na=list(map(int, input().split()))\nfor i in range(n):\n if a[i]==1:\n mi=i\nx=n-(mi+1)\ny=mi\nif x%(k-1)==0:\n ax=x//(k-1)\nelse:\n ax=x//(k-1)+1\nif y%(k-1)==0:\n ay=y//(k-1)\nelse:\n ay=y//(k-1)+1\nif 0<x%(k-1)+y%(k-1)<k:\n print(ax+ay-1)\nelse:\n print(ax+ay)', 'n,k=map(int, input().split())\na=list(map(int, input().split()))\nif (n-1)%(k-1)==0:\n print((n-1)//(k-1))\nelse:\n print((n-1)//(k-1)+1)']
['Wrong Answer', 'Accepted']
['s961411758', 's552924317']
[13812.0, 14004.0]
[49.0, 39.0]
[347, 138]
p03319
u997641430
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n, k = map(int, input().split())\nprint((n-1)//(k-1))\n', 'n, k = map(int, input().split())\nprint(-(-(n-1)//(k-1)))\n']
['Wrong Answer', 'Accepted']
['s098562198', 's652930675']
[2940.0, 2940.0]
[17.0, 17.0]
[53, 57]
p03319
u999503965
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable.
['n,k=map(int,input().split())\nl=list(map(int,input()))\n\ncnt=1\nnum=k\nwhile num<n:\n num+=(k-1)\n cnt+=1\n \nprint(cnt)\n', 'n,k=map(int,input().split())\nl=list(map(int,input()))\n\ncnt=1\nnum=3\nwhile num<n:\n num+=2\n cnt+=1\n \nprint(cnt)', 'n,k=map(int,input().split())\nl=list(map(int,input().split()))\n\ncnt=1\nnum=k\nwhile num<n:\n num+=(k-1)\n cnt+=1\n \nprint(cnt)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s023471514', 's453180295', 's617087533']
[10252.0, 10032.0, 20400.0]
[25.0, 27.0, 58.0]
[116, 111, 124]
p03320
u098240946
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['K = int(input())\nmaxnum = 10**20\nal = []\nERROR = 10**(-10)\n\ndef sunuke(i):\n s = 0\n old = i\n while i>0:\n s += i%10\n i = i//10\n return [old/s,old]\n\nfor i in range(1,100):\n al.append(sunuke(i))\nfor j in range(3,17):\n for k in range(10,100):\n al.append(sunuke(k*(10**(j-2))+10**(j-2)-1))\nanslist = []\nal.reverse()\nfor j in al:\n if j[0]<maxnum+ERROR:\n anslist.append(j[1])\n maxnum = j[0]\nanslist.reverse()\n\nfor i in range(K):\n print(anslist[i])\nprint(len(anslist))', 'K = int(input())\nal = []\n\ndef sums(i):\n s = 0\n old = i\n while i>0:\n s += i%10\n i = i//10\n return (s,old)\n\nfor i in range(1,1000):\n al.append(sums(i))\nfor j in range(4,16):\n for k in range(100,1000):\n al.append(sums(k*(10**(j-3))+10**(j-3)-1))\nanslist = []\nal.reverse()\nmaxs,maxi = sums(10**15)\nfor j in al:\n if maxs*j[1] <= maxi*j[0]:\n anslist.append(j[1])\n maxs = j[0]\n maxi = j[1]\nanslist.reverse()\n\nfor i in range(K):\n print(anslist[i])']
['Wrong Answer', 'Accepted']
['s887997132', 's602842807']
[3316.0, 4288.0]
[21.0, 44.0]
[519, 505]
p03320
u141610915
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['K = int(input())\nsnuke = ""\ni = 1\nwhile True:\n snuke = str(i % 10) + "9" * (i // 10)\n if snuke[0] == "0":\n i += 1\n continue\n if int(snuke) >= K:\n break\n print(snuke)\n i += 1', 'K = int(input())\na = 0\nb = 1\nfor i in range(K):\n a += b\n print(a)\n if b < (a + b) / sum(map(int,str(a + b))):\n b *= 10\n\n']
['Wrong Answer', 'Accepted']
['s426552585', 's956793589']
[2940.0, 3188.0]
[17.0, 20.0]
[187, 126]
p03320
u239528020
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['#!/usr/bin/env python3\n\nk = int(input())\n\nketa = 4\n\nans_c = []\nsunuke = []\nfor i in range(1, 10**keta): # 1~9999\n a = i\n b = sum([int(j) for j in str(i)])\n tmp_sunuke = a/b\n ans_c.append(a)\n sunuke.append(tmp_sunuke)\n\nbase = 10\nnines = 9\nwhile(len(ans_c) <= 9000000):\n for i in range(1000, 10**keta): # 1000~9999\n a = i*base+nines\n b = sum([int(j) for j in str(i)])\n tmp_sunuke = a/b\n ans_c.append(a)\n sunuke.append(tmp_sunuke)\n base *= 10\n nines = nines*10 + 9\n # print(len(ans_c))\n\n# print(ans_c)\n\ntmp = 10**10\nans = []\nfor i in reversed(range(len(ans_c))):\n if sunuke[i] <= tmp:\n tmp = sunuke[i]\n ans.append(ans_c[i])\n# print(ans)\n\n\nfor i in range(0, k):\n print(ans[-1-i])\n', '#!/usr/bin/env python3\n\nk = int(input())\n\nnow = 1\nstep = 1\n\n\ndef sunuke(n):\n r = 0\n while n:\n r += n % 10\n n //= 10\n return r\n\n\ndef ok(a, b):\n return a * s(b) <= b*s(a)\n\n\nwhile k:\n if ok(now, now+step):\n print(now)\n k -= 1\n now += step\n else:\n nstep = step*10\n while now % nstep != nstep-1:\n now += step\n step = nstep\n', '#!/usr/bin/env python3\n\nk = int(input())\n\nnow = 1\nstep = 1\n\n\ndef sunuke(n):\n r = 0\n while n:\n r += n % 10\n n //= 10\n return r\n\n\ndef ok(a, b):\n return a * sunuke(b) <= b*sunuke(a)\n\n\nwhile k:\n if ok(now, now+step):\n print(now)\n k -= 1\n now += step\n else:\n nstep = step*10\n while now % nstep != nstep-1:\n now += step\n step = nstep\n']
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s213876660', 's733955513', 's898824831']
[230368.0, 9000.0, 9128.0]
[2214.0, 25.0, 31.0]
[760, 403, 413]
p03320
u327466606
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["K = int(input())\n\ns = ''\nwhile K > 0:\n for i in range(1,min(10,K+1)):\n print(i,s, sep='')\n s += '9'\n K -= 10\n", "K = int(input())\nd = 0\nn = 1\nwhile K > 0:\n if ((n+1)*10**d-1)*(sum(map(int,str(n+1)))+9*d) <= ((n+2)*10**d-1)*(sum(map(int,str(n)))+9*d):\n print(n,'9'*d, sep='')\n K -= 1\n n += 1\n else:\n d += 1\n n = (n+1)//10"]
['Wrong Answer', 'Accepted']
['s623294932', 's463090671']
[3188.0, 3316.0]
[18.0, 21.0]
[115, 224]
p03320
u499106786
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['args = int(input().rstrip())\n\ndef snuke(number):\n temp = list(str(number))\n arr = [ int(t) for t in temp] \n return sum(arr)\n\ndef find_snuke(args):\n result = []\n i = 1\n while len(result) < args:\n\n if((i+1)/snuke(i+1))>=(i/snuke(i)):\n result.append(i)\n i=i+1\n \n return result', 'args = int(input().rstrip())\n\ndef snuke(n):\n s = 0\n while n:\n s += n % 10\n n //= 10\n return s\n\ndef find_snuke(args):\n result = []\n i = 1\n while len(result) < args:\n push = True\n p = 0\n for power in range(0,len(str(i))):\n if((i+10**power)/snuke(i+10**power))<(i/snuke(i)):\n push = False\n p = power\n break\n if push:\n result.append(i)\n i=i+10**p\n \n return result\n\narr = find_snuke(args)\nfor a in arr:\n print(a)']
['Wrong Answer', 'Accepted']
['s741395573', 's443774072']
[3060.0, 3188.0]
[17.0, 1323.0]
[330, 557]
p03320
u550574002
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['def s(n):\n if n<10:\n return n\n else:\n return n%10+s(n//10)\n\nk =int(input())\nn=0\nfor _ in [0]*k:\n n +=1 \n minn = n\n d = 10\n while n>=d:\n m = (n//d+1)*d-1\n if minn*s(m)>m*s(minn):\n minn = m\n n = minn\n print(n)\n', 'def s(n):\n if n<10:\n return n\n else:\n return n%10+s(n//10)\nn=0\nfor _ in [0]*int(input()):\n n +=1 \n minn = n\n d = 1\n while n>=d:\n d *= 10 \n m = (n//d+1)*d-1\n if minn*s(m)>m*s(minn):\n minn = m\n n = minn\n print(n)']
['Time Limit Exceeded', 'Accepted']
['s779089241', 's029186192']
[2940.0, 3188.0]
[2104.0, 56.0]
[274, 286]
p03320
u814171899
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["def s(n):\n ret=0 \n for i in range(15):\n ret+=(n%10**(i+1))//10**i\n return ret\n\nk=int(input())\nksnk=set()\n\nfor i in range(13):\n for j in range(1,1000):\n n=int(str(j)+'9'*i)\n ksnk.add(n)\nksnk=sorted(list(ksnk), reverse=True)\n\nfmin=float('inf')\nans=[]\nfor a in ksnk:\n fa=a/s(a) \n if fa<=fmin:\n ans.append(a)\n fmin=fa\nans.reverse()\nprint(ans[:k])\n", "def s(n):\n ret=0 \n for i in range(15):\n ret+=(n%10**(i+1))//10**i\n return ret\n\nk=int(input())\nksnk=set()\n\nfor i in range(13):\n for j in range(1,1000):\n n=int(str(j)+'9'*i)\n ksnk.add(n)\nksnk=sorted(list(ksnk), reverse=True)\n\nfmin=float('inf')\nans=[]\nfor a in ksnk:\n fa=a/s(a) \n if fa<=fmin:\n ans.append(a)\n fmin=fa\nans.reverse()\nfor a in ans[:k]:\n print(a)\n"]
['Wrong Answer', 'Accepted']
['s375298637', 's116114768']
[4076.0, 4076.0]
[149.0, 151.0]
[402, 418]
p03320
u925364229
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["K = int(input())\ncnt = 0\nb = 1\nans = 1\nwhile cnt <= K:\n\tprint(ans)\n\tcnt += 1\n\tif str(ans)[0] == '9':\n\t\tb *= 10\n\tans += (b)\n", 'lst = [999999999999999,989999999999999,979999999999999,969999999999999,959999999999999,949999999999999,939999999999999,929999999999999,919999999999999,909999999999999,899999999999999,889999999999999,879999999999999,869999999999999,859999999999999,849999999999999,839999999999999,829999999999999,819999999999999,809999999999999,799999999999999,789999999999999,779999999999999,769999999999999,759999999999999,749999999999999,739999999999999,729999999999999,719999999999999,709999999999999,699999999999999,689999999999999,679999999999999,669999999999999,659999999999999,649999999999999,639999999999999,629999999999999,619999999999999,609999999999999,599999999999999,589999999999999,579999999999999,569999999999999,559999999999999,549999999999999,539999999999999,529999999999999,519999999999999,509999999999999,499999999999999,489999999999999,479999999999999,469999999999999,459999999999999,449999999999999,439999999999999,429999999999999,419999999999999,409999999999999,399999999999999,389999999999999,379999999999999,369999999999999,359999999999999,349999999999999,339999999999999,329999999999999,319999999999999,309999999999999,299999999999999,289999999999999,279999999999999,269999999999999,259999999999999,249999999999999,239999999999999,229999999999999,219999999999999,209999999999999,199999999999999,189999999999999,179999999999999,169999999999999,159999999999999,149999999999999,139999999999999,129999999999999,119999999999999,109999999999999,108999999999999,107999999999999,106999999999999,105999999999999,104999999999999,103999999999999,102999999999999,101999999999999,100999999999999,99999999999999,98999999999999,97999999999999,96999999999999,95999999999999,94999999999999,93999999999999,92999999999999,91999999999999,90999999999999,89999999999999,88999999999999,87999999999999,86999999999999,85999999999999,84999999999999,83999999999999,82999999999999,81999999999999,80999999999999,79999999999999,78999999999999,77999999999999,76999999999999,75999999999999,74999999999999,73999999999999,72999999999999,71999999999999,70999999999999,69999999999999,68999999999999,67999999999999,66999999999999,65999999999999,64999999999999,63999999999999,62999999999999,61999999999999,60999999999999,59999999999999,58999999999999,57999999999999,56999999999999,55999999999999,54999999999999,53999999999999,52999999999999,51999999999999,50999999999999,49999999999999,48999999999999,47999999999999,46999999999999,45999999999999,44999999999999,43999999999999,42999999999999,41999999999999,40999999999999,39999999999999,38999999999999,37999999999999,36999999999999,35999999999999,34999999999999,33999999999999,32999999999999,31999999999999,30999999999999,29999999999999,28999999999999,27999999999999,26999999999999,25999999999999,24999999999999,23999999999999,22999999999999,21999999999999,20999999999999,19999999999999,18999999999999,17999999999999,16999999999999,15999999999999,14999999999999,13999999999999,12999999999999,11999999999999,10999999999999,9999999999999,9899999999999,9799999999999,9699999999999,9599999999999,9499999999999,9399999999999,9299999999999,9199999999999,9099999999999,8999999999999,8899999999999,8799999999999,8699999999999,8599999999999,8499999999999,8399999999999,8299999999999,8199999999999,8099999999999,7999999999999,7899999999999,7799999999999,7699999999999,7599999999999,7499999999999,7399999999999,7299999999999,7199999999999,7099999999999,6999999999999,6899999999999,6799999999999,6699999999999,6599999999999,6499999999999,6399999999999,6299999999999,6199999999999,6099999999999,5999999999999,5899999999999,5799999999999,5699999999999,5599999999999,5499999999999,5399999999999,5299999999999,5199999999999,5099999999999,4999999999999,4899999999999,4799999999999,4699999999999,4599999999999,4499999999999,4399999999999,4299999999999,4199999999999,4099999999999,3999999999999,3899999999999,3799999999999,3699999999999,3599999999999,3499999999999,3399999999999,3299999999999,3199999999999,3099999999999,2999999999999,2899999999999,2799999999999,2699999999999,2599999999999,2499999999999,2399999999999,2299999999999,2199999999999,2099999999999,1999999999999,1899999999999,1799999999999,1699999999999,1599999999999,1499999999999,1399999999999,1299999999999,1199999999999,1099999999999,999999999999,989999999999,979999999999,969999999999,959999999999,949999999999,939999999999,929999999999,919999999999,909999999999,899999999999,889999999999,879999999999,869999999999,859999999999,849999999999,839999999999,829999999999,819999999999,809999999999,799999999999,789999999999,779999999999,769999999999,759999999999,749999999999,739999999999,729999999999,719999999999,709999999999,699999999999,689999999999,679999999999,669999999999,659999999999,649999999999,639999999999,629999999999,619999999999,609999999999,599999999999,589999999999,579999999999,569999999999,559999999999,549999999999,539999999999,529999999999,519999999999,509999999999,499999999999,489999999999,479999999999,469999999999,459999999999,449999999999,439999999999,429999999999,419999999999,409999999999,399999999999,389999999999,379999999999,369999999999,359999999999,349999999999,339999999999,329999999999,319999999999,309999999999,299999999999,289999999999,279999999999,269999999999,259999999999,249999999999,239999999999,229999999999,219999999999,209999999999,199999999999,189999999999,179999999999,169999999999,159999999999,149999999999,139999999999,129999999999,119999999999,109999999999,99999999999,89999999999,88999999999,87999999999,86999999999,85999999999,84999999999,83999999999,82999999999,81999999999,80999999999,79999999999,78999999999,77999999999,76999999999,75999999999,74999999999,73999999999,72999999999,71999999999,70999999999,69999999999,68999999999,67999999999,66999999999,65999999999,64999999999,63999999999,62999999999,61999999999,60999999999,59999999999,58999999999,57999999999,56999999999,55999999999,54999999999,53999999999,52999999999,51999999999,50999999999,49999999999,48999999999,47999999999,46999999999,45999999999,44999999999,43999999999,42999999999,41999999999,40999999999,39999999999,38999999999,37999999999,36999999999,35999999999,34999999999,33999999999,32999999999,31999999999,30999999999,29999999999,28999999999,27999999999,26999999999,25999999999,24999999999,23999999999,22999999999,21999999999,20999999999,19999999999,18999999999,17999999999,16999999999,15999999999,14999999999,13999999999,12999999999,11999999999,10999999999,9999999999,8999999999,7999999999,7899999999,7799999999,7699999999,7599999999,7499999999,7399999999,7299999999,7199999999,7099999999,6999999999,6899999999,6799999999,6699999999,6599999999,6499999999,6399999999,6299999999,6199999999,6099999999,5999999999,5899999999,5799999999,5699999999,5599999999,5499999999,5399999999,5299999999,5199999999,5099999999,4999999999,4899999999,4799999999,4699999999,4599999999,4499999999,4399999999,4299999999,4199999999,4099999999,3999999999,3899999999,3799999999,3699999999,3599999999,3499999999,3399999999,3299999999,3199999999,3099999999,2999999999,2899999999,2799999999,2699999999,2599999999,2499999999,2399999999,2299999999,2199999999,2099999999,1999999999,1899999999,1799999999,1699999999,1599999999,1499999999,1399999999,1299999999,1199999999,1099999999,999999999,899999999,799999999,699999999,689999999,679999999,669999999,659999999,649999999,639999999,629999999,619999999,609999999,599999999,589999999,579999999,569999999,559999999,549999999,539999999,529999999,519999999,509999999,499999999,489999999,479999999,469999999,459999999,449999999,439999999,429999999,419999999,409999999,399999999,389999999,379999999,369999999,359999999,349999999,339999999,329999999,319999999,309999999,299999999,289999999,279999999,269999999,259999999,249999999,239999999,229999999,219999999,209999999,199999999,189999999,179999999,169999999,159999999,149999999,139999999,129999999,119999999,109999999,99999999,89999999,79999999,69999999,59999999,58999999,57999999,56999999,55999999,54999999,53999999,52999999,51999999,50999999,49999999,48999999,47999999,46999999,45999999,44999999,43999999,42999999,41999999,40999999,39999999,38999999,37999999,36999999,35999999,34999999,33999999,32999999,31999999,30999999,29999999,28999999,27999999,26999999,25999999,24999999,23999999,22999999,21999999,20999999,19999999,18999999,17999999,16999999,15999999,14999999,13999999,12999999,11999999,10999999,9999999,8999999,7999999,6999999,5999999,4999999,4899999,4799999,4699999,4599999,4499999,4399999,4299999,4199999,4099999,3999999,3899999,3799999,3699999,3599999,3499999,3399999,3299999,3199999,3099999,2999999,2899999,2799999,2699999,2599999,2499999,2399999,2299999,2199999,2099999,1999999,1899999,1799999,1699999,1599999,1499999,1399999,1299999,1199999,1099999,999999,899999,799999,699999,599999,499999,399999,389999,379999,369999,359999,349999,339999,329999,319999,309999,299999,289999,279999,269999,259999,249999,239999,229999,219999,209999,199999,189999,179999,169999,159999,149999,139999,129999,119999,109999,99999,89999,79999,69999,59999,49999,39999,29999,28999,27999,26999,25999,24999,23999,22999,21999,20999,19999,18999,17999,16999,15999,14999,13999,12999,11999,10999,9999,8999,7999,6999,5999,4999,3999,2999,1999,1899,1799,1699,1599,1499,1399,1299,1199,1099,999,899,799,699,599,499,399,299,199,99,89,79,69,59,49,39,29,19,9,8,7,6,5,4,3,2,1]\nlst.reverse()\nK = int(input())\n\nfor i in range(K):\n\tprint(lst[i])']
['Wrong Answer', 'Accepted']
['s549595380', 's048585151']
[3060.0, 3576.0]
[18.0, 19.0]
[124, 9262]
p03320
u996395152
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['def main():\n seq = [2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1099, 1199, 1299, 1399, 1499, 1599, 1699, 1799, 1899, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 10999, 11999, 12999, 13999, 14999, 15999, 16999, 17999, 18999, 19999, 20999, 21999, 22999, 23999, 24999, 25999, 26999, 27999, 28999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 109999, 119999, 129999, 139999, 149999, 159999, 169999, 179999, 189999, 199999, 209999, 219999, 229999, 239999, 249999, 259999, 269999, 279999, 289999, 299999, 309999, 319999, 329999, 339999, 349999, 359999, 369999, 379999, 389999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1099999, 1199999, 1299999, 1399999, 1499999, 1599999, 1699999, 1799999, 1899999, 1999999, 2099999, 2199999, 2299999, 2399999, 2499999, 2599999, 2699999, 2799999, 2899999, 2999999, 3099999, 3199999, 3299999, 3399999, 3499999, 3599999, 3699999, 3799999, 3899999, 3999999, 4099999, 4199999, 4299999, 4399999, 4499999, 4599999, 4699999, 4799999, 4899999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 10999999, 11999999, 12999999, 13999999, 14999999, 15999999, 16999999, 17999999, 18999999, 19999999, 20999999, 21999999, 22999999, 23999999, 24999999, 25999999, 26999999, 27999999, 28999999, 29999999, 30999999, 31999999, 32999999, 33999999, 34999999, 35999999, 36999999, 37999999, 38999999, 39999999, 40999999, 41999999, 42999999, 43999999, 44999999, 45999999, 46999999, 47999999, 48999999, 49999999, 50999999, 51999999, 52999999, 53999999, 54999999, 55999999, 56999999, 57999999, 58999999, 59999999, 69999999, 79999999, 89999999, 99999999, 109999999, 119999999, 129999999, 139999999, 149999999, 159999999, 169999999, 179999999, 189999999, 199999999, 209999999, 219999999, 229999999, 239999999, 249999999, 259999999, 269999999, 279999999, 289999999, 299999999, 309999999, 319999999, 329999999, 339999999, 349999999, 359999999, 369999999, 379999999, 389999999, 399999999, 409999999, 419999999, 429999999, 439999999, 449999999, 459999999, 469999999, 479999999, 489999999, 499999999, 509999999, 519999999, 529999999, 539999999, 549999999, 559999999, 569999999, 579999999, 589999999, 599999999, 609999999, 619999999, 629999999, 639999999, 649999999, 659999999, 669999999, 679999999, 689999999, 699999999, 799999999, 899999999, 999999999, 1099999999, 1199999999, 1299999999, 1399999999, 1499999999, 1599999999, 1699999999, 1799999999, 1899999999, 1999999999, 2099999999, 2199999999, 2299999999, 2399999999, 2499999999, 2599999999, 2699999999, 2799999999, 2899999999, 2999999999, 3099999999, 3199999999, 3299999999, 3399999999, 3499999999, 3599999999, 3699999999, 3799999999, 3899999999, 3999999999, 4099999999, 4199999999, 4299999999, 4399999999, 4499999999, 4599999999, 4699999999, 4799999999, 4899999999, 4999999999, 5099999999, 5199999999, 5299999999, 5399999999, 5499999999, 5599999999, 5699999999, 5799999999, 5899999999, 5999999999, 6099999999, 6199999999, 6299999999, 6399999999, 6499999999, 6599999999, 6699999999, 6799999999, 6899999999, 6999999999, 7099999999, 7199999999, 7299999999, 7399999999, 7499999999, 7599999999, 7699999999, 7799999999, 7899999999, 7999999999, 8999999999, 9999999999, 10999999999, 11999999999, 12999999999, 13999999999, 14999999999, 15999999999, 16999999999, 17999999999, 18999999999, 19999999999, 20999999999, 21999999999, 22999999999, 23999999999, 24999999999, 25999999999, 26999999999, 27999999999, 28999999999, 29999999999, 30999999999, 31999999999, 32999999999, 33999999999, 34999999999, 35999999999, 36999999999, 37999999999, 38999999999, 39999999999, 40999999999, 41999999999, 42999999999, 43999999999, 44999999999, 45999999999, 46999999999, 47999999999, 48999999999, 49999999999, 50999999999, 51999999999, 52999999999, 53999999999, 54999999999, 55999999999, 56999999999, 57999999999, 58999999999, 59999999999, 60999999999, 61999999999, 62999999999, 63999999999, 64999999999, 65999999999, 66999999999, 67999999999, 68999999999, 69999999999, 70999999999, 71999999999, 72999999999, 73999999999, 74999999999, 75999999999, 76999999999, 77999999999, 78999999999, 79999999999, 80999999999, 81999999999, 82999999999, 83999999999, 84999999999, 85999999999, 86999999999, 87999999999, 88999999999, 89999999999, 99999999999, 109999999999, 119999999999, 129999999999, 139999999999, 149999999999, 159999999999, 169999999999, 179999999999, 189999999999, 199999999999, 209999999999, 219999999999, 229999999999, 239999999999, 249999999999, 259999999999, 269999999999, 279999999999, 289999999999, 299999999999, 309999999999, 319999999999, 329999999999, 339999999999, 349999999999, 359999999999, 369999999999, 379999999999, 389999999999, 399999999999, 409999999999, 419999999999, 429999999999, 439999999999, 449999999999, 459999999999, 469999999999, 479999999999, 489999999999, 499999999999, 509999999999, 519999999999, 529999999999, 539999999999, 549999999999, 559999999999, 569999999999, 579999999999, 589999999999, 599999999999, 609999999999, 619999999999, 629999999999, 639999999999, 649999999999, 659999999999, 669999999999, 679999999999, 689999999999, 699999999999, 709999999999, 719999999999, 729999999999, 739999999999, 749999999999, 759999999999, 769999999999, 779999999999, 789999999999, 799999999999, 809999999999, 819999999999, 829999999999, 839999999999, 849999999999, 859999999999, 869999999999, 879999999999, 889999999999, 899999999999, 909999999999, 919999999999, 929999999999, 939999999999, 949999999999, 959999999999, 969999999999, 979999999999, 989999999999, 999999999999, 1099999999999, 1199999999999, 1299999999999, 1399999999999, 1499999999999, 1599999999999, 1699999999999, 1799999999999, 1899999999999, 1999999999999, 2099999999999, 2199999999999, 2299999999999, 2399999999999, 2499999999999, 2599999999999, 2699999999999, 2799999999999, 2899999999999, 2999999999999, 3099999999999, 3199999999999, 3299999999999, 3399999999999, 3499999999999, 3599999999999, 3699999999999, 3799999999999, 3899999999999, 3999999999999, 4099999999999, 4199999999999, 4299999999999, 4399999999999, 4499999999999, 4599999999999, 4699999999999, 4799999999999, 4899999999999, 4999999999999, 5099999999999, 5199999999999, 5299999999999, 5399999999999, 5499999999999, 5599999999999, 5699999999999, 5799999999999, 5899999999999, 5999999999999, 6099999999999, 6199999999999, 6299999999999, 6399999999999, 6499999999999, 6599999999999, 6699999999999, 6799999999999, 6899999999999, 6999999999999, 7099999999999, 7199999999999, 7299999999999, 7399999999999, 7499999999999, 7599999999999, 7699999999999, 7799999999999, 7899999999999, 7999999999999, 8099999999999, 8199999999999, 8299999999999, 8399999999999, 8499999999999, 8599999999999, 8699999999999, 8799999999999, 8899999999999, 8999999999999, 9099999999999, 9199999999999, 9299999999999, 9399999999999, 9499999999999, 9599999999999, 9699999999999, 9799999999999, 9899999999999, 9999999999999, 9999999999999, 10999999999999, 11999999999999, 12999999999999, 13999999999999, 14999999999999, 15999999999999, 16999999999999, 17999999999999, 18999999999999, 19999999999999, 20999999999999, 21999999999999, 22999999999999, 23999999999999, 24999999999999, 25999999999999, 26999999999999, 27999999999999, 28999999999999, 29999999999999, 30999999999999, 31999999999999, 32999999999999, 33999999999999, 34999999999999, 35999999999999, 36999999999999, 37999999999999, 38999999999999, 39999999999999, 40999999999999, 41999999999999, 42999999999999, 43999999999999, 44999999999999, 45999999999999, 46999999999999, 47999999999999, 48999999999999, 49999999999999, 50999999999999, 51999999999999, 52999999999999, 53999999999999, 54999999999999, 55999999999999, 56999999999999, 57999999999999, 58999999999999, 59999999999999, 60999999999999, 61999999999999, 62999999999999, 63999999999999, 64999999999999, 65999999999999, 66999999999999, 67999999999999, 68999999999999, 69999999999999, 70999999999999, 71999999999999, 72999999999999, 73999999999999, 74999999999999, 75999999999999, 76999999999999, 77999999999999, 78999999999999, 79999999999999, 80999999999999, 81999999999999, 82999999999999, 83999999999999, 84999999999999, 85999999999999, 86999999999999, 87999999999999, 88999999999999, 89999999999999, 90999999999999, 91999999999999, 92999999999999, 93999999999999, 94999999999999, 95999999999999, 96999999999999, 97999999999999, 98999999999999, 99999999999999, 100999999999999, 101999999999999, 102999999999999, 103999999999999, 104999999999999, 105999999999999, 106999999999999, 107999999999999, 108999999999999, 109999999999999, 119999999999999, 129999999999999, 139999999999999, 149999999999999, 159999999999999, 169999999999999, 179999999999999, 189999999999999, 199999999999999, 209999999999999, 219999999999999, 229999999999999, 239999999999999, 249999999999999, 259999999999999, 269999999999999, 279999999999999, 289999999999999, 299999999999999, 309999999999999, 319999999999999, 329999999999999, 339999999999999, 349999999999999, 359999999999999, 369999999999999, 379999999999999, 389999999999999, 399999999999999, 409999999999999, 419999999999999, 429999999999999, 439999999999999, 449999999999999, 459999999999999, 469999999999999, 479999999999999, 489999999999999, 499999999999999, 509999999999999, 519999999999999, 529999999999999, 539999999999999, 549999999999999, 559999999999999, 569999999999999, 579999999999999, 589999999999999, 599999999999999, 609999999999999, 619999999999999, 629999999999999, 639999999999999, 649999999999999, 659999999999999, 669999999999999, 679999999999999, 689999999999999, 699999999999999, 709999999999999, 719999999999999, 729999999999999, 739999999999999, 749999999999999, 759999999999999, 769999999999999, 779999999999999, 789999999999999, 799999999999999, 809999999999999, 819999999999999, 829999999999999, 839999999999999, 849999999999999, 859999999999999, 869999999999999, 879999999999999, 889999999999999, 899999999999999, 909999999999999, 919999999999999, 929999999999999, 939999999999999, 949999999999999, 959999999999999, 969999999999999, 979999999999999, 989999999999999, 999999999999999]\n k = int(input())\n assert(k <= len(seq))\n for x in seq[:k]:\n print(x)\n\nif __name__ == "__main__":\n main()', 'def main():\n seq = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1099, 1199, 1299, 1399, 1499, 1599, 1699, 1799, 1899, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 10999, 11999, 12999, 13999, 14999, 15999, 16999, 17999, 18999, 19999, 20999, 21999, 22999, 23999, 24999, 25999, 26999, 27999, 28999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 109999, 119999, 129999, 139999, 149999, 159999, 169999, 179999, 189999, 199999, 209999, 219999, 229999, 239999, 249999, 259999, 269999, 279999, 289999, 299999, 309999, 319999, 329999, 339999, 349999, 359999, 369999, 379999, 389999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1099999, 1199999, 1299999, 1399999, 1499999, 1599999, 1699999, 1799999, 1899999, 1999999, 2099999, 2199999, 2299999, 2399999, 2499999, 2599999, 2699999, 2799999, 2899999, 2999999, 3099999, 3199999, 3299999, 3399999, 3499999, 3599999, 3699999, 3799999, 3899999, 3999999, 4099999, 4199999, 4299999, 4399999, 4499999, 4599999, 4699999, 4799999, 4899999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 10999999, 11999999, 12999999, 13999999, 14999999, 15999999, 16999999, 17999999, 18999999, 19999999, 20999999, 21999999, 22999999, 23999999, 24999999, 25999999, 26999999, 27999999, 28999999, 29999999, 30999999, 31999999, 32999999, 33999999, 34999999, 35999999, 36999999, 37999999, 38999999, 39999999, 40999999, 41999999, 42999999, 43999999, 44999999, 45999999, 46999999, 47999999, 48999999, 49999999, 50999999, 51999999, 52999999, 53999999, 54999999, 55999999, 56999999, 57999999, 58999999, 59999999, 69999999, 79999999, 89999999, 99999999, 109999999, 119999999, 129999999, 139999999, 149999999, 159999999, 169999999, 179999999, 189999999, 199999999, 209999999, 219999999, 229999999, 239999999, 249999999, 259999999, 269999999, 279999999, 289999999, 299999999, 309999999, 319999999, 329999999, 339999999, 349999999, 359999999, 369999999, 379999999, 389999999, 399999999, 409999999, 419999999, 429999999, 439999999, 449999999, 459999999, 469999999, 479999999, 489999999, 499999999, 509999999, 519999999, 529999999, 539999999, 549999999, 559999999, 569999999, 579999999, 589999999, 599999999, 609999999, 619999999, 629999999, 639999999, 649999999, 659999999, 669999999, 679999999, 689999999, 699999999, 799999999, 899999999, 999999999, 1099999999, 1199999999, 1299999999, 1399999999, 1499999999, 1599999999, 1699999999, 1799999999, 1899999999, 1999999999, 2099999999, 2199999999, 2299999999, 2399999999, 2499999999, 2599999999, 2699999999, 2799999999, 2899999999, 2999999999, 3099999999, 3199999999, 3299999999, 3399999999, 3499999999, 3599999999, 3699999999, 3799999999, 3899999999, 3999999999, 4099999999, 4199999999, 4299999999, 4399999999, 4499999999, 4599999999, 4699999999, 4799999999, 4899999999, 4999999999, 5099999999, 5199999999, 5299999999, 5399999999, 5499999999, 5599999999, 5699999999, 5799999999, 5899999999, 5999999999, 6099999999, 6199999999, 6299999999, 6399999999, 6499999999, 6599999999, 6699999999, 6799999999, 6899999999, 6999999999, 7099999999, 7199999999, 7299999999, 7399999999, 7499999999, 7599999999, 7699999999, 7799999999, 7899999999, 7999999999, 8999999999, 9999999999, 10999999999, 11999999999, 12999999999, 13999999999, 14999999999, 15999999999, 16999999999, 17999999999, 18999999999, 19999999999, 20999999999, 21999999999, 22999999999, 23999999999, 24999999999, 25999999999, 26999999999, 27999999999, 28999999999, 29999999999, 30999999999, 31999999999, 32999999999, 33999999999, 34999999999, 35999999999, 36999999999, 37999999999, 38999999999, 39999999999, 40999999999, 41999999999, 42999999999, 43999999999, 44999999999, 45999999999, 46999999999, 47999999999, 48999999999, 49999999999, 50999999999, 51999999999, 52999999999, 53999999999, 54999999999, 55999999999, 56999999999, 57999999999, 58999999999, 59999999999, 60999999999, 61999999999, 62999999999, 63999999999, 64999999999, 65999999999, 66999999999, 67999999999, 68999999999, 69999999999, 70999999999, 71999999999, 72999999999, 73999999999, 74999999999, 75999999999, 76999999999, 77999999999, 78999999999, 79999999999, 80999999999, 81999999999, 82999999999, 83999999999, 84999999999, 85999999999, 86999999999, 87999999999, 88999999999, 89999999999, 99999999999, 109999999999, 119999999999, 129999999999, 139999999999, 149999999999, 159999999999, 169999999999, 179999999999, 189999999999, 199999999999, 209999999999, 219999999999, 229999999999, 239999999999, 249999999999, 259999999999, 269999999999, 279999999999, 289999999999, 299999999999, 309999999999, 319999999999, 329999999999, 339999999999, 349999999999, 359999999999, 369999999999, 379999999999, 389999999999, 399999999999, 409999999999, 419999999999, 429999999999, 439999999999, 449999999999, 459999999999, 469999999999, 479999999999, 489999999999, 499999999999, 509999999999, 519999999999, 529999999999, 539999999999, 549999999999, 559999999999, 569999999999, 579999999999, 589999999999, 599999999999, 609999999999, 619999999999, 629999999999, 639999999999, 649999999999, 659999999999, 669999999999, 679999999999, 689999999999, 699999999999, 709999999999, 719999999999, 729999999999, 739999999999, 749999999999, 759999999999, 769999999999, 779999999999, 789999999999, 799999999999, 809999999999, 819999999999, 829999999999, 839999999999, 849999999999, 859999999999, 869999999999, 879999999999, 889999999999, 899999999999, 909999999999, 919999999999, 929999999999, 939999999999, 949999999999, 959999999999, 969999999999, 979999999999, 989999999999, 999999999999, 1099999999999, 1199999999999, 1299999999999, 1399999999999, 1499999999999, 1599999999999, 1699999999999, 1799999999999, 1899999999999, 1999999999999, 2099999999999, 2199999999999, 2299999999999, 2399999999999, 2499999999999, 2599999999999, 2699999999999, 2799999999999, 2899999999999, 2999999999999, 3099999999999, 3199999999999, 3299999999999, 3399999999999, 3499999999999, 3599999999999, 3699999999999, 3799999999999, 3899999999999, 3999999999999, 4099999999999, 4199999999999, 4299999999999, 4399999999999, 4499999999999, 4599999999999, 4699999999999, 4799999999999, 4899999999999, 4999999999999, 5099999999999, 5199999999999, 5299999999999, 5399999999999, 5499999999999, 5599999999999, 5699999999999, 5799999999999, 5899999999999, 5999999999999, 6099999999999, 6199999999999, 6299999999999, 6399999999999, 6499999999999, 6599999999999, 6699999999999, 6799999999999, 6899999999999, 6999999999999, 7099999999999, 7199999999999, 7299999999999, 7399999999999, 7499999999999, 7599999999999, 7699999999999, 7799999999999, 7899999999999, 7999999999999, 8099999999999, 8199999999999, 8299999999999, 8399999999999, 8499999999999, 8599999999999, 8699999999999, 8799999999999, 8899999999999, 8999999999999, 9099999999999, 9199999999999, 9299999999999, 9399999999999, 9499999999999, 9599999999999, 9699999999999, 9799999999999, 9899999999999, 9999999999999, 10999999999999, 11999999999999, 12999999999999, 13999999999999, 14999999999999, 15999999999999, 16999999999999, 17999999999999, 18999999999999, 19999999999999, 20999999999999, 21999999999999, 22999999999999, 23999999999999, 24999999999999, 25999999999999, 26999999999999, 27999999999999, 28999999999999, 29999999999999, 30999999999999, 31999999999999, 32999999999999, 33999999999999, 34999999999999, 35999999999999, 36999999999999, 37999999999999, 38999999999999, 39999999999999, 40999999999999, 41999999999999, 42999999999999, 43999999999999, 44999999999999, 45999999999999, 46999999999999, 47999999999999, 48999999999999, 49999999999999, 50999999999999, 51999999999999, 52999999999999, 53999999999999, 54999999999999, 55999999999999, 56999999999999, 57999999999999, 58999999999999, 59999999999999, 60999999999999, 61999999999999, 62999999999999, 63999999999999, 64999999999999, 65999999999999, 66999999999999, 67999999999999, 68999999999999, 69999999999999, 70999999999999, 71999999999999, 72999999999999, 73999999999999, 74999999999999, 75999999999999, 76999999999999, 77999999999999, 78999999999999, 79999999999999, 80999999999999, 81999999999999, 82999999999999, 83999999999999, 84999999999999, 85999999999999, 86999999999999, 87999999999999, 88999999999999, 89999999999999, 90999999999999, 91999999999999, 92999999999999, 93999999999999, 94999999999999, 95999999999999, 96999999999999, 97999999999999, 98999999999999, 99999999999999, 100999999999999, 101999999999999, 102999999999999, 103999999999999, 104999999999999, 105999999999999, 106999999999999, 107999999999999, 108999999999999, 109999999999999, 119999999999999, 129999999999999, 139999999999999, 149999999999999, 159999999999999, 169999999999999, 179999999999999, 189999999999999, 199999999999999, 209999999999999, 219999999999999, 229999999999999, 239999999999999, 249999999999999, 259999999999999, 269999999999999, 279999999999999, 289999999999999, 299999999999999, 309999999999999, 319999999999999, 329999999999999, 339999999999999, 349999999999999, 359999999999999, 369999999999999, 379999999999999, 389999999999999, 399999999999999, 409999999999999, 419999999999999, 429999999999999, 439999999999999, 449999999999999, 459999999999999, 469999999999999, 479999999999999, 489999999999999, 499999999999999, 509999999999999, 519999999999999, 529999999999999, 539999999999999, 549999999999999, 559999999999999, 569999999999999, 579999999999999, 589999999999999, 599999999999999, 609999999999999, 619999999999999, 629999999999999, 639999999999999, 649999999999999, 659999999999999, 669999999999999, 679999999999999, 689999999999999, 699999999999999, 709999999999999, 719999999999999, 729999999999999, 739999999999999, 749999999999999, 759999999999999, 769999999999999, 779999999999999, 789999999999999, 799999999999999, 809999999999999, 819999999999999, 829999999999999, 839999999999999, 849999999999999, 859999999999999, 869999999999999, 879999999999999, 889999999999999, 899999999999999, 909999999999999, 919999999999999, 929999999999999, 939999999999999, 949999999999999, 959999999999999, 969999999999999, 979999999999999, 989999999999999, 999999999999999]\n k = int(input())\n for x in seq[:k]:\n print(x)\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s066801133', 's689414548']
[3576.0, 3576.0]
[19.0, 19.0]
[10126, 10090]
p03323
u000123984
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a, b = input().split()\nif a > 8 or b > 8: print(":(")\nelse: print("Yay!")', 'a, b = map(int, input().split())\nif a>8 or b>8: print(":(")\nelse: print("Yay!")']
['Runtime Error', 'Accepted']
['s488389738', 's764538375']
[3060.0, 2940.0]
[18.0, 17.0]
[73, 79]
p03323
u001024152
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
["a = int(input())\nb = int(input())\n\nif max(a, b) > 8:\n print(':(')\nelse:\n print('Yay!')", "a = int(input())\nb = int(input())\n\nif max(a, b) > 8:\n print(':(')\nelse:\n print('Yay!')", "a,b = map(int, input().split())\n\nif max(a, b) > 8:\n print(':(')\nelse:\n print('Yay!')"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s435641608', 's814647074', 's741096077']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 18.0]
[92, 92, 90]
p03323
u002459665
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['\n\na, b = map(int, input().split())\nif a <= 8 and b <= 8:\n print("Yay")\nelse:\n print(":(")', 'a, b = map(int, input().split())\nif a <= 8 and b <= 8:\n print("Yay!")\nelse:\n print(":(")\n']
['Wrong Answer', 'Accepted']
['s278126728', 's116401249']
[2940.0, 2940.0]
[18.0, 18.0]
[95, 95]
p03323
u006425112
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['import sys\n\na, b = map(int, sys.stdin.readline())\n\nif a <= 8 and b <= 8:\n print(\'Yay!\')\nelse:\n print(":(")', 'import sys\n\na, b = map(int, sys.stdin.readline().split()))\n\nif a <= 8 and b <= 8:\n print(\'Yay!\')\nelse:\n print(":(")', 'import sys\n\na, b = map(int, sys.stdin.readline().split())\n\nif a <= 8 and b <= 8:\n print(\'Yay!\')\nelse:\n print(":(")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s488951203', 's978183905', 's222875380']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[112, 121, 120]
p03323
u006657459
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
["line = raw_input().split()\na = line[0]\nb = line[1]\n\nif a > 8 or b > 8:\n return ':('\nelse:\n return 'Yay!'", "line = input().split()\na = line[0]\nb = line[1]\n\nif a > 8 or b > 8:\n return ':('\nelse:\n return 'Yay!'", "line = input().split()\na = line[0]\nb = line[1]\n\nif a > 8 or b > 8:\n print(':(')\nelse:\n print('Yay!')", "A, B = map(int, input().split())\nif A <= 8 and B <= 8:\n print('Yay!')\nelse :\n print(':(')"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s523021288', 's612424958', 's760778625', 's126579917']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 17.0]
[110, 106, 106, 95]
p03323
u007263493
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a ,b = map(int,input().split())\nif a =< 8 and b=<8:\n print("Yay")\nelse:\n print(":(")', 'a ,b = map(int,input().split())\nif a <= 8 and b <= 8:\n print("Yay!")\nelse:\n print(":(")']
['Runtime Error', 'Accepted']
['s031876210', 's951282967']
[2940.0, 2940.0]
[17.0, 17.0]
[90, 93]
p03323
u010090035
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
["a,b=map(int,input())\nif(a+b%2==0):\n print('Yay!')\nelif(a < 9 and b < 9):\n print('Yay!')\nelse:\n print(':(')", "a,b=map(int,input().split())\nif(a+b%2==0):\n print('Yay!')\nelif(a < 9 and b < 9):\n print('Yay!')\nelse:\n print(':(')"]
['Runtime Error', 'Accepted']
['s629706976', 's247061957']
[2940.0, 2940.0]
[17.0, 17.0]
[115, 123]
p03323
u010512738
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a, b = map(input().split())\nif a < 8 and b < 8:\n print("Yay!")\nelse:\n print(":(")', 'a, b = map(int, input().split())\nif a <= 8 and b <= 8:\n print("Yay!")\nelse:\n print(":(")']
['Runtime Error', 'Accepted']
['s914866739', 's330507768']
[9024.0, 9164.0]
[26.0, 26.0]
[83, 90]
p03323
u013296940
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['\nA = int(input())\nB = int(input())\n\nif A>8 or B>8:\n print(":(")\nelif A<=8 and B<=8:\n print("Yay!")\n', '\nA,B = map(int, input().split())\n \nif A>8 or B>8:\n print(":(")\nelif A<=8 and B<=8:\n print("Yay!")']
['Runtime Error', 'Accepted']
['s538253272', 's587632310']
[2940.0, 2940.0]
[18.0, 17.0]
[112, 110]
p03323
u016901717
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a,b=map(int,input().split()) \nprint("Yay" if a<=8 and b<=8 else ":(" )', 'a,b=map(int,input().split()) \nprint("Yay!" if a<=8 and b<=8 else ":(" )']
['Wrong Answer', 'Accepted']
['s468665058', 's912181550']
[2940.0, 2940.0]
[17.0, 17.0]
[70, 71]
p03323
u017415492
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a,b=map(int,input().split())\n\nif a>8 or b>8:\n print(":(")\nelse:\n print("Yay")', 'a,b=map(int,input().split())\n\nif a>8 or b>8:\n print(":(")\nelse:\n print("Yay!")']
['Wrong Answer', 'Accepted']
['s816858904', 's762997394']
[2940.0, 2940.0]
[18.0, 17.0]
[79, 80]
p03323
u018679195
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['line = input()\nnum_a, num_b = [int(n) for n in line.split()][0]\nis_it_possible = "Yay!"\nif num_a > 8 or num_b > 8:\n is_it_possible = ":("\nprint(is_it_possible)', "a, b = map(int, input().split())\n\nif a > 8 or b > 8:\n print('Yay!')\nelse:\n print(':(')", 'line = input()\nnum_a, num_b = [int(n) for n in line.split()]\nis_it_possible = "Yay!"\nif num_a > 8 or num_b > 8:\n is_it_possible = ":("\nprint(is_it_possible)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s321029630', 's984890169', 's650842085']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[162, 92, 159]
p03323
u019584841
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
["a = int(input())\nb = int(input())\nif max(a,b) <= 6:\n print('Yay!')\nelse:\n print(':(')", "a = int(input())\nb = int(input())\nif max(a,b) <= 8:\n print('Yay!')\nelse:\n print(':(')", "a,b = map(int,input().split())\nif max(a,b) <= 8:\n print('Yay!')\nelse:\n print(':(')\n"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s387106130', 's456407957', 's112692685']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[87, 87, 85]
p03323
u020390084
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a, b = (int(i) for i in input().split())\n\nif a <= 8 & b<= 8:\n print ("Yay!")\nelse:\n print(":(")\n\n\n', 'a, b = [int(i) for i in input().split()]\n \nif a <= 8 and b<= 8:\n print ("Yay!")\nelse:\n print(":(")']
['Wrong Answer', 'Accepted']
['s604645286', 's429905941']
[2940.0, 3060.0]
[18.0, 22.0]
[104, 104]
p03323
u020801333
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['A, B = map(int, input().split())\nif A== 8 and B==8:\n print("Yay!")\nif A>8 and b<8:\n print(":(")\nif A<8 and b>8:\n print(":(")\nelse:\n print("Yay!")\n ', 'A, B = map(int, input().split())\nif A<8 and B <8:\n print("Yay!")\nelif A==8 and B == 8:\n print("Yay!")\nelse:\n print(":(")\n']
['Runtime Error', 'Accepted']
['s664771898', 's886479793']
[2940.0, 2940.0]
[17.0, 17.0]
[152, 130]
p03323
u021770165
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a,b = map(int,input().split())\n\nfor a<9 and b<9:\n print("Yay!")\nelse:\n print(":(")', 'a,b = map(int,input().split())\n\nif a<9 and b<9:\n print("Yay!")\nelse:\n print(":(")']
['Runtime Error', 'Accepted']
['s427111833', 's099757239']
[9008.0, 9024.0]
[26.0, 27.0]
[84, 83]
p03323
u023185908
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['import numpy as np\n\na = input()\nb = input()\n\na = int(a)\nb = int(b)\nif a > 8:\n print(\':(\')\n\nelif b > 8:\n print(\':(\')\n\nelif a+b > 16:\n print(":(")\n\nelse:\n print("Yay!")\n', 'i = int(input())\nii = input().split()\n\na = int(0)\nn = int(0)\nm = int(0)\nk = int(0)\nfor n in ii:\n a = int(n)\n for m in range(i):\n while (a % 1 == 0):\n a = a/2\n if (a % 1 == 0):\n k += 1\n\nprint(k)', 'c = input().split()\n\na = int(c[0])\nb = int(c[1])\n\nif a > 8:\n print(\':(\')\n\nelif b > 8:\n print(\':(\')\n\nelif a+b > 16:\n print(":(")\n\nelse:\n print("Yay!")\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s181407076', 's444103849', 's146195361']
[12636.0, 3060.0, 3316.0]
[157.0, 17.0, 19.0]
[179, 229, 162]
p03323
u024782094
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['a,b=map(int,input().split)\nprint("Yay!" if a<=8 and b<=8 else ":(")', 'a,b=map(int,input().split)\nprint("Yay!" if (a<=8 and b<=8) else ":(")', 'a,b=map(int,input().split())\nprint("Yay!" if a<=8 and b<=8 else ":(")\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s048633887', 's482438689', 's825407221']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[67, 69, 70]
p03323
u026155812
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
["A, B = map(int input().split())\nif max(A, B) > 8:\n print(':(')\nelse:\n print('Yay!')", "A, B = map(int, input().split())\nif max(A, B) > 8:\n print(':(')\nelse:\n print('Yay!')"]
['Runtime Error', 'Accepted']
['s507466135', 's735582182']
[3064.0, 2940.0]
[17.0, 17.0]
[89, 90]
p03323
u026686258
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
['D, N = map(int,input().split())\n\ncount = N\nx = (100 ** D) * (N - (N-1)//99) \nprint(x)', 'A, B = map(int, input().split())\n\nmax = max(A,B)\nmin = min(A,B)\nprint("max: {}".format)\nif(A==B):\n print("Yay!")\nelif((min*2+1)+(max-min) +2 <= 16):\n print("Yay!")\nelse:\n print(":(")', 'A, B = map(int, input().split())\n\nif A <= 8 or B <= 8:\n return "Yay!"\nelse:\n return ":("', 'A, B = map(int, input().split())\n \nif A <= 8 and B <= 8:\n print("Yay!")\nelse:\n print(":(")']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s496559457', 's827803663', 's897775355', 's493168774']
[2940.0, 3060.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0]
[157, 191, 94, 96]
p03323
u029568245
2,000
1,024,000
E869120's and square1001's 16-th birthday is coming soon. Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan- shaped pieces. E869120 and square1001 were just about to eat A and B of those pieces, respectively, when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake". Can both of them obey the instruction in the note and take desired numbers of pieces of cake?
["a b = list(map(int, input().split()))\nif a <= 8 and b <= 8:\n print('Yay!')\nelse:\n print(':(')", "a, b = list(map(int, input().split()))\nif a <= 8 and b <= 8:\n print('Yay!')\nelse:\n print(':(')"]
['Runtime Error', 'Accepted']
['s433849122', 's261991408']
[8852.0, 9092.0]
[24.0, 24.0]
[95, 96]