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
p03266
u832039789
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['import math\nn,k = map(int,input().split())\nif k==1:\n print(n**3)\nelse:\n res = 0\n if k%2==0:\n res += (math.ceil((n-k//2)/k))**3\n res += (n//k)**3\n print(res)\n', 'n,k=map(int,input().split());print((n//k)**3+(k+1)%2*((n-k//2)//k+1)**3)']
['Wrong Answer', 'Accepted']
['s017276343', 's960131970']
[2940.0, 2940.0]
[17.0, 17.0]
[179, 72]
p03266
u838590162
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = input().split()\nN = int(N)\nK = int(K)\n\ncount = (N // K)**3\n\nif K % 2 == 0:\n count += ((N - K // 2) // K)**3\n\nprint(count)\n', 'N, K = input().split()\nN = int(N)\nK = int(K)\n\ncount = (N // K)**3\n\nif K % 2 == 0:\n count += ((N - K // 2) // K + 1)**3\n\nprint(count)\n']
['Wrong Answer', 'Accepted']
['s678870809', 's065979798']
[2940.0, 2940.0]
[17.0, 17.0]
[132, 136]
p03266
u842964692
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N,K=map(int,input().split())\n\nnum=[0]*(N)\nfor i in range(1,N+1):\n num[i%K]+=1\n#print(num)\n\nfor a in range(K):\n b=(K-a)%K\n c=(K-a)%K\n if (b+c)%K!=0:\n continue\n else:\n \t#print(a)\n ans+=num[a]*num[b]*num[c]\n print(a,b,c)\nprint(ans)', 'N,K=map(int,input().split())\n\nnum=[0]*(K-1)\nfor i in range(N):\n num[i%K]+=1\n\nfor a in range(K):\n b=(K-a)%K\n c=(K-a)%K\n if (b+c)%K!=0:\n continue\n else:\n ans=num[a]*num[b]*num[c]\nprint(ans)', 'N,K=map(int,input().split())\n\nnum=[0]*(max(N+1,K)\nfor i in range(1,N+1):\n num[i%K]+=1\n#print(num)\nans=0\nfor a in range(K):\n b=(K-a)%K\n c=(K-a)%K\n if (b+c)%K!=0:\n continue\n else:\n \t#print(a)\n ans+=num[a]*num[b]*num[c]\n #print(a,b,c)\nprint(ans)', 'N,K=map(int,input().split())\n\nnum=[0]*(max(N+1,K))\nfor i in range(1,N+1):\n num[i%K]+=1\n#print(num)\nans=0\nfor a in range(K):\n b=(K-a)%K\n c=(K-a)%K\n if (b+c)%K!=0:\n continue\n else:\n \t#print(a)\n ans+=num[a]*num[b]*num[c]\n #print(a,b,c)\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s176542003', 's220589654', 's625496710', 's707014100']
[4596.0, 4596.0, 2940.0, 4596.0]
[54.0, 97.0, 17.0, 114.0]
[312, 259, 326, 327]
p03266
u844005364
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n, k = map(int, input().split())\n\nif k % 2 == 0:\n k //= 2\n\nprint((n // k) ** 3)', 'n, k = map(int, input().split())\n\nif k % 2 == 0:\n even = n // k\n odd = n // (k / 2) - even\n print(odd ** 3 + even ** 3)\nelse:\n print((n // k) ** 3)\n', 'n, k = map(int, input().split())\n\nif k % 2 == 0:\n even = n // k\n odd = n // (k // 2) - even\n print(odd ** 3 + even ** 3)\nelse:\n print((n // k) ** 3)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s394292914', 's822701423', 's598485586']
[3316.0, 2940.0, 2940.0]
[21.0, 18.0, 17.0]
[82, 160, 161]
p03266
u844646164
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['import sys\ninput = sys.stdin.readline\nimport itertools\nN, K = list(map(int, input().split()))\ncount = 0\nposs = [n for n in range(1, N+1) if (2*n)%K==0]\n\nposs2 = list(itertools.product(poss, repeat=3))\n\n', 'import sys\ninput = sys.stdin.readline\nimport itertools\nN, K = list(map(int, input().split()))\ncount = 0\nposs = [n for n in range(1, N+1) if (2*n)%K==0]\nprint(len(poss))\nposs2 = list(itertools.combinations_with_replacement(poss, 3))\nprint(poss2)\n\n', 'import sys\ninput = sys.stdin.readline\nimport itertools\nN, K = list(map(int, input().split()))\ncount = 0\nposs = [n for n in range(1, N+1) if (2*n)%K==0]\nprint(len(poss))\n', 'N, K = map(int, input().split())\nnum = {i%K:N//K for i in range(1, K+1)}\nmod = N % K\nfor i in range(1, mod+1):\n num[i] += 1\n\nans = 0\nfor i in range(K):\n if (2*i) % K == 0:\n cnt = num[i]\n cnt *= num[(K-i)%K] * num[(K-i)%K]\n ans += cnt\nprint(ans) ']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s149103297', 's616892850', 's960256899', 's987208276']
[1914704.0, 2008400.0, 10968.0, 27112.0]
[2230.0, 2234.0, 49.0, 95.0]
[202, 246, 169, 272]
p03266
u846150137
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int,input().split())\nprint((n//k)**3 if k%2==1 else (n//k)**3+((n-k/2)//k+1)**3)', 'n,k=map(int,input().split())\nprint((n//k)**3 if k%2==1 else (n//k)**3+((n-k/2)//3+1)**3)', 'n,k=map(int,input().split())\nprint((n//k)**3 if k%2==1 else (n//k)**3+(n//(k/2))**3)', 'n,k=map(int,input().split())\nprint((n//k)**3 if k%2==1 else (n//k)**3+((n-k//2)//k+1)**3)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s572838085', 's669337820', 's732273681', 's018516313']
[3064.0, 3060.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[88, 88, 84, 89]
p03266
u898967808
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k = map(int,input().split())\n\ncount = 0\nnum = n // k \nbb = [i*k for i in range(1,num+1)]\ns = len(bb) \ncount += s + 3*s*(s-1) + s*(s-1)*(s-2) \n\nif k % 2 == 0: \n bb = [i*k + int(2/k) for i in range(num) ]\n s = len(bb)\n count += s + 3*s*(s-1) + s*(s-1)*(s-2)\n\nprint(count) ', 'from math import ceil \n\nn,k = map(int,input().split())\n\ncount = 0\nnum = n // k\nbb = [(i+1)*k for i in range(num) ]\ns = len(bb) \ncount += s + 3*s*(s-1) + s*(s-1)*(s-2) \n\nif k % 2 == 0: \n bb=[]\n tmp = k//2 \n while tmp <= n:\n bb.append(tmp)\n tmp += k \n s = len(bb)\n count += s + 3*s*(s-1) + s*(s-1)*(s-2)\n\nprint(count) ']
['Wrong Answer', 'Accepted']
['s549258073', 's057038091']
[11032.0, 11032.0]
[51.0, 48.0]
[278, 338]
p03266
u917558625
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N,K=map(int,input().split())\nans=0\nif K%2==1:\n print((N//K)**3)\nelse:\n ans=(N//K)**3\n k=K//2\n j=0\n for i in range(1,N):\n if i%K==k:\n j+=1\n print(j**3+ans)', 'N,K=map(int,input().split())\nans=0\nif K%2==1:\n print((N//K)**3)\nelse:\n ans=(N//K)**3\n k=K//2\n j=(N+k)//K\n print(j**3+ans)']
['Wrong Answer', 'Accepted']
['s242521779', 's260343841']
[9072.0, 9168.0]
[45.0, 28.0]
[168, 126]
p03266
u924406834
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N,K = map(int,input().split())\nnumbers = [x for x in range(1,N+1)]\na = 0\nfor i in numbers:\n yaba = []\n for j in range((N+i)//K):\n yaba.append((j*K)-i)\n for j in yaba:\n for k in yaba:\n if j+k % K == 0:\n a += 1\n else:\n pass\nprint(a)', 'n,k = map(int,input().split())\nnum = (n // k) ** 3\nif k % 2 == 0:\n if n - ((n // k) * k) < k // 2:\n print(num * 2)\n else:\n print(num + ((n // k + 1) ** 3))\nelse:\n print(num)']
['Wrong Answer', 'Accepted']
['s930505539', 's690977378']
[18840.0, 3060.0]
[2105.0, 17.0]
[305, 196]
p03266
u986254798
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n, k = map(int, input())\ncandidOdd = 0\ncandidEven = 0\ncandidEven2 = 0\nfor i in range(1, n+1):\n if k % 2 == 1:\n if i % k == 0:\n candidOdd += 1\n else:\n if i % k == 0:\n candidEven += 1\n elif i % k == (k/2):\n candidEven2 += 1\nprint(candidOdd**3 + candidEven**3 + candidEven2**3)', '\nn, k = 5, 2\n\nfor a in range(1, n+1):\n for b in range(a, n+1):\n if (a+b) % k != 0:\n continue\n for c in range(b, n+1):\n if (c+a) % k == 0 and (b+a) % k == 0:\n print (a, b, c)', 'n, k = map(int, input().split())\ncandidOdd = 0\ncandidEven = 0\ncandidEven2 = 0\nfor i in range(1, n+1):\n if k % 2 == 1:\n if i % k == 0:\n candidOdd += 1\n else:\n if i % k == 0:\n candidEven += 1\n elif i % k == (k/2):\n candidEven2 += 1\nprint(candidOdd**3 + candidEven**3 + candidEven2**3)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s169146688', 's410428227', 's726049220']
[8956.0, 9040.0, 9104.0]
[26.0, 30.0, 78.0]
[334, 228, 342]
p03266
u987164499
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['from sys import stdin\nfrom itertools import product\n\nn,k = [int(x) for x in stdin.readline().rstrip().split()]\n\nf = n//k\n\nli = [0]*f\n\n\nfrom itertools import product\nlin = list(product(li, repeat=3))\n\nprint(len(lin))', 'from sys import stdin\nfrom math import factorial\n\nn,k = [int(x) for x in stdin.readline().rstrip().split()]\npoint = 0\npoint2 = 0\nif k % 2 == 1:\n for i in range(1,n+1):\n if i%k == 0:\n point += 1\nelse:\n for i in range(1,n+1):\n if i % k == 0:\n point += 1\n elif i%k == k//2:\n point2 += 1\n\ndef combinations_count(n, r):\n return factorial(n) // (factorial(n - r) * factorial(r))\n\nprint(point**3+point2**3)']
['Wrong Answer', 'Accepted']
['s841512581', 's895653840']
[1977764.0, 3064.0]
[2242.0, 78.0]
[234, 462]
p03266
u987170100
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int, input().split())\nret = 0\nfor x in range(1, N + 1):\n for y in [y for y in range(K - x, N + 1, K) if y > 0]:\n for z in [z for z in range(K - y, N + 1, K) if z > 0]:\n cnt += 1 \n if (z + x) % K == 0:\n ret += 1\nprint(ret)', 'N, K = map(int, input().split())\nret = 0\nfor x in range(1, N + 1):\n for y in [y for y in range(K - x, N + 1, K) if y > 0]:\n for z in [z for z in range(K - y, N + 1, K) if z > 0]:\n cnt += 1 \n if (z + x) % K == 0:\n ret += 1\nprint(ret)', 'N, K = map(int, input().split())\nn = sum([1 for x in range(K, N + 1, K)])\nif K % 2 == 1:\n print(n ** 3)\nelse:\n m = sum([1 for x in range(K // 2, N + 1, K)])\n print(n ** 3 + m ** 3)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s318527120', 's987560711', 's280507720']
[18840.0, 18840.0, 4632.0]
[65.0, 67.0, 25.0]
[284, 284, 189]
p03268
u106778233
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N,K=map(int,input().split())\nu1, u2=divmod(N,K)\nans=u1*3\n\nA=[u1]*K\nfor i in range(u2):\n A[i+1]+=1\nif K%2==0:\n ans+=A[K//2+1]*3\nprint(ans)', 'N,K=map(int,input().split())\nu1, u2=divmod(N,K)\nans=u1**3\n\nA=[u1]*K\nfor i in range(u2):\n A[i+1]+=1\nif K%2==0:\n ans+=A[K//2+1]**3\nprint(ans)', 'N,K=map(int,input().split())\nu1, u2=divmod(N,K)\nans=u1*3\n\nA=[u1]*K\nfor i in range(u2):\n A[i+1]+=1\nif K%2==0:\n ans+=A[K//2+1]*3\nprint(ans)', 'N,K=map(int,input().split())\nu1=N//K\nu2=N%K\nans=u1**3\n\nA=[u1]*K\nfor i in range(u2):\n A[i+1]+=1\nif K%2==0:\n ans+=A[K//2]**3\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s091856989', 's173007524', 's998788444', 's927576324']
[4596.0, 4596.0, 4596.0, 4596.0]
[32.0, 33.0, 33.0, 33.0]
[143, 145, 143, 139]
p03268
u215315599
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int,input().split())\n\ncntMod = N//K\n\n\nif K%2==0:\n if K*cntMod+(N/(K//2)) <= N:\n cntMid = cntMod + 1\n else:\n cntMid = cntMod\nelse:\n cntMid = 0\nprint(cntMid**3+cntMod**3)\n', 'N, K = map(int,input().split())\n\ncntMod = N//K\n\n\nif K%2==0:\n if K*cntMod+K//2 <= N:\n cntMid = cntMod + 1\n else:\n cntMid = cntMod\nelse:\n cntMid = 0\nprint(cntMid**3+cntMod**3)\n']
['Wrong Answer', 'Accepted']
['s820491904', 's561076435']
[2940.0, 2940.0]
[17.0, 17.0]
[333, 433]
p03268
u241190159
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['import bisect\nimport math\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom copy import copy, deepcopy\nfrom heapq import heapify, heappop, heappush\nfrom itertools import combinations, permutations\nfrom queue import Queue\n\nread = sys.stdin.read\nreadline = sys.stdin.readline \nreadlines = sys.stdin.readlines \n\ndef SI():\n return int(readline())\ndef MI():\n return map(int, readline().split())\ndef MLI():\n return map(int, open(0).read().split())\n\ninf = float("inf")\n\n\ndef main():\n N, K = MI()\n num_factor_K = N // K\n ret = num_factor_K ** 3\n print(ret)\n \n if K % 2 == 0:\n num_factor_half_K = N // K\n if N % K >= K // 2:\n num_factor_half_K += 1\n ret += num_factor_half_K ** 3\n \n print(ret)\n \n\nif __name__ == "__main__":\n main()', 'import bisect\nimport math\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom copy import copy, deepcopy\nfrom heapq import heapify, heappop, heappush\nfrom itertools import combinations, permutations\nfrom queue import Queue\n\nread = sys.stdin.read\nreadline = sys.stdin.readline \nreadlines = sys.stdin.readlines \n\ndef SI():\n return int(readline())\ndef MI():\n return map(int, readline().split())\ndef MLI():\n return map(int, open(0).read().split())\n\ninf = float("inf")\n\n\ndef main():\n N, K = MI()\n num_factor_K = N // K\n ret = num_factor_K ** 3\n \n if K % 2 == 0:\n num_factor_half_K = N // K\n if N % K >= K // 2:\n num_factor_half_K += 1\n ret += num_factor_half_K ** 3\n \n print(ret)\n \n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s643020658', 's028301442']
[4076.0, 4076.0]
[28.0, 27.0]
[815, 800]
p03268
u263830634
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int, input().split())\n\nif K % 2 == 1:\n tmp = N // K\n ans = tmp ** 3\n print (ans)0\n\nelse:\n tmp = N // K\n ans = tmp ** 3\n\n tmp = N // (K // 2) - tmp\n ans += tmp ** 3\n\n print (ans)\n', 'N, K = map(int, input().split())\n\nif K % 2 == 1:\n tmp = N // K\n ans = tmp ** 3\n print (ans)\n\nelse:\n tmp = N // K\n ans = tmp ** 3\n\n tmp = N // (K // 2) - tmp\n ans += tmp ** 3\n\n print (ans)\n']
['Runtime Error', 'Accepted']
['s359163703', 's671436552']
[2940.0, 2940.0]
[17.0, 18.0]
[213, 212]
p03268
u331997680
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int, input().split())\nc = 0\nfor i in range(1,K+1):\n for j in range(0,N+1):\n b = i*K + j*K\n if b <= N and (i*K+b)%K == (b+b)%K == 0:\n c = i\n print(c, i*K)\n elif b != 0:\n break\nprint(c**3)', 'N, K = map(int, input().split())\nc = 0\nfor i in range(1,N+1):\n b = i*K\n if b <= N:\n c += 1\n else:\n break\ne = 0\nif K%2 ==0:\n for i in range(1,N+1):\n d = i*K/2\n if d <= N and d%K != 0:\n e += 1 \n print(c**3 + e**3)\nelse:\n print(c**3)']
['Wrong Answer', 'Accepted']
['s614849747', 's442453418']
[4848.0, 3060.0]
[392.0, 135.0]
[222, 263]
p03268
u333945892
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['K,N = list(map(int, input().split()))\nMAX = K+N+3\nmod = 998244353\n\nfac = [1]*(MAX+1)\nfor i in range(1,MAX+1):\n\tfac[i] = (fac[i-1]*i)%mod\n\nrev_m = [1]*(MAX+1)\nrev_m[MAX] = pow(fac[MAX],mod-2,mod)\nfor i in range(MAX,0,-1):\n\trev_m[i-1] = (rev_m[i]*i)%mod\n\ndef Comb(n,k):#nCk\n\treturn (fac[n]*rev_m[k]*rev_m[n-k])%mod\n\n\ndef f(n,k,i):\n\tif i == 2:\n\t\tif n < 0 or (k==1 and n>=2): \n\t\t\treturn 0\n\t\telif n == 0:\n\t\t\treturn 1\n\t\telse:\n\t\t\treturn (Comb(k-2+n,n)+Comb(k-2+n-1,n-1)) % mod\n\telse: #i>2\n\t\tSp = i//2-1\n\t\tans = 0\n\t\tfor p in range(Sp+1):\n\t\t\tans += g(n,k,i,p)\n\t\treturn ans % mod\n\ndef g(n,k,i,p):\n\tSp = i//2-1\n\tif p == 0:\n\t\treturn f(n-Sp,k-Sp,2) * pow(2,Sp,mod) % mod\n\telse: #p>0\n\t\treturn g(n,k-2*p,i-2*p,0) * Comb(Sp,p)\n\nans = []\nfor i in range(2,K+2):\n\tif i%2 == 0:\n\t\ttmp = f(N,K,i)\n\tans.append(tmp)\n\tprint(tmp)\n\nans = ans[::-1]\nfor i in range(1,K):\n\tprint(ans[i])\n', "from collections import defaultdict,deque\nimport sys,heapq,bisect,math,itertools,string,queue,datetime\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = 998244353\neps = 10**-7\ndef inp(): return int(input())\ndef inpl(): return list(map(int, input().split()))\ndef inpls(): return list(input().split())\n\nK,N = inpl()\n\nMAX = 20000\nfac = [1]*(MAX+1)\nfor i in range(1,MAX+1):\n\tfac[i] = (fac[i-1]*i)%mod\n\ngyakugen = [1]*(MAX+1)\ngyakugen[MAX] = pow(fac[MAX],mod-2,mod)\nfor i in range(MAX,0,-1):\n\tgyakugen[i-1] = (gyakugen[i]*i)%mod\n\ndef Comb(n,k):#nCk\n\treturn (fac[n]*gyakugen[k]*gyakugen[n-k])%mod\n\n\ndef calc(k,n,i):\n\tx = (i-2)//2\n\tk -= x\n\tn -= x\n\tif k == 1:\n\t\tif n <= 1:\n\t\t\treturn n\n\t\telse:\n\t\t\treturn 0\n\telif k < 1:\n\t\treturn 0\n\ttmp = 0\n\tfor j in range(2):\n\t\tzb = n-j\n\t\tzm = k-2\n\t\ttmp += Comb(zb+zm,min(zb,zm))%mod\n\ttmp %= mod\n\ttmp *= pow(2,x,mod)\n\treturn tmp\n\nans = []\nfor i in range(2,K+2):\n\tif i%2 == 0:\n\t\tpairs = (i-2)//2\n\t\ttmp = 0\n\t\tfor p0 in range(pairs+1):\n\t\t\ttmp += calc(K-p0*2,N,i-p0*2)*Comb(pairs,p0)%mod\n\t\t\ttmp %= mod\n\tans.append(tmp)\n\tprint(tmp)\n\nans = ans[::-1]\n\nfor i in range(1,K):\n\tprint(ans[i])\n", "from collections import defaultdict,deque\nimport sys,heapq,bisect,math,itertools,string,queue,datetime\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = 10**9+7\neps = 10**-7\ndef inp(): return int(input())\ndef inpl(): return list(map(int, input().split()))\ndef inpls(): return list(input().split())\n\nN,K = inpl()\n\nif K%2 == 1:\n\tprint((N//K)**3)\nelse:\n\tans = (N//K)**3\n\ttmp = N//K\n\tif N%K >= K//2:\n\t\ttmp += 1\n\tans += tmp**3\n\tprint(ans)\n"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s664116897', 's969374797', 's099376938']
[26992.0, 6252.0, 4592.0]
[2105.0, 2104.0, 123.0]
[870, 1127, 438]
p03268
u473633103
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['# coding: utf-8\n# Your code here!\n\nn,k = map(int,input().split())\n\nif(k%2==0):\n k//=2\n\ncount=0\n\nfor a in range(k,n,k):\n for b in range(k,n,k):\n for c in range(k,n,k):\n if (a+b)%k==0 and (c+b)%k==0 and (a+c)%k==0:\n count+=1\n\nprint(count)\n', '# coding: utf-8\n# Your code here!\n\nn,k = map(int,input().split())\n\nhk = 0\n\nans = (n//k)**3\n\nif k%2==0:\n n -= k//2\n ans += (n//k +1)**3\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s586422949', 's195967159']
[3060.0, 2940.0]
[2104.0, 17.0]
[276, 156]
p03268
u518064858
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int,input().split())\nif k%2==0:\n x=(n+k/2)//k\n y=n//k\n print(x**3+y**3)\nelse:\n x=n//k\n print(x**3)\n', 'n,k=map(int,input().split())\nif k%2==0:\n x=(n+k/2)//k\n y=n//k\n print(int(x**3+y**3))\nelse:\n x=n//k\n print(int(x**3))\n']
['Wrong Answer', 'Accepted']
['s931186399', 's851682209']
[3060.0, 3064.0]
[17.0, 20.0]
[122, 132]
p03268
u519968172
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int,input().split())\nif k%2==1:\n print((n//k)**3)\nelse:\n j=n//(k//2)\n print(j)\n if j %2==0:\n print(2*((j//2)**3))\n else:\n print(((j//2)**3)+((j//2+1)**3))\n \n', 'n,k=map(int,input().split())\nif k%2==1:\n print((n//k)**3)\nelse:\n j=n//(k//2)\n if j %2==0:\n print(2*((j//2)**3))\n else:\n print(((j//2)**3)+((j//2+1)**3))\n \n']
['Wrong Answer', 'Accepted']
['s597495572', 's558209799']
[8956.0, 9156.0]
[29.0, 29.0]
[185, 174]
p03268
u531768068
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['\ndef getIntList():\n return list(map(int, input().split())) \n\nN, K = getIntList()\n\nres = 0\nc1 ==0\nc2 ==0\nif K %2 ==0:\n t = K//2\nelse:\n t= -1\n\nif True:\n for i in range(1,N+1):\n if i%K == t:\n c1+=1\n if i%K ==0:\n c2+=1\nres = c1 **3 + c2** 3\nprint(res)', 'def getIntList():\n return list(map(int, input().split())) \n \nN, K = getIntList()\n \nres = 0\nc1 =0\nc2 =0\nif K %2 ==0:\n t = K//2\nelse:\n t= -1\n \nif True:\n for i in range(1,N+1):\n if i%K == t:\n c1+=1\n if i%K ==0:\n c2+=1\nres = c1 **3 + c2** 3\nprint(res)\n']
['Runtime Error', 'Accepted']
['s532754026', 's150968349']
[3064.0, 3060.0]
[18.0, 76.0]
[299, 300]
p03268
u536578131
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['l = int(input())\nedge = []\nfor i in range(1, 19):\n edge.append((i, i + 1, 1 << (i - 1)))\n edge.append((i, i + 1, 0))\nsm = 0\nfor i in range(19, 0, -1):\n v = 1 << (i - 1)\n while l >= v:\n edge.append((i, 20, sm))\n sm += v\n l -= v\nprint(20, len(edge))\nfor x, y, z in edge:\n print(x, y, z)', 'n,k=map(int,input().split())\nprint((n//k)**3+(1-k%2)*((n+k//2)//k)**3)']
['Runtime Error', 'Accepted']
['s371591503', 's130500693']
[3064.0, 2940.0]
[17.0, 17.0]
[320, 70]
p03268
u597622207
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['\n\n\n\n\n\nN, K = map(int, input().split())\n\nif K % 2 != 0:\n n = N // K \n print(n ** 3)\n\nelse:\n n = N // K\n half_n = N // (K//2)\n print(half_n)\n print(n ** 3 + (half_n - n)** 3)', '\n\n\n\n\n\nN, K = map(int, input().split())\n\nif K % 2 != 0:\n n = N // K \n print(n ** 3)\n\nelse:\n n = N // K\n half_n = N // (K//2)\n print(n ** 3 + (half_n - n)** 3)']
['Wrong Answer', 'Accepted']
['s143335438', 's571857464']
[3060.0, 2940.0]
[18.0, 17.0]
[299, 281]
p03268
u623687794
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int,input().split())\nif k%2==1:\n print((n//k)**3)\nelse:\n print((n//(k//2))**3+(n//k-n//(k//2))**3)', 'n,k=map(int,input().split())\nif k%2==1:\n print((n//k)**3)\nelse:\n print((n//k)**3+(n//(k//2)-n//k)**3)\n']
['Wrong Answer', 'Accepted']
['s384712819', 's523309126']
[2940.0, 3316.0]
[17.0, 19.0]
[108, 104]
p03268
u651663683
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=list(map(int,input().split()))\nr=0\nr+=(n//k)**3\nif k%2==0:\n r+=((n-k//2)//k)**3\nprint(r)', 'n,k=list(map(int,input().split()))\nr=0\nr+=(n//k)**3\nif k%2==0:\n r+=((n+k//2)//k)**3\nprint(r)\n']
['Wrong Answer', 'Accepted']
['s689984372', 's800717969']
[9104.0, 9060.0]
[28.0, 29.0]
[93, 94]
p03268
u670180528
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int,input().split())\nif k%2:\n print((n//k)**3)\nelse:\n l=k//2\n if l%2:\n print(((n+l)//k)**3)\n else:\n print(((n+l)//k)**3 + (n//k)**3)', 'n,k=map(int,input())\nif k%2:\n print((n//k)**3)\nelse:\n l=k//2\n if l%2:\n print(((n+l)//k)**3)\n else:\n print(((n+l)//k)**3 + (n//k)**3)', 'n,k=map(int,input().split())\nprint((n//k)**3+~-k%2*((n+k//2)//k)**3)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s814183232', 's961076689', 's205067995']
[3060.0, 3060.0, 2940.0]
[17.0, 18.0, 18.0]
[150, 142, 68]
p03268
u702582248
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['a, b=map(int, input().split())\ntry:\n\tc = a // (b // 2)\n\tc = c //2 + c% 2\nexcept Exception:\n c = 0\ntry:\n d = a // b\nexcept Exception:\n d = 0\n print(c**3 + d **3)', 'a, b=map(int, input().split())\ntry:\n c = a // (b // 2)\n c = c //2 + c% 2\nexcept Exception as e:\n c = 0\ntry:\n d = a // b\nexcept Exception as e:\n d = 0\n print(c**3 + d **3)', 'a, b=map(int, input().split())\ntry:\n c = a // (b // 2)\n c = c //2 + c%2\nexcept Exception as e:\n c = 0\nif b % 2 == 1:\n c = 0\ntry:\n d = a // b\nexcept Exception as e:\n d = 0\nprint(c**3 + d**3)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s759538742', 's779064261', 's891405078']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[168, 189, 208]
p03268
u703890795
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int, input().split())\nif K%2==1:\n print((N//K)**3)\nelse:\n print((N//K)**3 + (((N//2)//K) - (N//K))**3)', 'N, K = map(int, input().split())\nif K%2==1:\n print((N//K)**3)\nelse:\n print((N//K)**3 + ((N//(K//2)) - (N//K))**3)']
['Wrong Answer', 'Accepted']
['s325594114', 's277939707']
[2940.0, 2940.0]
[17.0, 17.0]
[115, 115]
p03268
u708255304
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int, input().split())\n\n\nnum = [0]*(K) \nfor i in range(1, N+1):\n num[i % K] += 1 \n\nans = 0\nfor a in range(K+1): \n b = (K-a) % K\n c = (K-a) % K\n if (b + c) % K == 0:\n ans += num[a] * num[b] * num[c]\n\nprint(ans)\n', 'N, K = map(int, input().split())\n\n\nnum = [0]*(K+1) \nfor i in range(1, N+1):\n num[i % K] += 1 \n\nans = 0\nfor a in range(K+1): \n b = (K-a) % K\n c = (K-a) % K\n if (b + c) % K == 0:\n ans += num[a] * num[b] * num[c]\n\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s056274985', 's203940963']
[4596.0, 4596.0]
[108.0, 97.0]
[478, 480]
p03268
u744901930
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['def base3(K):\n tmp=K\n S=""\n while(True):\n S=str(tmp%3)+S\n tmp=tmp//3\n if tmp==0:\n break\n return S\nL=int(input())\nT=base3(L)[::-1]\nN=len(T)\nA=[]\nfor i in range(N-1):\n tmp=3**i\n for k in range(3):\n A.append((i+1,i+2,k*tmp))\nbef=0\nfor i in range(N)[::-1]:\n tmp=3**i\n for k in range(int(T[i])):\n A.append((i+1,N+1,bef+k*tmp))\n bef+=int(T[i])*tmp\nprint(N+1,len(A))\nfor p in A:\n print(p[0],p[1],p[2])ans=(n//k)**3\n', ' def base3(K):\n tmp=K\n S=""\n while(True):\n S=str(tmp%3)+S\n tmp=tmp//3\n if tmp==0:\n break\n return S\n L=int(input())\n T=base3(L)[::-1]\n N=len(T)\n A=[]\n for i in range(N-1):\n tmp=3**i\n for k in range(3):\n A.append((i+1,i+2,k*tmp))\n bef=0\n for i in range(N)[::-1]:\n tmp=3**i\n for k in range(int(T[i])):\n A.append((i+1,N+1,bef+k*tmp))\n bef+=int(T[i])*tmp\n print(N+1,len(A))\n for p in A:\n print(p[0],p[1],p[2])', 'n,k=map(int,input().split())\nans=(n//k)**3\nif(k%2==0):\n ans+=(n//(k//2)-n//k)**3\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s154031442', 's441251762', 's326724437']
[3064.0, 2940.0, 2940.0]
[17.0, 20.0, 17.0]
[484, 574, 95]
p03268
u807772568
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['a,b = map(int,input().split())\n\nif b%2 != 0:\n print(pow(a//b,3))\nelse:\n print(pow(a//b,3)+pow(((a+b//2)//a),3))\n', 'a,b = map(int,input().split())\nc = a//b\nd = a//(b//2)\nif b % 2 == 0:\n\tprint(c**3 + d**3)\nelse:\n\tprint(c**3)', 'a,b = map(int,input().split())\nc = a//b-1\nd = a//(b//2)\nif b % 2 == 0:\n\tprint(c**3+d**3)\nelse:\n\tprint(c**3)', 'a,b = map(int,input().split())\nc = a//b\nd = a//(b//2)\nif b % 2 == 0:\n\tprint(d**3)\nelse:\n\tprint(c**3)', 'a,b = map(int,input().split())\n\nif b%2 != 0:\n print(pow(a//b,3))\nelse:\n print((a//b)**3 + +((a+b//2)//a)**3)\n', 'a,b = map(int,input().split())\n\nif b%2 != 0:\n print(pow(a//b,3))\nelse:\n print(pow(a//b,3)+pow(((a+b//2)//a),3)\n', 'a,b = map(int,input().split())\n\nif b%2 != 0:\n print(pow(a//b,3))\nelse:\n print(pow(a//b,3)+pow(((a+b//2)//b),3))\n']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s055897695', 's128613809', 's247776563', 's262659623', 's546852774', 's971024047', 's201407759']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[114, 107, 107, 100, 111, 113, 114]
p03268
u829316025
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['\nimport math\n \nn, k = map(int, input().split())\nc = 0\n \nif k%2==0:\n if math.floor(2*n/k)%2==0:\n d=math.floor(2*n/k)\n c=2*d*d*d\n else:\n d=(math.floor(2*n/k)+1)\n c=d*d*d+(d-1)*(d-1)*(d-1)\n print(int(c))\nelse:\n d=math.floor(n/k)\n c=d*d*d\n print(int(c))\n', '\nimport math\n \nn, k = map(int, input().split())\nc = 0\n \nif k%2==0:\n if math.floor(2*n/k)%2==0:\n d=math.floor(2*n/k)/2\n c=2*d*d*d\n else:\n d=(math.floor(2*n/k)+1)/2\n c=d*d*d+(d-1)*(d-1)*(d-1)\n print(int(c))\nelse:\n d=math.floor(n/k)\n c=d*d*d\n print(int(c))\n']
['Wrong Answer', 'Accepted']
['s553483399', 's252280574']
[3064.0, 3060.0]
[17.0, 17.0]
[296, 300]
p03268
u830054172
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N, K = map(int, input().split())\n\nif K%3 == 0:\n ans = N//K\nelse:\n ans = N//K*3\nprint(ans)', 'n,k=map(int,input().split())\nprint((n//k)**3 if k%2==1 else (n//k)**3+((n+k//2)//k)**3)\n']
['Wrong Answer', 'Accepted']
['s326729424', 's897461871']
[2940.0, 2940.0]
[17.0, 17.0]
[95, 88]
p03268
u859897687
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int,input().split())\nans=0\nfor i in range(1,n//k+1):\n i*=k\n if i%2==0:\n i//=2\n ans+=(n//i)**3\nprint(ans)', 'n,k=map(int,input().split())\nans=0\nfor i in range(1,2):\n i*=k\n if i%2==0:\n ans+=(n//(i//2)-n//i)**3\n ans+=(n//i)**3\nprint(ans)']
['Wrong Answer', 'Accepted']
['s017454776', 's459263671']
[2940.0, 2940.0]
[146.0, 17.0]
[118, 132]
p03268
u941884460
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N,K=map(int,input().split())\n\nif K <=2:\n print(N*N*N)\nelse:\n if K%2 == 0:\n div = N//(K//2)\n if div%2 > 0:\n div = div//2\n print((div*div*div) + (div+1)*(div+1)*(div+1))\n else:\n print(div*div*div)\n else:\n div = N//K\n print(div*div*div)', 'N,K=map(int,input().split())\n\nif K <=2:\n print(N*N*N)\nelse:\n if K%2 == 0:\n div = N//(K//2)\n if div%2 > 0:\n div = div//2\n print((div*div*div) + (div+1)*(div+1)*(div+1))\n else:\n div = div//2\n print(div*div*div*2)\n else:\n div = N//K\n print(div*div*div)', 'N,K=map(int,input().split())\n \nif K%2 == 0:\n div = N//(K//2)\n if div%2 > 0:\n div = div//2\n print((div*div*div) + (div+1)*(div+1)*(div+1))\n else:\n div = div//2\n print(div*div*div*2)\nelse:\n div = N//K\n print(div*div*div)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s046864263', 's830027535', 's566825337']
[3064.0, 3064.0, 3060.0]
[17.0, 50.0, 17.0]
[266, 287, 235]
p03268
u944209426
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['n,k=map(int, input().split())\nif k%2==0:\n x=0\n y=0\n for i in range(1,n+1):\n if i%k==k//2:\n x+=1\n if i%k==0:\n y+=1\n ans=0\n if x>=1:\n ans+=com(x,1)\n if x>=2:\n ans+=6*com(x,2)\n if x>=3:\n ans+=6*com(x,3)\n if y>=1:\n ans+=com(y,1)\n if y>=2:\n ans+=6*com(y,2)\n if y>=3:\n ans+=6*com(y,3)\n print(ans)\nelse:\n x=0\n for i in range(1,n+1):\n if i%k==0:\n x+=1\n ans=0\n if x>=1:\n ans+=com(x,1)\n if x>=2:\n ans+=6*com(x,2)\n if x>=3:\n ans+=6*com(x,3)\n print(ans)\ndef com(a,b):\n r=1\n for i in range(b):\n r*=(a-i)\n r//=i+1\n return r', 'n,k=map(int, input().split())\nif k%2==0:\n x=0\n y=0\n for i in range(1,n+1):\n if i%k==k//2:\n x+=1\n if i%k==0:\n y+=1\n ans=0\n if x>=1:\n ans+=com(x,1)\n if x>=2:\n ans+=6*com(x,2)\n if x>=3:\n ans+=6*com(x,3)\n if y>=1:\n ans+=com(y,1)\n if y>=2:\n ans+=6*com(y,2)\n if y>=3:\n ans+=6*com(y,3)\n print(ans)\nelse:\n x=0\n for i in range(1,n+1):\n if i%k==0:\n x+=1\n ans=0\n if x>=1:\n ans+=com(x,1)\n if x>=2:\n ans+=6*com(x,2)\n if x>=3:\n ans+=6*com(x,3)\n print(ans)\n \ndef com(a,b):\n r=1\n for i in range(b):\n r*=(a-i)\n r//=i+1\n return r', 'n,k=map(int, input().split())\ndef com(a,b):\n r=1\n for i in range(b):\n r*=(a-i)\n r//=i+1\n return r\nif k%2==0:\n x=0\n y=0\n for i in range(1,n+1):\n if i%k==k//2:\n x+=1\n if i%k==0:\n y+=1\n ans=0\n if x>=1:\n ans+=com(x,1)\n if x>=2:\n ans+=6*com(x,2)\n if x>=3:\n ans+=6*com(x,3)\n if y>=1:\n ans+=com(y,1)\n if y>=2:\n ans+=6*com(y,2)\n if y>=3:\n ans+=6*com(y,3)\n print(ans)\nelse:\n x=0\n for i in range(1,n+1):\n if i%k==0:\n x+=1\n ans=0\n if x>=1:\n ans+=com(x,1)\n if x>=2:\n ans+=6*com(x,2)\n if x>=3:\n ans+=6*com(x,3)\n print(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s028652432', 's754033440', 's520091018']
[3064.0, 3064.0, 3188.0]
[85.0, 89.0, 90.0]
[703, 708, 703]
p03268
u991713078
2,000
1,048,576
You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.
['N,M=input().split()\nN=int(N)\nM=int(M)\nif M%2==0:\n print((N/M)**3+((N+M/2)/M)**3)\nelse:\n print((N/M)**3)', 'N,M=input().split()\nN=int(N)\nM=int(M)\nif M%2==0:\n print(int(N/M)**3+int((N+M/2)/M)**3)\nelse:\n print(int(N/M)**3)']
['Wrong Answer', 'Accepted']
['s847365009', 's420960178']
[9292.0, 9060.0]
[27.0, 29.0]
[105, 114]
p03270
u297574184
2,000
1,048,576
Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable. For each i=2,3,...,2K, find the following value modulo 998244353: * The number of combinations of N sides shown by the dice such that the sum of no two different sides is i. Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.
['MOD = 998244353\n\nK, N = map(int, input().split())\n\n\ninv = [0] * (K + N + 1)\ninv[1] = 1\nfor x in range(2, K + N + 1):\n inv[x] = (-(MOD // x) * inv[MOD % x]) % MOD\n\n# nCr[n][r]: C(n, r) % MOD\nnCr = [[0] * (K + N + 1) for i in range(K + N + 1)]\nfor n in range(K + N + 1):\n nCr[n][0] = 1\n for r in range(1, n + 1):\n nCr[n][r] = (nCr[n][r - 1] * (n - r + 1) * inv[r]) % MOD\n\n\ndef nHr(n, r):\n return nCr[n + r - 1][r]\n\n\nfor i in range(2, 2 * K + 1):\n print(nHr(K, N))\n', "def solve():\n MOD = 998244353\n maxNK = 2000\n\n K, N = map(int, input().split())\n\n def getInvs(n, MOD):\n invs = [1] * (n+1)\n for x in range(2, n+1):\n invs[x] = (-(MOD//x) * invs[MOD%x]) % MOD\n return invs\n\n def getCombss(n, k, invs, MOD):\n def getCombNs(n, k, invs, MOD):\n combNs = [1] * (n//2+1)\n for x in range(1, n//2+1):\n combNs[x] = (combNs[x-1] * (n-x+1) * invs[x]) % MOD\n return (combNs + combNs[:(n+1)//2][::-1])[:k+1]\n combss = [[] for n in range(n+1)]\n for x in range(n+1):\n combss[x] = getCombNs(x, k, invs, MOD)\n combss[x] += [0] * (k+1-len(combss[x]))\n return combss\n\n invs = getInvs(2*maxNK, MOD)\n combss = getCombss(2*maxNK, maxNK, invs, MOD)\n\n def getPows(base, n, MOD):\n pows = [1] * (n+1)\n for x in range(1, n+1):\n pows[x] = (pows[x-1] * base) % MOD\n return pows\n pow2s = getPows(2, N, MOD)\n\n anss = []\n for i in range(2, K+2, 2):\n ans = 0\n numFree = abs(K+1-i)\n numPair = (K-numFree+1)//2\n numPair -= 1\n for x in range(min(numPair, N)+1):\n ans += combss[numPair][x] * pow2s[x] * combss[N+numFree-1][N-x] % MOD\n ans %= MOD\n for x in range(min(numPair, N)+1):\n ans += combss[numPair][x] * pow2s[x] * combss[N+numFree-2][N-x-1] % MOD\n ans %= MOD\n anss.append(ans)\n if i+1 <= K+1:\n anss.append(ans)\n\n anss = anss + anss[:-1][::-1]\n print('\\n'.join(map(str, anss)))\n\n\nsolve()\n"]
['Wrong Answer', 'Accepted']
['s906259821', 's120743879']
[252748.0, 208532.0]
[2119.0, 1891.0]
[521, 1600]
p03270
u333945892
2,000
1,048,576
Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable. For each i=2,3,...,2K, find the following value modulo 998244353: * The number of combinations of N sides shown by the dice such that the sum of no two different sides is i. Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.
["from collections import defaultdict,deque\nimport sys,heapq,bisect,math,itertools,string,queue,datetime\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = 998244353\neps = 10**-7\ndef inp(): return int(input())\ndef inpl(): return list(map(int, input().split()))\ndef inpls(): return list(input().split())\n\nK,N = inpl()\n\nMAX = 10000\nfac = [1]*(MAX+1)\nfor i in range(1,MAX+1):\n\tfac[i] = (fac[i-1]*i)%mod\n\ngyakugen = [1]*(MAX+1)\ngyakugen[MAX] = pow(fac[MAX],mod-2,mod)\nfor i in range(MAX,0,-1):\n\tgyakugen[i-1] = (gyakugen[i]*i)%mod\n\ndef Comb(n,k):#nCk\n\treturn (fac[n]*gyakugen[k]*gyakugen[n-k])%mod\n\n\ndef calc(k,n,i):\n\tx = (i-2)//2\n\tk -= x\n\tn -= x\n\tif k == 1 and n==1:\n\t\treturn 1\n\telif k < 1 or n < 0:\n\t\treturn 0\n\t\t\n\ttmp = 0\n\tfor j in range(2):\n\t\tzb = n-j\n\t\tzm = k-2\n\t\ttmp += Comb(zb+zm,min(zb,zm))%mod\n\ttmp %= mod\n\ttmp *= pow(2,x,mod)\n\treturn tmp\n\nans = []\nfor i in range(2,K+2):\n\tif i%2 == 0:\n\t\tpairs = (i-2)//2\n\t\ttmp = 0\n\t\tfor p0 in range(pairs+1):\n\t\t\ttmp += calc(K-p0*2,N,i-p0*2)*Comb(pairs,p0)%mod\n\t\t\ttmp %= mod\n\ttmp %= mod\n\tans.append(tmp)\n\tprint(tmp)\n\nans = ans[::-1]\n\nfor i in range(1,K):\n\tprint(ans[i])\n", 'K,N = list(map(int, input().split()))\nMAX = K+N+3\nmod = 998244353\n\nfac = [1]*(MAX+1)\nfor i in range(1,MAX+1):\n\tfac[i] = (fac[i-1]*i)%mod\n\nrev_m = [1]*(MAX+1)\nrev_m[MAX] = pow(fac[MAX],mod-2,mod)\nfor i in range(MAX,0,-1):\n\trev_m[i-1] = (rev_m[i]*i)%mod\n\ndef Comb(n,k):#nCk\n\treturn (fac[n]*rev_m[k]*rev_m[n-k])%mod\n\n\ndef f(n,k,i):\n\tif i == 2:\n\t\tif n < 0 or (k==1 and n>=2): \n\t\t\treturn 0\n\t\telif n == 0:\n\t\t\treturn 1\n\t\telse:\n\t\t\treturn (Comb(k-2+n,n)+Comb(k-2+n-1,n-1)) % mod\n\telse: #i>2\n\t\tSp = i//2-1\n\t\tans = 0\n\t\tfor p in range(Sp+1):\n\t\t\tans += g(n,k,i,p)\n\t\treturn ans % mod\n\ndef g(n,k,i,p):\n\tSp = i//2-1\n\tif p == 0:\n\t\treturn f(n-Sp,k-Sp,2) * pow(2,Sp,mod) % mod\n\telse: #p>0\n\t\treturn g(n,k-2*p,i-2*p,0) * Comb(Sp,p)\n\nans = []\nfor i in range(2,K+2):\n\tif i%2 == 0:\n\t\ttmp = f(N,K,i)\n\tans.append(tmp)\n\tprint(tmp)\n\nans = ans[::-1]\nfor i in range(1,K):\n\tprint(ans[i])\n']
['Wrong Answer', 'Accepted']
['s180751223', 's182310702']
[5348.0, 3568.0]
[2104.0, 1816.0]
[1126, 870]
p03270
u340781749
2,000
1,048,576
Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable. For each i=2,3,...,2K, find the following value modulo 998244353: * The number of combinations of N sides shown by the dice such that the sum of no two different sides is i. Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.
['def prepare(k, n, MOD):\n def get_factorials(m):\n f = 1\n factorials = [1]\n for m in range(1, m + 1):\n f *= m\n f %= MOD\n factorials.append(f)\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (m + 1)\n invs[m] = inv\n for m in range(m, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n def solve(p):\n """Number of patterns where no pair of p appears when n dices are rolled"""\n if cache[p] > -1:\n return cache[p]\n\n ret = 0\n fp = factorials[p]\n for q in range(1, min(p, n // 2) + 1):\n tmp1 = (fp * invs[q] % MOD) * invs[p - q] % MOD\n tmp2 = (factorials[k + n - 2 * q - 1] * invs[n - 2 * q] % MOD) * ik % MOD\n if q % 2 == 1:\n ret += tmp1 * tmp2\n else:\n ret -= tmp1 * tmp2\n ret %= MOD\n\n cache[p] = ret = (all_patterns - ret) % MOD\n return ret\n\n factorials, invs = get_factorials(k + n)\n ik = invs[k - 1]\n all_patterns = factorials[k + n - 1] * invs[n] * ik % MOD\n cache = [-1] * (k // 2 + 1)\n\n return solve\n\n\nMOD = 998244353\nk, n = map(int, input().split())\nif k == 1:\n print(0)\nelse:\n solve = prepare(k, n, MOD)\n ans = [solve(i // 2 - max(0, i - k - 1)) for i in range(2, k + 2)]\n print(\'\\n\'.join(map(str, ans)))\n print(\'\\n\'.join(map(str, ans[-2::-1])))\n', 'def prepare(n, MOD):\n f = 1\n factorials = [1]\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n factorials.append(f)\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n\ndef solve_sub(k, n, p, factorials, invs):\n """Number of patterns where any pair(s) of p pairs appear when n dices are rolled"""\n ret = 0\n for q in range(1, p + 1):\n \n tmp1 = (factorials[p] * invs[q] % MOD) * invs[p - q] % MOD\n tmp2 = (factorials[k + n - 2 * q - 1] * invs[n - 2 * q] % MOD) * invs[k - 1] % MOD\n ret += tmp1 * tmp2 * (-1) ** (q - 1)\n ret %= MOD\n return ret\n\n\ndef solve(k, n):\n factorials, invs = prepare(k + n, MOD)\n all_patterns_odd = factorials[k + n - 1] * invs[n] * invs[k - 1] % MOD\n all_patterns_even0 = factorials[k + n - 2] * invs[n] * invs[k - 2] % MOD\n all_patterns_even1 = factorials[k + n - 3] * invs[n - 1] * invs[k - 2] % MOD\n buf = []\n\n for i in range(2, k + 2):\n pairs = min(i // 2 - max(0, i - k - 1), n // 2)\n if i % 2 == 0:\n ans = all_patterns_even0 - solve_sub(k - 1, n, pairs - 1, factorials, invs)\n ans += all_patterns_even1 - solve_sub(k - 1, n - 1, pairs - 1, factorials, invs)\n ans %= MOD\n else:\n ans = (all_patterns_odd - solve_sub(k, n, pairs, factorials, invs)) % MOD\n buf.append(ans)\n\n return buf\n\n\nMOD = 998244353\nk, n = map(int, input().split())\nans = solve(k, n)\nprint(\'\\n\'.join(map(str, ans)))\nprint(\'\\n\'.join(map(str, ans[-2::-1])))\n', 'def prepare(k, n, MOD):\n def get_factorials(m):\n f = 1\n factorials = [1]\n for m in range(1, m + 1):\n f *= m\n f %= MOD\n factorials.append(f)\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (m + 1)\n invs[m] = inv\n for m in range(m, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n def solve(p):\n """Number of patterns where no pair of p appears when n dices are rolled"""\n if cache[p] > -1:\n return cache[p]\n\n ret = 0\n fp = factorials[p]\n for q in range(1, min(p, n // 2) + 1):\n tmp1 = (fp * invs[q] % MOD) * invs[p - q] % MOD\n tmp2 = (factorials[k + n - 2 * q - 1] * invs[n - 2 * q] % MOD) * ik % MOD\n if q % 2 == 1:\n ret += tmp1 * tmp2\n else:\n ret -= tmp1 * tmp2\n ret %= MOD\n\n cache[p] = ret = (all_patterns - ret) % MOD\n return ret\n\n factorials, invs = get_factorials(k + n)\n ik = invs[k - 1]\n all_patterns = factorials[k + n - 1] * invs[n] * ik % MOD\n cache = [-1] * (k // 2 + 2)\n\n return solve\n\n\nMOD = 998244353\nk, n = map(int, input().split())\nif k == 1:\n print(0)\nelse:\n solve = prepare(k, n, MOD)\n ans = [solve(i // 2 - max(0, i - k - 1)) for i in range(2, k + 2)]\n print(\'\\n\'.join(map(str, ans)))\n print(\'\\n\'.join(map(str, ans[-2::-1])))\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s311134751', 's641284899', 's151638221']
[3572.0, 3444.0, 3572.0]
[540.0, 2104.0, 551.0]
[1470, 1722, 1470]
p03270
u476199965
2,000
1,048,576
Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable. For each i=2,3,...,2K, find the following value modulo 998244353: * The number of combinations of N sides shown by the dice such that the sum of no two different sides is i. Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.
['k,n = list(map(int,input().split()))\nmod = 998244353\nfact = [1]*(n+k+1)\nrfact = [1]*(n+k+1)\nfor i in range(1, n+k):\n fact[i] = r = (i * fact[i-1]) % mod\n rfact[i] = pow(r, mod-2, mod)\n\nsave = []\nfor p in range(1,int((k+3)/2)):\n i = 2 * p + 1\n temp = 0\n for t in range(p+1):\n if k-i+t<0:continue\n res = (fact[p] * rfact[t] * rfact[p-t]) % mod\n res *= (fact[n+k-i] * rfact[k-i+t] * rfact[n-t]) % mod\n res *= pow(2,t,mod)\n temp = (temp+res) % mod\n save.append(temp)\n\noutput = save+[save[-1]]+save[::-1]\nfor x in output:\n print(x)', 'k,n = list(map(int,input().split()))\nmod = 998244353\nfact = [1]*(n+k+1)\nrfact = [1]*(n+k+1)\nfor i in range(1, n+k):\n fact[i] = r = (i * fact[i-1]) % mod\n rfact[i] = pow(r, mod-2, mod)\n\nsave = []\nfor p in range(1,int((k+3)/2)):\n i = 2 * p + 1\n temp = 0\n for t in range(min(p+1,n+1)):\n if k-i+t<0:continue\n res = (fact[p] * rfact[t] * rfact[p-t]) % mod\n res *= (fact[n+k-i] * rfact[k-i+t] * rfact[n-t]) % mod\n res *= pow(2,t,mod)\n temp = (temp+res) % mod\n save.append(temp)\noutput = []\ni = 1\nwhile i<k:\n output.append(save[(i-1)//2])\n i+=1\n\nfor x in output+[save[-1]]+output[::-1]:\n print(x)\n\n']
['Wrong Answer', 'Accepted']
['s926788730', 's445780469']
[3732.0, 3608.0]
[1317.0, 1293.0]
[582, 653]
p03270
u968846084
2,000
1,048,576
Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable. For each i=2,3,...,2K, find the following value modulo 998244353: * The number of combinations of N sides shown by the dice such that the sum of no two different sides is i. Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.
['def cmb(n,r):\n if r==0:\n return 1\n elif r==n:\n return 1\n else:\n return A[n]*B[r]*B[n-r]%mod\nmod=998244353\nA=[1,1]\nB=[1,1]\nfor i in range(2,4005):\n A.append(A[-1]*i%mod)\n B.append(B[-1]*pow(i,mod-2,mod)%mod)\nk,n=map(int,input().split())\nif k==1:\n print(0)\n exit()\nans=[0]*(2*k+1)\nfor i in range(2,k+3):\n if i%2==0:\n i=i+1\n ans[i-1]=sum(cmb(n+k-i,k-i+j)*cmb(i//2,j)*pow(2,j,mod) for j in range(min(n+1,i//2+1)))%mod\n else:\n ans[i]=ans[i-1]\nfor i in range(k+2,2*k+1):\n ans[i]=ans[2*k+2-i]\nfor i in range(2,2*k+1):\n print(ans[i])', 'def cmb(n,r):\n if n<0:\n return 0\n if n==1:\n return 1\n elif r<0:\n return 0\n elif r>n:\n return 0\n elif r==0:\n return 1\n elif r==n:\n return 1\n else:\n return A[n]*B[r]*B[n-r]%mod\nmod=998244353\nA=[1,1]\nB=[1,1]\nfor i in range(2,4005):\n A.append(A[-1]*i%mod)\n B.append(B[-1]*pow(i,mod-2,mod)%mod)\nk,n=map(int,input().split())\nif k==1:\n print(0)\n exit()\nans=[0]*(2*k+1)\nfor i in range(2,k+3):\n if i%2==0:\n i=i+1\n for j in range(min(n+1,i//2+1)):\n ans[i-1]=(ans[i-1]+cmb(n+k-i,k-i+j)*cmb(i//2,j)*pow(2,j,mod))%mod\n else:\n ans[i]=ans[i-1]\nfor i in range(k+2,2*k+1):\n ans[i]=ans[2*k+2-i]\nfor i in range(2,2*k+1):\n print(ans[i])', 'def cmb(n,r):\n if n<0:\n return 0\n if n==0:\n if r!=0:\n return 0\n else:\n return 1\n elif r<0:\n return 0\n elif r>n:\n return 0\n elif r==0:\n return 1\n elif r==n:\n return 1\n else:\n return A[n]*B[r]*B[n-r]%mod\nmod=998244353\nA=[1,1]\nB=[1,1]\nfor i in range(2,4005):\n A.append(A[-1]*i%mod)\n B.append(B[-1]*pow(i,mod-2,mod)%mod)\nk,n=map(int,input().split())\nif k==1:\n print(0)\n exit()\nans=[0]*(2*k+1)\nfor i in range(2,k+3):\n if i%2==0:\n i=i+1\n for j in range(min(n+1,i//2+1)):\n ans[i-1]=(ans[i-1]+cmb(n+k-i,k-i+j)*cmb(i//2,j)*pow(2,j,mod))%mod\n else:\n ans[i]=ans[i-1]\nfor i in range(k+2,2*k+1):\n ans[i]=ans[2*k+2-i]\nfor i in range(2,2*k+1):\n print(ans[i])']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s451522050', 's893731743', 's373035084']
[3608.0, 3732.0, 3732.0]
[1178.0, 1544.0, 1542.0]
[621, 733, 773]
p03272
u003501233
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a,b=map(int,input.split())\nprint(a-b+1)', 'N,i=map(int,input.split())\nprint((N-i)+1)', 'a,b=map(int,input.split())\nprint(a+1-b)', 'a,b=int(input.split())\nprint(a-b+1)', 'N,i=map(int,input().split())\nprint(N+1-i)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s206094268', 's219311968', 's752211037', 's891612455', 's067571232']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[39, 41, 39, 35, 41]
p03272
u005324859
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['There is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."', 'n, i = map(int, input().split())\nprint(n-i+1)']
['Runtime Error', 'Accepted']
['s795736424', 's295240969']
[2940.0, 2940.0]
[17.0, 17.0]
[190, 45]
p03272
u013605408
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['print(sum([int(i) for i in input().split()])+1)', 'N,i = input().split(" ")\nN,i = int(N),int(i)\nprint(N - i + 1)']
['Wrong Answer', 'Accepted']
['s997603177', 's751599973']
[2940.0, 2940.0]
[17.0, 18.0]
[47, 61]
p03272
u018679195
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['x= input()\nx = x.split()\nx = list(map(int, x))\nif x[0] == x[1]:\n print(x)\nelse:\n print(x[1] - x[0] + 1)\n', 'n =int(input("enter number of car_train. "))\ni = int(input("enter ith from the front of train . "))\n\nif n == i:\n print (1)\nelse :\n print ((n-i)+1)\n\n\n', 'N=int(input())\ni=int(input())\nj=o\n\nj=N-i+1\n\nprint(j)\n\n', 'inputs = list(map(int, input().split()))\n\n\nprint(inputs[0]-inputs[1]+1)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s124271777', 's767511426', 's840550819', 's488336305']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[110, 156, 54, 72]
p03272
u020604402
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N,i = int(input().split())\nprint(N-i+1)\n', 'N,i = map(int,input().split())\nprint(N-i+1)\n']
['Runtime Error', 'Accepted']
['s534256078', 's707199512']
[2940.0, 2940.0]
[18.0, 17.0]
[40, 44]
p03272
u033524082
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i=map(int,input())\nprint(n+1-i)', 'n,i=map(int,input().split())\nprint(n+1-i)']
['Runtime Error', 'Accepted']
['s740090602', 's021830554']
[2940.0, 2940.0]
[17.0, 17.0]
[33, 41]
p03272
u037221289
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
["N, i = map(int.input().split(' '))\nprint(N-i+1)", "N, i = map(int,input().spkit(' '))\nprint(N-i+1)", "N, i = map(int,input().split(' '))\nprint(N-i+1)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s725109428', 's998252086', 's271884832']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[47, 47, 47]
p03272
u047816928
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N, i = map(int, input())\nprint(N-i+1)', 'N, i = map(int, input().split())\nprint(N-i+1)']
['Runtime Error', 'Accepted']
['s796310370', 's285786612']
[2940.0, 2940.0]
[17.0, 17.0]
[37, 45]
p03272
u048867491
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N, i = list(map(int,input().split()))\nprint(i+1 -N)\n', 'N, i = list(map(int,input().split()))\nprint(N+1 -i)\n']
['Wrong Answer', 'Accepted']
['s226789066', 's951695797']
[2940.0, 2940.0]
[21.0, 17.0]
[52, 52]
p03272
u050622763
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i=map(int,input.split())\nprint(n-i+1)', 'def ABC107_A():\n n,i=map(int,input().split())\n print(n-i+1)\n\nABC107_A()']
['Runtime Error', 'Accepted']
['s192501960', 's285671060']
[9012.0, 9076.0]
[24.0, 32.0]
[39, 77]
p03272
u052347048
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a,b = map(int,input().split())\nprint(b-a+1)', 'a,b=map(int,input().split());print(a-b+1)']
['Wrong Answer', 'Accepted']
['s894521756', 's098426111']
[2940.0, 2940.0]
[17.0, 17.0]
[43, 41]
p03272
u063346608
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N,i = map(int.input().split())\n\nanswer = N - i + 1\n\nprint(answer)', 'N,i = map(int,input().split())\n\nanswer = N - i + 1\n\nprint(answer)']
['Runtime Error', 'Accepted']
['s935329446', 's889314600']
[2940.0, 2940.0]
[17.0, 17.0]
[65, 65]
p03272
u075303794
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i = map(int, input())\nprint(n - i + 1)', 'n,i = map(int, input().split())\nprint(n - i + 1)']
['Runtime Error', 'Accepted']
['s463793387', 's676507786']
[2940.0, 2940.0]
[17.0, 17.0]
[40, 48]
p03272
u076764813
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i=map(int,input().split())\n\nprint(n-i)', 'n,i=map(int,input().split())\n\nprint(n-i+1)']
['Wrong Answer', 'Accepted']
['s191324100', 's738783429']
[2940.0, 2940.0]
[17.0, 17.0]
[40, 42]
p03272
u076894102
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['x = int(input())\ny = int(input())\nif x == y:\n print(y)\nelse:\n print(y - x + 1)', 'n,a=map(int , input().split())\nprint(n-a+1)']
['Runtime Error', 'Accepted']
['s543749775', 's388161583']
[2940.0, 2940.0]
[17.0, 17.0]
[84, 43]
p03272
u089230684
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N= int(input())\ni= int(input())\nj=0\n\nj=N-i+1\n\nprint (j)\n \n', 'N,i=int(input ("enter the number of cars and car ))\nX=N-i+1\nPrint(x)', 'N , i = map( int input( ) )\nx = N - i + 1\nprint ( x )\n', 'N,i=map(int,input().split())\nif 1<=n<=100:\nif 1<=i<=n:\nprint(N-i+1)\n \n', 'N , i = map( int input( ) )\nx = (N - i) + 1\nprint ( x )\n', 'N,i=map(int,input().split())\nlist1=[x+1 for x in range(0,1000)]\nlist2=[y for y in range(1,N+1)]\nif N in list1 and i in list2:\n x=(N-i)+1 \n print(x)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s495127079', 's500112752', 's758246263', 's764072182', 's889160007', 's782434987']
[2940.0, 3064.0, 2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[61, 68, 54, 73, 56, 155]
p03272
u099066216
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[' n, i = map(int, input().split())\n print(n - i + 1)', 'n, i = [int(_) for _ in input().split()]\nprint(n - i + 1)']
['Runtime Error', 'Accepted']
['s233811068', 's703929686']
[2940.0, 2940.0]
[17.0, 18.0]
[57, 57]
p03272
u102242691
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['\nn,i = map(int(input().split()))\nprint((n-i)+1)\n', '\nn,i = map(int,input().split())\nprint((n-i)+1)\n']
['Runtime Error', 'Accepted']
['s544100558', 's630376236']
[2940.0, 2940.0]
[17.0, 17.0]
[48, 47]
p03272
u103657515
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N = int(input())\ni = int(input())\n\nprint(N-i+1)', 'N, i= map(int, input().split())\n\n\nnum = N-i+1\nprint(num)']
['Runtime Error', 'Accepted']
['s867313204', 's963975427']
[2940.0, 2940.0]
[17.0, 17.0]
[47, 56]
p03272
u103730790
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n, i = map(int,input().aplit())\n\nprint(n - i + 1)', 'n, i = map(int,input().split())\nprint(n-i+1)']
['Runtime Error', 'Accepted']
['s556738376', 's916582596']
[2940.0, 2940.0]
[17.0, 18.0]
[49, 44]
p03272
u104005543
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n, i = map(int, input())\nprint(n - i + 1)', 'n, i = map(int, input().split())\nprint(n - i + 1)']
['Runtime Error', 'Accepted']
['s557332385', 's470248426']
[9140.0, 9056.0]
[23.0, 28.0]
[41, 49]
p03272
u107077660
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N, i = map(int, intput().split())\nprint(N-i+1)', 'N, i = map(int, input().split())\nprint(N-i+1)']
['Runtime Error', 'Accepted']
['s747574591', 's127416886']
[2940.0, 2940.0]
[17.0, 17.0]
[46, 45]
p03272
u112567325
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['A,B = list(map(int,input()))\n\nprint(A-B+1)', 'A,B = list(map(int,input().split()))\n\nprint(A-B+1)']
['Runtime Error', 'Accepted']
['s579787926', 's882930286']
[2940.0, 2940.0]
[17.0, 17.0]
[42, 50]
p03272
u118019047
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i = list(map,int(input().split()))\nprint(n-i+1)', 'n,i = list(map(int,input().split()))\nprint(n-i+1)']
['Runtime Error', 'Accepted']
['s414029914', 's751333657']
[2940.0, 2940.0]
[17.0, 17.0]
[49, 49]
p03272
u127499732
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a,b=map(int,input().split())\nprint(b-a-1)', 'a,b=map(int,input().split())\nprint(b-a+1)', 'a,b=map(int,input().split())\nprint(a-b+1)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s820880957', 's979087024', 's784774343']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[41, 41, 41]
p03272
u129978636
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['H, W = map( int, input().split())\n\na = []\nb = []\nc = []\n\nfor i in range(H):\n a1 = input()\n if(\'#\' in a1):\n a.append(a1)\n \n else:\n continue\n\na = list(zip(*a))\nl1 = len(a)\n \nfor j in range(l1):\n b1 = a[j]\n \n if( \'#\' in b1):\n b.append(b1)\n \n else:\n continue\n \nc = list(zip(*b))\nl2 = len(c)\n\nfor n in range(l2):\n print("".join(c[n]))', 'N, i = map( int, input().split())\n\nprint(N - i + 1)']
['Runtime Error', 'Accepted']
['s398243381', 's671278660']
[3064.0, 2940.0]
[18.0, 17.0]
[388, 51]
p03272
u133936772
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
["h, w = map(int, input().split())\n\nll = [list(input()) for _ in range(h)]\nlh = [h for h in ll if '\nlw = zip(*[w for w in zip(*lh) if '#' in w])\n\nfor l in lw:\n print(''.join(l))", 'n, i = map(int,input().split())\nprint(n-i+1)']
['Runtime Error', 'Accepted']
['s266997064', 's474305582']
[3060.0, 2940.0]
[17.0, 17.0]
[184, 44]
p03272
u135572611
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a = int(input())\nb = int(input())\nprint(a - b + 1)', 'a, b = map(int, input().split())\nprint(a - b + 1)']
['Runtime Error', 'Accepted']
['s624094257', 's426910910']
[2940.0, 2940.0]
[17.0, 18.0]
[50, 49]
p03272
u141410514
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a,b=map(int,input.split())\nprint(a-b+1)', 'a,b=map(int,input().split())\nprint(a-b+1)']
['Runtime Error', 'Accepted']
['s214020557', 's406096088']
[2940.0, 2940.0]
[17.0, 18.0]
[39, 41]
p03272
u144980750
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['print(int(input())+1-int(input()))', 'n,i=map(int,input().split())\nprint(1+n-i)']
['Runtime Error', 'Accepted']
['s881952063', 's649833125']
[2940.0, 2940.0]
[18.0, 17.0]
[34, 41]
p03272
u146346223
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['print(int(input)+1-int(input()))', 'n,i=map(int,input().split())\nprint(n+1-i)']
['Runtime Error', 'Accepted']
['s030807258', 's952893999']
[9072.0, 9088.0]
[23.0, 27.0]
[32, 41]
p03272
u160861278
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N, i = map(int, input().split())\nprint(N-i+1))', 'N, i = map(int, input().split())\nprint(N-i+1)']
['Runtime Error', 'Accepted']
['s898684959', 's099208182']
[2940.0, 2940.0]
[17.0, 18.0]
[46, 45]
p03272
u164261323
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['print(int(input())-int(input())+1)', 'print(int(input())-int(input())+1)', 'a,b = map(int,input().split())\nprint(a-b+1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s723498865', 's745140475', 's124685270']
[3316.0, 2940.0, 2940.0]
[21.0, 17.0, 18.0]
[34, 34, 43]
p03272
u175590965
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a,b = map(int,input(),split())\nprint(a-b+1)', 'a,b = map(int,input().split())\nprint(a-b+1)']
['Runtime Error', 'Accepted']
['s264279583', 's842473213']
[2940.0, 2940.0]
[17.0, 17.0]
[43, 43]
p03272
u181469107
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n=int(input())\nnums=[int(x) for x in input().split()]\n\ndef findMedian(nums):\n size=len(nums)\n mIndex = (size*(size+1)//2) + 1\n gap=0\n mValue=0\n while mIndex>0 and gap<size:\n start=0\n end=start+gap\n while end<size and mIndex>0:\n mIndex-=1\n mValue=nums[(start+end+1)//2]\n start+=1\n end+=1\n gap+=1\n return mValue\n\nprint(findMedian(nums))', 'n,i = map(int, input().split())\n\ndef findJ(num):\n return n+1-num;\n\nprint(findJ(i))']
['Runtime Error', 'Accepted']
['s440790854', 's388994816']
[3064.0, 2940.0]
[17.0, 17.0]
[424, 85]
p03272
u186950791
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N , i = list(map(int, input().split()))\nprint(n + 1 -i)', 'N = int(input())\ni = int(input())\nprint(N - i + 1)', 'N, i = list(map(int, input().split()))\nprint(n + 1 - i)\n', 'N , i = list(map(int, input().split()))\nprint(n + 1 - i)\n', 'n, i = list(map(int, input().split()))\nprint(n + 1 - i)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s130333732', 's341901954', 's501213296', 's910685832', 's133349931']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0, 17.0]
[55, 50, 56, 57, 56]
p03272
u190875453
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a, b = map(int, input().split)\nprint(a + 1 - b)', 'a, b = map(int, input().split())\nprint(a + 1 - b)']
['Runtime Error', 'Accepted']
['s922591364', 's429730598']
[2940.0, 2940.0]
[17.0, 17.0]
[47, 49]
p03272
u203995947
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n, i = map(int,input().sprit(" "))\nans = n - i + 1\nprint(ans)', 'n, i = map(int,input().split(" "))\nans = n - i + 1\nprint(ans)\n\n']
['Runtime Error', 'Accepted']
['s923915252', 's679733158']
[2940.0, 2940.0]
[17.0, 17.0]
[61, 63]
p03272
u211160392
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N,i = map(int,input().split())\nprint(N-1+1)', 'N,i = map(int,input().split())\nprint(N-i+1)']
['Wrong Answer', 'Accepted']
['s985405982', 's673243826']
[2940.0, 2940.0]
[17.0, 18.0]
[43, 43]
p03272
u218843509
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a, b = map(int, input().split())\nprint(a + b - 1)', 'a, b = map(int, input().split())\nprint(a + 1 - b)\n']
['Wrong Answer', 'Accepted']
['s200634854', 's840307007']
[2940.0, 2940.0]
[17.0, 17.0]
[49, 50]
p03272
u229621546
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['i = list(map(int,input(),split()))\nprint(i[0] - i[1] + 1)', 'i = list(map(int,input(),split()))\nprint(i[0] - i[1] + 1)', 'i = list(map(int,input().split()))\nprint(i[0] - i[1] + 1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s286360305', 's499093699', 's957022128']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 18.0]
[57, 57, 57]
p03272
u244836567
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a,b=input().split()\nprint(int(a-b+1))', 'a,b=input().split\nprint(int(a-b+1))', 'a,b=input().split()\na=int(a)\nb=int(b)\nprint(int(a-b+1))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s194729210', 's352173336', 's302563852']
[8868.0, 8868.0, 9080.0]
[24.0, 21.0, 32.0]
[37, 35, 55]
p03272
u246820565
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i = int(input())\nprint(n-(i-1))', 'n,i = map(int,input().split())\nprint(n-(i-1))\n']
['Runtime Error', 'Accepted']
['s568342977', 's330755265']
[2940.0, 2940.0]
[17.0, 17.0]
[33, 46]
p03272
u251252118
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['A = [int(i) for i in input().split(" ")]\nans = A[0] + A[1] -1\n\nprint(ans)', 'A = [int(i) for i in input().split(" ")]\nans = A[0] + A[1] + 1\n\nprint(ans)\n', 'A = [int(i) for i in input().split(" ")]\nans = A[0] - A[1] + 1\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s164925485', 's290663893', 's308492360']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[73, 75, 75]
p03272
u252210202
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N,i=map(int,input().split())\nprint(N-(i+1))', 'N, i = map(int, input().split())\nprint(N-i+1)']
['Wrong Answer', 'Accepted']
['s450968034', 's775779185']
[2940.0, 2940.0]
[17.0, 17.0]
[43, 45]
p03272
u266874640
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N,i = map(int, input().split())\nprint(int(N - i))\n', 'N,i = map(int, input().split())\nprint(int(N - i + 1))\n']
['Wrong Answer', 'Accepted']
['s681015940', 's795609781']
[2940.0, 2940.0]
[17.0, 17.0]
[50, 54]
p03272
u275934251
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N , i = map(int, input())\n\nprint(N - i + 1)', 'N , i = map(int, input().split())\n\nprint(N - i + 1)']
['Runtime Error', 'Accepted']
['s260328687', 's983956246']
[3316.0, 2940.0]
[19.0, 17.0]
[43, 51]
p03272
u294385082
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n,i = map(int(),input().split())\nprint(n-i+1)', 'n,i = map(int,input().split())\nprint(n-i+1)']
['Runtime Error', 'Accepted']
['s582405519', 's271603606']
[2940.0, 2940.0]
[17.0, 18.0]
[45, 43]
p03272
u295457032
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N=int(input())\ni=int(input())\nprint(N-i+1)', 'N=int(input())\ni=int(input())\nprint(N-i+1)\n', 'N,i=map(int, input().split())\nprint(N-i+1)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s280177036', 's496912846', 's201214071']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[42, 43, 43]
p03272
u298892458
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['a = input().split(" ")\nprint(int(a[1])-int(a[0])+1)', 'a = input().split(" ")\nprint(int(a[0])-int(a[1])+1)']
['Wrong Answer', 'Accepted']
['s514915606', 's386299291']
[2940.0, 2940.0]
[17.0, 17.0]
[51, 51]
p03272
u319818856
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['def train(N: int, i: int)->int:\n return N - i - 1\n\n\nif __name__ == "__main__":\n N, i = map(int, input().split())\n ans = train(N, i)\n print(ans)\n', 'def train(N: int, i: int)->int:\n return N - i + 1\n\n\nif __name__ == "__main__":\n N, i = map(int, input().split())\n ans = train(N, i)\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s882016630', 's643736990']
[2940.0, 2940.0]
[18.0, 17.0]
[156, 156]
p03272
u322354465
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['n, i = map(int, input().split())\n\nprint(n - i + 1)\u3000', 'n, i = map(int, input().split())\n\nprint(n - i + 1)']
['Runtime Error', 'Accepted']
['s534115813', 's277716153']
[2940.0, 2940.0]
[17.0, 17.0]
[53, 50]
p03272
u325119213
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['def actual(n, i):\n return n - i + 1\n\nn, i = map(int, input())\nprint(actual(n, i))', 'def actual(n, i):\n return n - i + 1\n\nn, i = map(int, input().split())\nprint(actual(n, i))\n']
['Runtime Error', 'Accepted']
['s366346326', 's079468543']
[2940.0, 2940.0]
[17.0, 17.0]
[84, 93]
p03272
u333190709
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N, i = [int(n) for n in range(2)]\n\nprint(N + 1 - i)', 'N, i = [int(n) for n in input().split()]\n\nprint(N + 1 - i)']
['Wrong Answer', 'Accepted']
['s482869407', 's147117962']
[2940.0, 2940.0]
[18.0, 18.0]
[51, 58]
p03272
u346028292
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N,i=map(int,input())\n\na=(N-i+1)\n\nprint(a)', 'N,i=map(int,input().split())\n\na=(N-i+1)\n\nprint(a)\n']
['Runtime Error', 'Accepted']
['s655901934', 's884795488']
[2940.0, 2940.0]
[17.0, 17.0]
[41, 50]
p03272
u349091349
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['N, i =int(input().split())\nprint(N-i+1)', 'N, i =map(int,input().split())\nprint(N-i+1)']
['Runtime Error', 'Accepted']
['s987581322', 's014032443']
[2940.0, 2940.0]
[17.0, 17.0]
[39, 43]
p03272
u353919145
2,000
1,048,576
There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
['x = int(input())\ny = int(input())\nif x ==y :\n print(y)\nelse:\n print(y-x+1)', 'N, i = map(int, input("N i").split())\nj = N - i +1\nprint(j)\n', 'n,i=int(input("enter the numbers"))\nx=n-i+1\nPrint("the result")\nprint(x)', 'x = int(input())\ny = int(input())\nif x == y:\n print(y)\nelse:\n print(y - x + 1)\n', 'N= int(input())\ni= int(input())\n\nprint (N-i+1)\n \n', 'N = int(input("enter the number of cars: "))\ni = int(input("enter the front of the train "))\nif (1<=N and N<=100) or (1<=i and i<=N):\n i = N - i +1\n print(i)\n', 'totalnumber,numberfromfront=map(int, input().split())\nnumberfromback=totalnumber-numberfromfront+1\nprint(j)', 'a,b=map(int,input().split())\nprint(a+1-b)\n#Source code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 characters']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s016913384', 's231783662', 's371812147', 's410442106', 's648745368', 's711491460', 's781279448', 's382047318']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0]
[80, 61, 72, 85, 52, 165, 107, 466]