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
p02682
u443854804
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\n\nif a>=k:\n d=k\nelif a<k and a+b>=k:\n d=k\nelif a+b<k:\n d=a-(k-a-b)\n\nprint(d)\n', 'a,b,c,k=map(int,input().split())\n\nif a>=k:\n d=k\nelif a<k and a+b>=k:\n d=a\nelif a+b<k:\n d=a-(k-a-b)\n\nprint(d)\n']
['Wrong Answer', 'Accepted']
['s534125562', 's222021623']
[8996.0, 9164.0]
[22.0, 19.0]
[118, 118]
p02682
u444481227
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\n\ns=-1*K*C\n\nlc=[]\nlc_=[]\nfor i in range(min(K,A+1):\n for j in range(min(K-i+1,B+1)):\n lc.append([i,j,K-i-j])\n\n#print(lc)\n\nfor i in range(len(lc)):\n if lc[i][0]<=A and lc[i][1]<=B and lc[i][2]<=C:\n # print(lc[i])\n s=max(s, lc[i][0]-lc[i][2])\n\nprint(s)\n', 'A,B,C,K = map(int,input().split())\n\ns=-1*K*C\n\nlc=[]\nlc_=[]\nfor i in range(K+1):\n for j in range(K-i+1):\n lc.append([i,j,K-i-j])\n\n#print(lc)\n\nfor i in range(len(lc)):\n if lc[i][0]<=A and lc[i][1]<=B and lc[i][2]<=C:\n print(lc[i])\n s=max(s, lc[i][0]-lc[i][2])\n\nprint(s)\n', 'A,B,C,K = map(int,input().split())\n\nif A+B<K:\n print(A-(K-A-B))\nelse:\n print(min(A, K))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s196446537', 's791234391', 's292467520']
[8888.0, 607976.0, 9168.0]
[22.0, 2222.0, 23.0]
[296, 279, 89]
p02682
u446785233
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A , B , C , K = int(input())\nif K <= A + B:\n print(K)\nelse:\n print(A * 2 + B - K)', 'if K <= A:\n print(K)\nif A < K <= A + B:\n print(A)\nif A + B < K <= A + B + C:\n print(A * 2 + B - K)', 'A = map(int(input()))\nB = map(int(input()))\nC = map(int(input()))\nK = map(int(input()))\nif K <= A + B:\n print(K)\nelse:\n print(A * 2 + B - K)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\nif K <= A + B:\n print(K)\nelse:\n print(A * 2 + B - K)', 'import math\nif K <= A:\n print(K)\nif A < K <= A + B:\n print(A)\nif A + B < K <= A + B + C:\n print(A * 2 + B - K)', 'input()\nif K <= A + B:\n print(K)\nelse:\n print(A * 2 + B - K)', 'if K <= A + B:\n print(K)\nelse:\n print(A * 2 + B - K)', 'int(input())\nif K <= A + B:\n print(K)\nelse:\n print(A * 2 + B - K)', 'import math\nA, B, C, K = list(map(int, input().split()))\nif K <= A:\n print(K)\nif A < K <= A + B:\n print(A)\nif A + B < K <= A + B + C:\n print(A * 2 + B - K)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s135093952', 's254096308', 's288671230', 's507569427', 's521925883', 's607006263', 's659263426', 's726564366', 's144616167']
[9020.0, 9096.0, 9184.0, 9168.0, 9064.0, 9096.0, 9112.0, 9092.0, 9188.0]
[24.0, 23.0, 21.0, 23.0, 21.0, 21.0, 22.0, 24.0, 19.0]
[83, 101, 142, 122, 113, 62, 54, 67, 158]
p02682
u449580152
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\nif k <= a:\n print(k)\nif a < k <= a + b:\n print(a)\nifa + b < k:\n d = 2*a + b - k\n print(d)', 'a, b, c, k = map(int, input().split())\nif k <= a:\n print(k)\nif a < k <= a + b:\n print(a)\nif a + b < k:\n d = 2*a + b - k\n print(d)']
['Runtime Error', 'Accepted']
['s476147341', 's420218426']
[9020.0, 9172.0]
[20.0, 21.0]
[140, 141]
p02682
u450221211
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K=map(int,input().split())\n\nif A>=K:print(K)\nelif A+B>=K:print(K)\nelse: print(A-(K-(B+A)))', 'A,B,C,K=map(int,input().split())\n\nif A>=K:print(K)\nelif A+B>=K:print(A)\nelse: print(A-(K-(B+A)))\n']
['Wrong Answer', 'Accepted']
['s141816611', 's367117048']
[9172.0, 9100.0]
[21.0, 24.0]
[96, 97]
p02682
u460745860
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int, input().split())\n\nif A+B >= K:\n print(K)\nelse:\n print(A-(K-A-B))\n', 'A, B, C, K = map(int, input().split())\n\nans = 0\nif A >= K:\n print(K)\n exit()\nelse:\n ans += A\n K -= A\n if B >= K:\n print(ans)\n exit()\n else:\n K -= B\n ans -= K\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s093377642', 's655242468']
[9016.0, 9084.0]
[29.0, 26.0]
[93, 223]
p02682
u465652095
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int,input().split())\nif K <= A:\n print(K)\nelif K <= A + B:\n print(K)\nelse:\n print(A + C*-1*(K-A-B))', 'A, B, C, K = map(int,input().split())\nprint(max(A*1*K + B*0*(K-A) + C*-1*(K-A-B)))', 'A, B, C, K = map(int,input().split())\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n print(A + -1*(K-A-B))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s443124730', 's572008390', 's030488567']
[9148.0, 9160.0, 9108.0]
[23.0, 22.0, 19.0]
[125, 82, 123]
p02682
u469685228
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k=input().split()\na=int(a)\nb=int(b)\nc=int(c)\nk=int(k)\nans=0\n\nif a>0 and k>0 and a<=k:\n k=k-a\n ans=ans+a\nelif a>0 and k>0 and a>k:\n ans=ans+k\n k=0\n\nwhile b>0 and k>0:\n b+=-1\n k+=-1\n\nwhile c>0 and k>0:\n ans+=-1\n c+=-1\n k+=-1\n \nprint(ans)', 'a, b, c, k=input().split()\na=int(a)\nb=int(b)\nc=int(c)\nk=int(k)\nans=0\n\nif a>0 and k>0 and a<=k:\n k=k-a\n ans=ans+a\nelif a>0 and k>0 and a>k:\n ans=ans+k\n k=0\n\nif b>0 and k>0 and b<=k:\n k=k-b\nelif b>0 and k>0 and b>k:\n k=0\n \nif c>0 and k>0 and c<=k:\n k=k-c\n ans=ans-c\nelif c>0 and c>0 and c>k:\n ans=ans-k\n k=0\n\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s343552533', 's074584363']
[9048.0, 9256.0]
[23.0, 24.0]
[255, 331]
p02682
u469936642
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\ns = min(c, k)\nk -= s\nif k == 0:\n\tprint(s)\nelse:\n\td = min(k, b)\n\tk -= d:\n\tif k == 0:\n\t\tprint(s)\n\telse:\n\t\tf = min(k, a)\n\t\ts -= f\n\t\tprint(s)', 'c, b, a, k = map(int, input().split())\ns = min(c, k)\nk -= s\nif k == 0:\n\tprint(s)\nelse:\n\td = min(k, b)\n\tk -= d\n\tif k == 0:\n\t\tprint(s)\n\telse:\n\t\tf = min(k, a)\n\t\ts -= f\n\t\tprint(s)\n\n']
['Runtime Error', 'Accepted']
['s297013672', 's832785629']
[9036.0, 9184.0]
[24.0, 24.0]
[176, 177]
p02682
u479937725
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\nans = 0\n\nif A<=K:\n ans+=A*1\nelse:\n ans+=K*1\n\nK=max(K-A+B,0)\n \nans+=K*(-1)\n\nprint(ans)', 'A,B,C,K = map(int,input().split())\nans = 0\n\nif K<A:\n ans+=K\n print(ans)\n exit()\nelse:\n ans+=A\n K-=A\n \nif K<B:\n print(ans)\n exit()\nelse:\n K-=B\n \nif K<C:\n ans+=K*(-1)\n print(ans)\nelse:\n ans+=C*(-1)\n print(ans)']
['Wrong Answer', 'Accepted']
['s385204761', 's583704598']
[8960.0, 9216.0]
[31.0, 29.0]
[123, 221]
p02682
u483748949
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = list(map(int, input().split()))\ns = 0\n\nif k >= a:\n s = a\nif (k - a - b) >= 0:\n s -= k - a - b', 'a, b, c, k = list(map(int, input().split()))\ns = 0\n\nif k >= a:\n s = a\nelse:\n s = k\nif (k - a - b) >= 0:\n s -= k - a - b\n\nprint(s)\n']
['Wrong Answer', 'Accepted']
['s455005262', 's644710765']
[9128.0, 9148.0]
[24.0, 23.0]
[112, 139]
p02682
u485819963
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int,input().split())\n\nif K - A - B <= 0:\n print((1 * A) - (1 * C))\n\nelif K - A >= 0 and K - A - B < 0:\n print((1 * A))\n\nelif K - A >= 0:\n print(1 * K)\n', 'A, B, C, K = map(int,input().split())\n\nif K - A - B <= 0:\n print((1 * A) - (1 * C))\n\nelif K - A <= 0:\n print((1 * A))\n\n\nelif K - A >= 0:\n print(1 * K)\n\n\n\n\n\n\n\n', 'A, B, C, K = map(int,input().split())\n\nif K - A - B > 0:\n print(1 * A - (K - A - B) * 1)\n\nelif K - A < 0:\n print(1 * K)\n\nelse K - A - B <= 0:\n print(1 * A)\n\n', 'A, B, C, K = map(int,input().split())\n\nif K - A - B > 0:\n print(1 * A - (K - A - B) * 1)\n\nelif K - A < 0:\n print(1 * K)\n\nelif K - A - B <= 0:\n print(1 * A)\n\n\n\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s284289185', 's475424678', 's695419083', 's972533224']
[9084.0, 9112.0, 9008.0, 9108.0]
[28.0, 27.0, 32.0, 29.0]
[177, 167, 166, 168]
p02682
u486297080
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\n\ncount = 0\n\nif K >= A:\n count = K\nelse:\n for i in range(K):\n if A > 0:\n count += 1\n A -= 1\n elif B > 0:\n B -= 1\n else:\n count -=1\n C -= 1\n\nprint(count)', 'A,B,C,K = map(int,input().split())\n\ncount = 0\n\nif K <= A:\n count = K\nelif K - A <= B:\n count = A\nelse:\n count = A - (K-A-B)\n\nprint(count)']
['Wrong Answer', 'Accepted']
['s287111559', 's774679548']
[9172.0, 9160.0]
[2205.0, 23.0]
[268, 146]
p02682
u486773779
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['\na, b, c, k = map(int, input().split())\n\n\nif( a+b >= k ):\n max = k\n\nelif( a+b <= k ):\n max = a - ( k - a - b )\n\nelse:\n sys.exit(1)\n\n\nprint(max)', '\na, b, c, k = map(int, input().split())\n\n\nif a >= k :\n max = k\n\nelif a+b >= k :\n max = a\n\nelif( a+b <= k ):\n max = a - ( k - a - b )\n\n\nprint(max)']
['Wrong Answer', 'Accepted']
['s062389791', 's932101848']
[9116.0, 9040.0]
[21.0, 22.0]
[273, 275]
p02682
u493877578
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\nsum = 0\nif k >= a + b + c:\n print(a + b + c)\nif a + b + c > k >= b + a:\n k = k - (a + b)\n print(a - k)\nif b + a > k >= a:\n print(a)\nif a > k:\n print(k)\n ', 'a, b, c, k = map(int, input().split())\nif a + b + c >= k >= a + b:\n u = k - (a + b)\n print(a - u)\nif a + b > k >= a:\n print(a)\nif a > k:\n print(k)\n \n']
['Wrong Answer', 'Accepted']
['s263413689', 's706849079']
[9128.0, 9168.0]
[21.0, 23.0]
[200, 155]
p02682
u494295478
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K=input().split()\nA=int(A)\nB=int(B)\nC=int(C)\nK=int(K)\n\nif A>=K:\n print(1*K)\nelif A+B>=K :\n print(1)\nelse:\n print((A*1)+(B*0)+((K-B-A)*(-1)))', 'A,B,C,K=input().split()\nA=int(A)\nB=int(B)\nC=int(C)\nK=int(K)\n\nif A>=K:\n print(1*K)\nelif A+B>=K :\n print(K-B)\nelse:\n print((A*1)+(B*0)+((K-B-A)*(-1)))']
['Wrong Answer', 'Accepted']
['s976244220', 's450660748']
[9108.0, 9192.0]
[23.0, 25.0]
[155, 157]
p02682
u496157893
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = input().split()\na = int(A)\nb = int(B)\nk = int(K)\n\nB_number = 0\nC_number = 0\n\nA_number = min(a,k)\nk1 = k - a\nif k1 > 0:\n B_number = min(b,k1)\n k2 = k1 - b\n if k2 > 0:\n C_number = min(c,k2)\n\nprint(A_number-C_number)', 'A,B,C,K = input().split()\na = int(A)\nb = int(B)\nc = int(C)\nk = int(K)\n\nB_number = 0\nC_number = 0\n\nA_number = min(a,k)\nk1 = k - a\nif k1 > 0:\n B_number = min(b,k1)\n k2 = k1 - b\n if k2 > 0:\n C_number = min(c,k2)\n\nprint(A_number-C_number)']
['Runtime Error', 'Accepted']
['s116017966', 's509366305']
[9044.0, 9092.0]
[20.0, 21.0]
[235, 250]
p02682
u504194367
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['card = list(map(int, input().split()))\na = list()\nb = list()\nc = list()\nlist = list()\nresult = 0\n\nfor i in range(card[0]):\n a.append(1)\nfor i in range(card[1]):\n b.append(0)\nfor i in range(card[2]):\n c.append(-1)\n\nfor i in a:\n list.append(i)\nfor i in b:\n list.append(i)\nfor i in c:\n list.append(i)\nprint(list)\n\nfor i in range(card[3]):\n result += list[i]\nprint(result)', 'card = list(map(int, input().split()))\nlist = list()\nresult = 0\n\nif card[3] <= card[0]:\n result = card[3]\nelif card[0] < card[3] and card[3] <= card[1]:\n result = card[0]\nelse:\n result = card[0] - (card[3] - (card[0] + card[1]))\n\nprint(result)']
['Wrong Answer', 'Accepted']
['s986911019', 's306111347']
[244348.0, 9212.0]
[2211.0, 22.0]
[375, 246]
p02682
u505547600
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K=input().split()\nres=0\nif int(K) < int(A):\n \t\tres=1*int(A)\nelif int(K)-int(A)-int(B)>0:\n \tres-=1*(int(K)-int(A)-int(B)) \n\nprint(res)', 'A,B,C,K=input().split()\nres=0\ncnt=0\nif int(K)-int(A)<=0:\n \t\tres=1*int(K)\nelse:\n \t\tres=1*int(A)\ncnt=int(K)-int(A)-int(B)\nif cnt>0:\n res-=1*cnt\nprint(res)']
['Wrong Answer', 'Accepted']
['s983641187', 's232583503']
[9184.0, 9076.0]
[23.0, 23.0]
[149, 161]
p02682
u507145838
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['#-*-coding:utf-8-*-\na,b,c,k = map(int, input().split())\nsum = 0\n\nif a > k:\n sum = a \nelif (a + b) < k:\n sum = a \nelse:\n sum = a + b - (k - a - b)\n \nprint(sum)', '#-*-coding:utf-8-*-\nA, B, C, K = map(int, input().split())\nsum = 0\nif K >= A+B:\n sum = A - (K-A-B)\nelse:\n sum = K\n \nprint(sum)']
['Wrong Answer', 'Accepted']
['s347600749', 's956068081']
[9172.0, 9168.0]
[24.0, 22.0]
[162, 131]
p02682
u508061226
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split());\n\nif a > k:\n print(k)\n break;\nelse:\n num = a; \n \n if k >= a + b:\n num -= k - (a + b);\n print(num)', 'a, b, c, k = map(int, input().split());\n\nif a > k:\n print(k)\n break;\nelse:\n num = a; \n \n if k >= a + b:\n num -= k - (a + b);\n\nprint(num)\n \n \n', 'a, b, c, k = map(int, input().split());\n\nif a > k:\n print(k)\nelse:\n num = a; \n \n if k >= a + b:\n num -= k - (a + b);\n print(num)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s303360593', 's977157490', 's735248003']
[8700.0, 9024.0, 9160.0]
[25.0, 24.0, 22.0]
[143, 149, 139]
p02682
u510956234
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nprint(A-1*(K-A-B) if K >A+B else A)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K >A+B :\n print(A-(K-A-B))\nelse :\n print(A)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\nS = A + B + C\n\nif A >=K or A + B >=K:\n print(A)\nelse :\n print(A-1*(K-A-B))', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K >A+B :\n print(2*A-K+B)\nelse :\n print(A)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\nS = A + B + C\n\nif A >=K :\n print(1*A)\nelif A + B >=K :\n print(1*A + 0*B)\nelse :\n print(1*A + 0*B -1*(K-A-B))', 'A,B,C,K = map(int,input().split())\nprint(A-1*(K-A-B) if K >A+B else K)', 'A,B,C,K = map(int,input().split())\n\nif K >A+B:\n print(A-1*(K-A-B))\nelif A > K :\n print(K)\nelse :\n print(A)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s289302562', 's302325516', 's316943504', 's495580675', 's510634892', 's527533063', 's026945014']
[9168.0, 9080.0, 9180.0, 9168.0, 8936.0, 9160.0, 9080.0]
[21.0, 22.0, 22.0, 23.0, 24.0, 22.0, 22.0]
[104, 117, 144, 115, 179, 70, 109]
p02682
u514894322
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nl = [1]*a + [0]*b + [-1]*c\nprint(sum(l[:k])', 'a,b,c,k = map(int,input().split())\nprint(min([a,k])-max([0,k-a-b]))']
['Runtime Error', 'Accepted']
['s142461650', 's660830932']
[8988.0, 9144.0]
[25.0, 26.0]
[78, 67]
p02682
u522293645
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['\nif k<a:\n print(k)\nelif a<=k and k<=a+b:\n print(a)\nelif a+b<k and k<a+b+c:\n print(a-(k-a-b))\nelse:\n print(a-c)', 'a,b,c,k = map(int,input().split())\n\nif k<a:\n print(k)\nelif a<=k and k<=a+b:\n print(a)\nelif a+b<k and k<a+b+c:\n print(a-(k-a-b))\nelse:\n print(a-c)']
['Runtime Error', 'Accepted']
['s521970320', 's214883092']
[9100.0, 9112.0]
[24.0, 21.0]
[114, 149]
p02682
u522973286
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["#!/usr/bin/env python3\n\n\ndef main() -> None:\n A, B, C, K = rmi()\n sum_ = 0\n if A > K:\n sum_ += A\n K -= A\n else:\n sum_ += K\n K = 0\n if B > K:\n K -= B\n if 0 < K:\n sum -= K\n w(sum_)\n\n\ndef r() -> str:\n return input().strip()\n\n\ndef ri() -> int:\n return int(r())\n\n\ndef rmi(delim: str = ' ') -> tuple:\n return tuple(map(int, input().split(delim)))\n\n\ndef w(data) -> None:\n print(data)\n\n\ndef wm(*data, delim: str = ' ') -> None:\n print(delim.join(map(str, data)))\n\n\nif __name__ == '__main__':\n import sys\n sys.setrecursionlimit(10 ** 9)\n main()\n", "#!/usr/bin/env python3\n\n\ndef main() -> None:\n A, B, C, K = rmi()\n sum_ = 0\n if A < K:\n sum_ += A\n K -= A\n else:\n sum_ += K\n K = 0\n if B < K:\n K -= B\n else:\n K = 0\n if 0 < K:\n sum_ -= K\n w(sum_)\n\n\ndef r() -> str:\n return input().strip()\n\n\ndef ri() -> int:\n return int(r())\n\n\ndef rmi(delim: str = ' ') -> tuple:\n return tuple(map(int, input().split(delim)))\n\n\ndef w(data) -> None:\n print(data)\n\n\ndef wm(*data, delim: str = ' ') -> None:\n print(delim.join(map(str, data)))\n\n\nif __name__ == '__main__':\n import sys\n sys.setrecursionlimit(10 ** 9)\n main()\n"]
['Wrong Answer', 'Accepted']
['s762590254', 's820706111']
[9216.0, 9220.0]
[24.0, 23.0]
[623, 648]
p02682
u523910497
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = input().split()\nif A > K:\n print(K)\nelif A+B > K:\n print(A)\nelse:\n print(2*A + B - K)', 'A,B,C,K = input().split()\nif A >= K:\n print(K)\nelif A+B >= K:\n print(A)\nelse:\n print(A + A + B - K)', 'A,B,C,K = input().split()\nif int(A) >= int(K):\n print(K)\nelif int(A)+int(B) >= int(K):\n print(A)\nelse:\n print(int(A) + int(A) + int(B) - int(K))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s516343849', 's599056947', 's039058261']
[9036.0, 9096.0, 9040.0]
[23.0, 24.0, 22.0]
[98, 102, 147]
p02682
u524534026
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['import sys\nimport math\na,b,c,k=map(int,input().split())\nif a<=k:\n print(k)\nelif a>=k:\n print(a)\n sys.exit()\nelif a+b>=k:\n print(a)\n sys.exit()\nelse:\n if c>k-(a+b):\n s=k-(a+b)\n print(a+(s*(-1)))\n sys.exit()\n else:\n print(a+(c*(-1)))\n', 'import sys\nimport math\na,b,c,k=map(int,input().split())\nif a>k:\n print(k)\nelif a+b>=k or a>=k:\n print(a)\nelif c>(k-(a+b)):\n s=k-(a+b)\n print(a-1*s)\nelse:\n print(a-c)']
['Wrong Answer', 'Accepted']
['s468020963', 's158183747']
[9184.0, 9184.0]
[22.0, 23.0]
[281, 180]
p02682
u525882286
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['sum = 0\nif K>0:\n if A>0:\n if A>K:\n sum = sum + K\n else:\n sum = sum + A\n K = K - A\nif K > 0:\n if B>0:\n K = K - B\nif K > 0:\n if C>0:\n sum = sum + K * (-1)\nprint(sum)', 'a, b, c, k = map(int, input().split())\nans = 0\nif k <= a:\n print(k)\nelse:\n k -= a\n ans += a\n if k <= b:\n print(ans)\n else:\n k -= b\n ans += -1 * k\n print(ans)']
['Runtime Error', 'Accepted']
['s999484077', 's969396559']
[9116.0, 9140.0]
[21.0, 24.0]
[225, 200]
p02682
u527616458
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int, input().split())\nif a>=k:\n print(k)\nelif a+b>=k:\n print(k)\nelse:\n l = k-a-b\n print(a - (c*l))', 'a,b,c,k = map(int, input().split())\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelse:\n l = k-a-b\n print(a - l)']
['Wrong Answer', 'Accepted']
['s906902198', 's315877929']
[9152.0, 9168.0]
[22.0, 23.0]
[116, 112]
p02682
u536600145
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int,input().split())\n\nif K <= A:\n print(A)\nelif K <= A+B:\n print(A)\nelse:\n print(2A+B-K)\n', 'A, B, C, K = map(int,input().split())\n\nif K <= A:\n print(K)\nelif K<=A+B:\n print(A)\nelse:\n print(A+(K-(A+B))*(-1))\n']
['Runtime Error', 'Accepted']
['s843768635', 's506923117']
[9020.0, 9056.0]
[23.0, 21.0]
[115, 123]
p02682
u537217069
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = list(map(int, input().split()))\n\nif( A + B >= K ):\n if(A >= K):\n print(A)\n else:\n print(K)\nelse:\n print(+1*A -1*(K-(A+B)))\n', 'A, B, C, K = list(map(int, input().split()))\n\nif( A + B >= K ):\n if(A >= K):\n print(K)\n else:\n print(A)\nelse:\n print(+1*A -1*(K-(A+B)))\n']
['Wrong Answer', 'Accepted']
['s533678685', 's818121027']
[9076.0, 9072.0]
[26.0, 28.0]
[159, 159]
p02682
u543489264
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['from sys import stdin\n\nA, B, C, K = map(int, stdin.readline().rstrip().split())\nres = int(0)\n\ndef f(p, n, k, res):\n if k - n > 0:\n return k - n, p * (k - n) + res\n else:\n return 0, p * k + res\n\n\nnokori, res = f(1, A, K, res)\nnokori, res = f(0, B, K, res)\nnokori, res = f(-1, C, K, res)\nprint(res)', 'from sys import stdin\n\nA, B, C, K = map(int, stdin.readline().rstrip().split())\nres = int(0)\n\ndef f(p, n, k, res):\n if (k - n) >= 0:\n return k - n, p * (k - n) + res\n else:\n return 0, p * k + res\n\n\nK, res = f(1, A, K, res)\nK, res = f(0, B, K, res)\n_, res = f(-1, C, K, res)\nprint(res)', 'from sys import stdin\n\nA, B, C, K = map(int, stdin.readline().rstrip().split())\nres = int(0)\n\ndef f(p, n, k, res):\n if (k - n) > 0:\n return k - n, p * (k - n) + res\n else:\n return 0, p * k + res\n\n\nK, res = f(1, A, K, res)\nK, res = f(0, B, K, res)\n_, res = f(-1, C, K, res)\nprint(res)', 'from sys import stdin\n\nA, B, C, K = map(int, stdin.readline().rstrip().split())\nres = int(0)\n\ndef f(p, n, k, res):\n if (k - n) >= 0:\n return k - n, p * n + res\n else:\n return 0, p * k + res\n\n\nK, res = f(1, A, K, res)\nK, res = f(0, B, K, res)\n_, res = f(-1, C, K, res)\nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s043814772', 's044323747', 's215963042', 's753017463']
[9200.0, 9148.0, 9208.0, 9204.0]
[23.0, 24.0, 22.0, 24.0]
[316, 304, 303, 298]
p02682
u544272759
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\nresult = 0\nt = min(a,k)\nresult += 1\nk -= 1\nt = min(b,k)\nk -= 0\nt = min(c,k)\nresult -= 1\nprint(result)', 'A, B, C, K = map(int, input().split())\nif A >= K:\n print(K)\nelse if A+B >= K:\n print(A)\nelse:\n print(A-(K-A-B))', 'A,B,C,K=map(int, input().split())\nif A >= K:\n print(K)\nelse if A+B >= K:\n print(A)\nelse:\n print(A-(K-A-B))', 'A, B, C, K = map(int, input().split())\nif K <= A:\n print(K)\nelse if A+B >= K:\n print(A)\nelse:\n print(A-(K-A-B))', 'A, B, C, K = map(int, input().split())\n\nresult = 0\nt = min(A, K)\nresult += t\nK -= t\nt = min(B, K)\nK -= t\nt = min(C, K)\nresult -= t\nprint(result)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s032153474', 's170647265', 's582497435', 's655771697', 's629376606']
[9124.0, 9020.0, 9024.0, 8908.0, 9068.0]
[22.0, 22.0, 23.0, 20.0, 20.0]
[140, 114, 109, 114, 144]
p02682
u546236742
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['text_list = input().split()\nn = 0\nfor i in range(str(text_list[3])):\n if i >= int(text_list[0]):\n n += 1\n elif i >= int(text_list[0]) + int(text_list[1]):\n pass\n elif i >= int(test_list[0]) + int(text_list[1]) + int(text_list[2]):\n n -= 1\n \nprint(n)\n', 'text_list = input().split()\nn = 0\ncount = 0\na = int(text_list[0])\nb = a + int(text_list[1])\nc = b + int(text_list[2])\nmax = int(text_list[3])\n\nif max < b:\n n = a\nelse:\n n = a - c\n\nprint(n)', 'text_list = input().split()\nn = 0\na = int(text_list[0])\nb = a + int(text_list[1])\nc = b + int(text_list[2])\nfor i in range(int(text_list[3])):\n if i < int(text_list[0]) + int(text_list[1]):\n continue\n elif i < int(text_list[0]):\n n += 1\n elif i < int(text_list[0]) + int(text_list[1]) + int(text_list[2]):\n n -= 1\n\nprint(n)', 'text_list = input().split()\nn = 0\na = int(text_list[0])\nb = int(text_list[0]) + int(text_list[1])\nc = int(text_list[0]) + int(text_list[1]) + int(text_list[2])\nfor i in range(int(text_list[3])):\n if i a:\n n += 1\n elif i b:\n continue\n elif i c:\n n -= 1\n\nprint(n)', 'a, b, c, d = map(int, input().split())\nif d <= a:\n print(d)\nelif d <= a + b:\n print(a)\nelse:\n print(a-(d-(a+b)))']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s162845800', 's358969723', 's539879291', 's938255027', 's094134954']
[9120.0, 9088.0, 9196.0, 8956.0, 9168.0]
[22.0, 21.0, 2205.0, 23.0, 29.0]
[265, 194, 353, 291, 115]
p02682
u547764399
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['import sys\na,b,c,k = map(int,input().split())\nsumcheck = 0\ncount = 0\nfor i in range(0,a):\n sumcheck += 1\n count += 1\n if count >= k:\n sys.exit()\nfor i in range(0, b):\n count += 1\n if count >= k:\n sys.exit()\nfor i in range(0, c):\n sumcheck -= 1\n count += 1\n if count >= k:\n sys.exit()\n\nprint(sumcheck)', 'a,b,c,k=map(int,input().split())\n\nif k <= a:\n print(k)\nelif k <= (a+b):\n print(a)\nelse:\n print(a-(k-a-b))']
['Wrong Answer', 'Accepted']
['s911910684', 's701485106']
[9208.0, 9168.0]
[2205.0, 20.0]
[345, 108]
p02682
u549494450
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['abcx = input().split(" ")\na = int(abcd[0])\nb = int(abcd[1])\nc = int(abcd[2])\nx = int(abcd[3])\nif x <= a:\n print(x)\nelif x <= a + b:\n print(a)\nelse:\n print(2*a + b - x)', 'abcx = input().split(" ")\na = int(abcx[0])\nb = int(abcx[1])\nx = int(abcx[3])\nif x <= a:\n print(x)\nelif x <= a + b:\n print(a)\nelse:\n print(2 * a + b - x)']
['Runtime Error', 'Accepted']
['s107127807', 's885930650']
[8904.0, 9184.0]
[24.0, 22.0]
[176, 161]
p02682
u550257207
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nif k <= a:\n print(k)\n else:\n if k>a and k <= a+b:\n print(a)\n else:\n print(k-a)', 'a,b,c,k = map(int,input().split())\nif k <= a:\n print(k)\nelse:\n if k>a and k <= a+b:\n print(a)\n else:\n print(a-(k-a-b))\n']
['Runtime Error', 'Accepted']
['s992209250', 's592870358']
[8864.0, 9104.0]
[24.0, 21.0]
[135, 128]
p02682
u551066908
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\nimport sys\n\nans = 0\n\nans = A\nK = K - A\n\nif K < 0:\n ans = ans + K\n print(ans)\n sys.exit(0)\n\nif K > 0:\n K = K - B\n\nprint(K)\nif K > 0:\n ans = ans - K\n\nprint(ans)', 'A,B,C,K = map(int,input().split())\nimport sys\n\nans = 0\n\nans = A\nK = K - A\n\nif K < 0:\n ans = ans + K\n print(ans)\n sys.exit(0)\n\nif K > 0:\n K = K - B\n\nif K > 0:\n ans = ans - K\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s015769528', 's452377379']
[9188.0, 9196.0]
[23.0, 22.0]
[198, 189]
p02682
u552004554
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['#!/usr/bin/env python3\n\n\ndef main():\n a, b, c, k = map(int, input().split())\n\n ans = a\n num = a + b\n\n if k >= a:\n print(k)\n elif num < k:\n ans -= k - num\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n', '#!/usr/bin/env python3\n\n\ndef main():\n a, b, c, k = map(int, input().split())\n\n ans = a\n num = a + b\n\n if k <= a:\n print(int(k))\n return\n elif num < k:\n ans -= k - num\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Accepted']
['s276122410', 's361341607']
[9092.0, 9168.0]
[21.0, 25.0]
[242, 258]
p02682
u556589653
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['#Solver:Rute\na,b,c,k = map(int,input().split())\nif k<=a:\n print(k)\nelif a<k<=a+b:\n print(k)\nelse:\n \n print(a-(k-(a+b)))\n', '#Solver:Rute\na,b,c,k = map(int,input().split())\nif 0<=k<=a:\n print(k)\nelif a<k<=a+b:\n print(a)\nelse:\n print(a-(k-(a+b)))']
['Wrong Answer', 'Accepted']
['s088269475', 's502804959']
[9160.0, 9136.0]
[24.0, 20.0]
[167, 123]
p02682
u564770050
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['def main():\n a,b,c,k = map(int,input().split())\n\n if k <= a:\n print(k)\n exit\n\n if k - a <= b:\n print(a)\n exit \n\n print(a - (k - a - b))\n\nif __name__ == "__main__":\n main()', 'def main():\n a,b,c,k = map(int,input().split())\n\n if k <= a or k - a <= b:\n print(k)\n exit\n \n print(a - (k - a - b))\n\nif __name__ == "__main__":\n main()', 'def main():\n a,b,c,k = map(int,input().split())\n\n if k <= a:\n print(k)\n exit()\n\n if k - a <= b:\n print(a)\n exit ()\n\n print(a - (k - a - b))\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s291172621', 's536476848', 's007351474']
[9024.0, 9044.0, 9132.0]
[24.0, 24.0, 24.0]
[214, 181, 218]
p02682
u565433835
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K=map(int,input().split())\nprint(A,B,C,K)\nif A+B>=K:\n print(A)\nelif C>=B:\n print(0)\nelse:\n print(A-C)', 'A,B,C,K=map(int,input().split())\nprint(A,B,C,K)\nif A+B>=K:\n print(A)\nelse:\n print(A-C)', 'A,B,C,K=map(int,input().split())\nif A>=K:\n print(K)\nelif A+B>=K:\n print(A)\nelse:\n print(A-(K-(A+B)))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s119911171', 's420162870', 's942790061']
[9164.0, 9164.0, 9172.0]
[22.0, 23.0, 22.0]
[116, 92, 109]
p02682
u566574814
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = list(map(int, input().split()))\n\nans = 0\n\nwhile(k > 0):\n {\n if (a != 0)\n a-=1\n ans+=1\n k-=1\n if (a == 0 & b > 0){\n b-=1\n k-=1\n }\n if (a == 0 & b == 0 & c > 0) {\n c-=1\n ans-=1\n k-=1\n }\n }\nprint(ans)', 'a,b,c,k = list(map(int, input().split()))\n\nans = 0\n\nwhile(k > 0):\n {\n if (a > 0)\n a-=1\n ans+=1\n k-=1\n if (a == 0 & b > 0){\n b-=1\n k-=1\n }\n if (a == 0 & b == 0 & c > 0) {\n c-=1\n ans-=1\n k-=1\n }\n }\nprint(ans)', 'a,b,c,k = list(map(int, input().split()))\n\nans = 0\n\nwhile(k > 0):\n {\n if (a > 0)\n a-=1\n ans+=1\n k-=1\n elif (a == 0 & b > 0){\n b-=1\n k-=1\n }\n else (a == 0 & b == 0 & c > 0) {\n c-=1\n ans-=1\n k-=1\n }\n }\nprint(ans)', 'a,b,c,k = list(map(int, input().split()))\n\nans = 0\n\nif a >= k:\n print(k)\nelif a+b >=k:\n print(a)\nelse:\n print(a-(k-a-b))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s659078330', 's666885410', 's749287173', 's067430687']
[8916.0, 9016.0, 8992.0, 9136.0]
[24.0, 20.0, 25.0, 23.0]
[264, 263, 267, 123]
p02682
u566987397
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int,input().split())\nans = 0\n\nif k <= a:\n ans = k\nelif k <= (a+b):\n ans = a\nelse:\n ans = (a-(k-(a+b)))\n\n', 'a, b, c, k = map(int,input().split())\nans = 0\n\nif k <= a:\n ans = k\nelif k <= (a+b):\n ans = a\nelse:\n ans = (a-(k-(a+b)))\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s080517833', 's820585138']
[9148.0, 9156.0]
[28.0, 26.0]
[130, 141]
p02682
u568576853
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\nif a<=k:\n print(k)\nelif a+b<=k:\n print(a)\nelse:\n print(a-(k-a-b))', 'a,b,c,k=map(int,input().split())\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelse:\n print(a-(k-a-b))\n\n']
['Wrong Answer', 'Accepted']
['s937821955', 's526680917']
[9188.0, 9160.0]
[22.0, 24.0]
[101, 103]
p02682
u575956662
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['read = input().split()\nprint(read)\nx = int(read[3]) - int(read[0]) - int(read[1])\nif x <= 0:\n print(int(read[0]))\nelse:\n print(int(read[0]) - x)', 'read = input().split()\nx = int(read[3]) - int(read[0]) - int(read[1])\nif int(read[3]) < int(read[0]):\n print(int(read[3]))\nelif x <= 0:\n print(int(read[0]))\nelse:\n print(int(read[0]) - x)']
['Wrong Answer', 'Accepted']
['s798475874', 's287592875']
[9176.0, 9116.0]
[23.0, 23.0]
[150, 196]
p02682
u577415482
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['#B\nA,B,C,K = map(int,input().split())\n\nif A > K:\n\tprint(A)\nelse:\n\tif B > K - A:\n\t\tprint(A)\n\telse:\n\t\tif C > K - A - B:\n\t\t\tprint(A - C)\n\t\telse:\n\t\t\tprint(A - (K - A - B))\n\n\n\n\n##A\n#S = input()\n#T = input()\n', '#B\nA,B,C,K = map(int,input().split())\n\nif A >= K:\n\tprint(K)\nelse:\n\tif B >= K - A:\n\t\tprint(A)\n\telse:\n\t\tprint(A - (K - A - B))\n\n\n\n\n##A\n#S = input()\n#T = input()\n']
['Wrong Answer', 'Accepted']
['s286593464', 's007335213']
[9116.0, 9108.0]
[24.0, 24.0]
[202, 159]
p02682
u581187895
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['\ndef resolve():\n a, b,c,k = map(int, input().split())\n\n ans = 0\n used = min(k,a)\n ans += used * 1\n k -= used\n used = min(k, b)\n k -= used\n ans += k*(-1)\n print(ans)\n\nif __name__ == "__main__":\n unittest.main()', '\ndef resolve():\n a, b,c,k = map(int, input().split())\n\n ans = 0\n used = min(k,a)\n ans += used * 1\n k -= used\n used = min(k, b)\n k -= used\n ans += k*(-1)\n print(ans)\n\n\nif __name__ == "__main__":\n resolve()']
['Runtime Error', 'Accepted']
['s108130029', 's090344876']
[9124.0, 9180.0]
[20.0, 20.0]
[239, 234]
p02682
u581403769
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = input().split()\n\na = int(a)\nb = int(b)\nc = int(c)\nk = int(k)\n\nif a >= k:\n sum = k\nelif a + b >= k:\n sum = k\nelse:\n sum = a - c\n \nprint(sum)\n', 'a, b, c, k = input().split()\n\nif a >= k:\n sum = k\nelif a + b >= k:\n sum = k\nelse:\n sum = a - c\n \nprint(sum)', 'a, b, c, k = input().split()\n\na = int(a)\nb = int(b)\nc = int(c)\nk = int(k)\n\nif a >= k:\n sum = k\nelif a + b >= k:\n sum = a\nelse:\n sum = a - (k - a - b)\n \nprint(sum)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s952398416', 's995964747', 's988780821']
[9160.0, 8988.0, 9084.0]
[27.0, 23.0, 23.0]
[165, 119, 175]
p02682
u587820669
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['t=int(input().split())\nl=[1,0,-1]\nk=t[3]\ns=0\ni=0\nwhile(k!=0):\n if(k>t[i]):\n s+=l[i]*t[i]\n k-=t[i]\n else:\n s+=l[i]*k\n k=0\n i+=1\nprint(s)', 't=list(map(int,input().split()))\nl=[1,0,-1]\nk=t[3]\ns=0\ni=0\nwhile(k!=0):\n if(k>t[i]):\n s+=l[i]*t[i]\n k-=t[i]\n else:\n s+=l[i]*k\n k=0\n i+=1\nprint(s)']
['Runtime Error', 'Accepted']
['s676771626', 's499992510']
[8992.0, 9188.0]
[22.0, 21.0]
[150, 160]
p02682
u589969467
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nif a<=k:\n print(k)\nelif a+b<=k:\n print(a)\nelse:\n print(a-(k-a-b))', 'a,b,c,k = map(int,input().split())\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelse:\n print(a-(k-a-b))']
['Wrong Answer', 'Accepted']
['s574152921', 's564265309']
[9108.0, 9000.0]
[31.0, 29.0]
[103, 103]
p02682
u590656815
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["def solve():\n A = int(input())\n B = int(input())\n C = int(input())\n K = int(input())\n if A >= K >= 1:\n print('{}'.format(K))\n elif A+B >= K > A:\n print('{}'.format(A))\n elif A+B+C >= K > A+B:\n result = 2*A + B - K\n print('{}'.format(result))\n\n\n return", 'def solve():\n A, B, C, K = map(int, input().split())\n if A >= K >= 1:\n print(\'{}\'.format(K))\n elif A + B >= K > A:\n print(\'{}\'.format(A))\n elif A + B + C >= K > A + B:\n result = 2 * A + B - K\n print(\'{}\'.format(result))\n\n return\n\n\nif __name__ == "__main__":\n solve()']
['Wrong Answer', 'Accepted']
['s189084871', 's612102272']
[8912.0, 9192.0]
[21.0, 21.0]
[303, 316]
p02682
u592479128
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K > A:\n N = K - A //2\n all_number = 1*A //3\n\n if N > B:\n N = N - B\n if N > C:\n all_number = all_number - 1 * C\n print(all_number)\n\n else:\n all_number = all_number - 1*N\n print(all_number)\n\n else:\n print(all_number)\nelse:\n all_number = 1*K\n print(all_number)\n', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K > A:\n N = K - A\n all_number = 1*A\n print(all_number)\n\n if N > B:\n N = N - B\n if N > C:\n all_number = all_number - 1 * C\n print(all_number)\n\n else:\n all_number = all_number - 1*N\n print(all_number)\n\n else:\n print(all_number)\nelse:\n all_number = 1*K\n print(all_number)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n N = K - A - B\n print(A - N)', 'if K >= A:\n N = K - A\n all_number = 1*A\n\n if N == 0:\n print(all_number)\n\n elif N >= B:\n N = N - B\n if N >= C:\n all_number = all_number - 1 * C\n print(all_number)\n\n else:\n all_number = all_number - 1*N\n print(all_number)\n\n elif N < B:\n print(all_number)\nelse:\n all_number = 1*K\n print(all_number)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K >= A:\n N = K - A\n all_number = 1*A\n\n if N == 0:\n print(all_number)\n\n elif N >= B:\n N = N - B\n if N >= C:\n all_number = all_number - 1 * C\n print(all_number)\n\n else:\n all_number = all_number - 1*N\n print(all_number)\n\n elif N < B:\n print(all_number)\nelse:\n all_number = 1*K\n print(all_number)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nall_number = 0\n\nif K >= A:\n N = K - A\n all_number = 1*A\n\n if N == 0:\n print(all_number)\n\n elif N >= B:\n N = N - B\n all_number = all_number - 1*N\n print(all_number)\n\n elif N < B:\n print(all_number)\nelse:\n all_number = 1*K\n print(all_number)', 'A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n\nif K >= A:\n N = K - A\n all_number = 1*A\n\n if N == 0:\n print(all_number)\n\n elif N > B:\n N = N - B\n if N > C:\n all_number = all_number - 1 * C\n print(all_number)\n\n else:\n all_number = all_number - 1*N\n print(all_number)\n\n elif N <= B:\n print(all_number)\nelse:\n all_number = 1*K\n print(all_number)\n', 'A, B, C, K = map(int,input().split())\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n N = K - A - B\n an = A - N\n print(an)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s195502787', 's228497285', 's261619981', 's688298194', 's757310760', 's918816021', 's920644532', 's596312144']
[9200.0, 9204.0, 9184.0, 9128.0, 9208.0, 9196.0, 9200.0, 9096.0]
[23.0, 26.0, 22.0, 25.0, 20.0, 22.0, 22.0, 23.0]
[420, 433, 163, 395, 464, 364, 464, 145]
p02682
u592601397
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["A = int(input('A = '))\nB = int(input('B = '))\nC = int(input('C = '))\nK = int(input('Selected number = '))\n\nif A+B >= K:\n print(A)\nelse:\n print(A-(K-A-B))", '#ABC167\nA,B,C,K=map(int,input().split())\n\nif A > K:\n print(K)\nelif A+B >= K:\n print(A)\nelse:\n print(A-(K-A-B))']
['Runtime Error', 'Accepted']
['s031130241', 's454113000']
[9112.0, 9168.0]
[29.0, 24.0]
[192, 153]
p02682
u593019570
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\n\nans = 0\nif k > a:\n ans = ans + a\n k = k - a\nelse:\n ans = ans + k\n k = 0\nif k > b:\n k = k - b\nelse:\n k = 0\nif k > c:\n ans = ans - c\nelse:\n ans = ans - k\nprint(ans)\n\nprint(ans)\n', 'a,b,c,k = map(int,input().split())\n\nans = 0\nif k > a:\n\tans = ans + a\n k = k - a\nelse:\n\tans = ans + k\n k = 0\nif k > b:\n k = k - b\nelse:\n k = 0\nif k > c:\n\tans = ans - c\nelse:\n\tans = ans - k\nprint(ans)\n\nprint(ans)\n', 'a,b,c,k = map(int,input().split())\n\nans = 0\nif k > a:\n ans = ans + a\n k = k - a\nelse:\n ans = ans + k\n k = 0\nif k > b:\n k = k - b\nelse:\n k = 0\nif k > c:\n ans = ans - c\nelse:\n ans = ans - k\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s218362186', 's309451077', 's893125229']
[9192.0, 9016.0, 9028.0]
[22.0, 22.0, 21.0]
[235, 223, 222]
p02682
u597553490
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['\nABCK = input().split()\n\nA= int(ABCK[0].strip())\nB= int(ABCK[1].strip())\nC= int(ABCK[2].strip())\nK= int(ABCK[3].strip())\n\n\nif(A+B>=K):\n Sum = K\nelse:\n N_C = K - (A+B)\n Sum = A - N_C\nprint(Sum)\n', 'import sys\n\n\ndef estimate(A, B, C, K):\n N_A = A\n if(N_A >=K):\n N_A = K\n N_B = 0\n N_C = 0\n return N_A\n N_B = B\n if(N_A+N_B >= K):\n return N_A\n N_C = K- (N_A+N_B)\n return N_A-N_C\n\n\n\nif(__name__ == "__main__"):\n ABCK = input().split()\n\n A= int(ABCK[0].strip())\n B= int(ABCK[1].strip())\n C= int(ABCK[2].strip())\n K= int(ABCK[3].strip())\n\n \n value = estimate(A, B, C, K)\n print(value)\n']
['Wrong Answer', 'Accepted']
['s668215570', 's775609192']
[9176.0, 9212.0]
[22.0, 23.0]
[202, 476]
p02682
u600261652
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int, input().split())\nif (A>=K):\n print(K)\nelse if (A+B>=K):\n print(A)\nelse:\n print(A-(K-A-B))', 'A, B, C, K = map(int, input().split())\nprint(min(A, K) - max(0, K-A-B))']
['Runtime Error', 'Accepted']
['s293497584', 's304970355']
[9024.0, 9060.0]
[23.0, 23.0]
[114, 71]
p02682
u606878291
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["def main(a, b, c, k):\n total = 0\n counts = 0\n while counts == k:\n counts += 1\n if a > 0:\n total += 1\n a -= 1\n elif b > 0:\n b -= 1\n else:\n total -= 1\n c -= 1\n return total\n\n\nif __name__ == '__main__':\n a, b, c, k = tuple(map(int, input().split(' ')))\n print(main(a, b, c, k))\n", "A, B, C, K = map(int, input().split(' '))\ns = 0\ns += min(A, K)\nK -= A\nK -= B\nif K > 0:\n s -= min(C, K)\n\nprint(s)\n"]
['Wrong Answer', 'Accepted']
['s678148670', 's450695697']
[9056.0, 9164.0]
[25.0, 25.0]
[376, 116]
p02682
u608454345
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\n\nxa = min(A,K)\nK1 = K -xa\nif K1 == 0:\n print(K)\nelse:\n\txb = min(B,K1)\n\tK2 = K1 -xb\n\tif K2 == 0:\n \t\tprint(K)\n\telse:\n \t\tprint(A-K2)', 'A,B,C,K = map(int,input().split())\n\nxa = min(A,K)\nK1 = K -xa\nif K1 == 0:\n print(K)\nelse:\n\txb = min(B,K1)\n\tK2 = K1 -xb\n\tif K2 == 0:\n \t\tprint(A)\n\telse:\n \t\tprint(A-K2)']
['Wrong Answer', 'Accepted']
['s869019430', 's361718858']
[9148.0, 9172.0]
[21.0, 20.0]
[168, 168]
p02682
u611033537
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\nif k <= a:\n print(k)\nelif a < k and k - a <= b:\n print(k)\nelse:\n print(k-c)', 'a, b, c, k = map(int, input().split())\nif k <= a:\n print(k)\nelif a < k and k - a <= b:\n print(k)\nelif a == 0 and b ==0:\n print(-k)\nelif k == 0:\n print(0)\nelse:\n print(k-c)', 'A, B, C, K = map(int, input().split())\nif K <= A:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(A-(K-A-B))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s295532662', 's700145229', 's026449980']
[9164.0, 9116.0, 9172.0]
[23.0, 23.0, 21.0]
[117, 176, 117]
p02682
u611090896
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
[', B, C, K = map(int, input().split())\nprint(min(K, A)-max(0, K-A-B))', ', B, C, K = map(int, input().split())\nprint(max(K, A)+min(0, K-A-B))', 'A, B, C, K = map(int, input().split())\nprint(min(K, A)-max(0, K-A-B))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s495573194', 's872570874', 's603963354']
[8936.0, 9000.0, 9152.0]
[22.0, 23.0, 21.0]
[68, 68, 70]
p02682
u618373524
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nmax_point = 0\nif k - a >= 0:\n max_point += a\nif k - a - c >= 0:\n max_point -= c\nprint(max_point)', 'a,b,c,k = map(int,input().split())\nmax_point = 0\nif k - a >= 0:\n max_point += a\nelse :\n max_point = k\nif k - a - b > 0:\n max_point += (a+b)-k\nelse :\n max_point = max_point \nprint(max_point)']
['Wrong Answer', 'Accepted']
['s204092303', 's280205784']
[9172.0, 9000.0]
[22.0, 22.0]
[137, 208]
p02682
u620157187
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int, input().split())\n\nif A<=K:\n print(K)\nelif (K<=A)&(A+B<=K):\n print(A)\nelse:\n print(A-(K-B-A))', 'A, B, C, K = map(int, input().split())\n\nif K<=A:\n print(K)\nelif (A<=K)&(K<=A+B):\n print(A)\nelse:\n print(A-(K-B-A))']
['Wrong Answer', 'Accepted']
['s985140987', 's120010610']
[9164.0, 9172.0]
[22.0, 28.0]
[123, 123]
p02682
u620238824
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int, input().split()) \n\nif A + B >= K:\n print(K)\n exit()\nelse:\n print(A - (1 * (K - (A + B))))', 'a, b, c, k = map(int, input().split())\n\nif k >= a + b + c:\n print(a - c)\n exit()\nelif k <= a:\n print(k)\nelif k <= a + b:\n print(a)\n exit()\nelse:\n print(a - (k - a - b))\n exit()']
['Wrong Answer', 'Accepted']
['s391731605', 's153288691']
[9124.0, 9108.0]
[21.0, 27.0]
[128, 197]
p02682
u621345513
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = list(map(int, input().split()))\nif k<=b:\n print(k)\nelif b<k<=b+a:\n print(b)\nelse:\n print(2*b-k+a)', 'a, b, c, k = list(map(int, input().split()))\nif k<=a:\n print(k)\nelif a<k<=b+a:\n print(a)\nelse:\n print(2*a-k+b)\n']
['Wrong Answer', 'Accepted']
['s687117540', 's577012275']
[9164.0, 9160.0]
[22.0, 23.0]
[113, 114]
p02682
u623953567
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\n\nif A>=K:\n print(K)\nelse:\n if A+B>=K:\n print(K)\n else:\n print(A-(K-A-B))', 'A,B,C,K = map(int,input().split())\n\nif A>=K:\n print(K)\nelse:\n if A+B>=K:\n print(K)\n else:\n print(A-(K-A-B))', 'A,B,C,K = map(int,input().split())\n\nif A>=K:\n print(K)\nelse:\n if A+B>=K:\n print(A)\n else:\n print(A-(K-A-B))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s667290021', 's687112940', 's697099652']
[9168.0, 9176.0, 9168.0]
[22.0, 22.0, 22.0]
[130, 130, 130]
p02682
u625864724
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int,input().split())\nif (k <= a):\n print(k)\nelif (k <= a + b):\n print(k)\nelse:\n x = a + b + c - k\n y = c - x\n ans = a - y\n print(ans)', 'a, b, c, k = map(int,input().split())\nif (k <= a):\n print(k)\nelif (k <= a + b):\n print(k)\nelse:\n x = a + b + c - k\n y = c - x\n ans = a - y', 'a, b, c, k = map(int,input().split())\nif (k <= a):\n print(k)\nelif (k <= a + b):\n print(a)\nelse:\n x = a + b + c - k\n y = c - x\n ans = a - y\n print(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s299127379', 's551481754', 's699985620']
[9196.0, 8916.0, 9104.0]
[30.0, 28.0, 28.0]
[156, 143, 157]
p02682
u627143908
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a = int(input())\nb = int(input())\nc = int(input())\nk = int(input())\nif a + b >= k:\n print(a)\nelse :\n print(a-(k-a-b))', 'a,b,c,k = map(int,input().split())\nif a < k:\n print(k)\nelif a+b <= k:\n print(a)\nelse :\n print(a-(k-a-b))', 'a,b,c,k = map(int,input().split())\nif a < k:\n print(k)\nelse if a+b <= k:\n print(a)\nelse :\n print(a-(k-a-b))', 'a, b, c, k = map(int, input().split())\nans = 0\nif k < a:\n ans = k\nelif k <= a+b:\n ans = a\nelse:\n ans = a - (k-a-b)\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s262155556', 's599055443', 's681748961', 's452738799']
[9136.0, 9032.0, 8904.0, 9172.0]
[22.0, 22.0, 21.0, 23.0]
[123, 113, 116, 134]
p02682
u630237503
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["\ndef main():\n A, B, C, K = list(map(int, input().split()))\n\n if K <= A+B:\n print(K)\n else:\n d = K - A - B\n print(A - d)\n\n\nif __name__ == '__main__':\n main()\n", "\ndef main():\n A, B, C, K = list(map(int, input().split()))\n\n if K <= A:\n print(K)\n elif K <= A+B:\n print(A)\n else:\n d = K - A - B\n print(A - d)\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s237635042', 's171253511']
[9160.0, 9168.0]
[23.0, 22.0]
[190, 224]
p02682
u630554891
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int, input().split())\n\nans = a\nk = k - a\n\nif k > 0:\n k = k - b\n\nif k > 0 and k < c:\n ans = ans - k\nelse:\n ans = ans - c\n\nprint(ans)', 'a,b,c,k=map(int, input().split())\n\ntmp = k\nk = k - a\nif k > 0:\n ans = a\nelse:\n ans = tmp\n\nif k > 0:\n k = k - b\n\nif k > 0:\n ans = ans - k\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s362989919', 's324462329']
[9176.0, 9180.0]
[24.0, 23.0]
[152, 160]
p02682
u631330477
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["S=input()\nT=input()\n\n\nif len(S)+1==len(T):\n for i in range(len(S)): \n if S[i]==T[i]:\n a='ok'\n continue\n else:\n a='no'\n break\nelse:\n print('no')\n\nif a=='ok':\n print('Yes')\nelse:\n print('No')", 'a=1\nb=0\nc=-1\nA,B,C,K=input().split()\nA=int(A)\nB=int(B)\nC=int(C)\nK=int(K)\ntest=0\nif K>=A:\n a=a*A\n test=test+a\n K=K-A\nelif K<=A:\n a=a*K\n test=test+a\n c=0\nif K>=B:\n b=b*B\n test=test+b\n K=K-B\nelif K<=B: \n b=b*K\n test=test+b\n c=0\n \nif K>=C:\n c=c*C\n test=test+c\n K=K-C\nelif K<=C:\n c=c*K\n test=test+c\n \n \nprint(test)']
['Runtime Error', 'Accepted']
['s791636833', 's077737952']
[8912.0, 9132.0]
[23.0, 23.0]
[288, 369]
p02682
u643025147
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['arr = list(input().split())\nA=int(arr[0])\nB=int(arr[1])\nC=int(arr[2])\nK=int(arr[3])\n\n\nsum=0\n\n\nif K > A :\n\tsum+=A\nelse:\n\tsum+=K\nK-=A\n\nif K > 0:\n\tif K > B :\n\t\tsum+=B\n\telse:\n\t\tsum+=K\n\n\tK-=B\n\t\n\n\tif K > 0:\n\t\tsum-=K\n\t\t\n\nprint(sum)\n\n', 'arr = list(input().split())\nA=int(arr[0])\nB=int(arr[1])\nC=int(arr[2])\nK=int(arr[3])\n\n\nsum=0\n\n\nif K > A :\n\tsum+=A\nelse:\n\tsum+=K\nK-=A\n\nif K > 0:\n\n\tK-=B\n\t\n\n\tif K > 0:\n\t\tsum-=K\n\t\t\n\nprint(sum)\n\n']
['Wrong Answer', 'Accepted']
['s810355096', 's391383430']
[9196.0, 9072.0]
[23.0, 21.0]
[418, 381]
p02682
u645382904
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["S = input().split(' ')\nA = S[0]\nB = S[1]\nC = S[2]\nK = S[3]\n\nif K <= A:\n print(K)\nelif K-A <= B:\n print(K)\nelse:\n print(K-C)", 'S = input().split()\nA = S[0]\nB = S[1]\nC = S[2]\nK = S[3]\n\nif K <= A:\n print(K)\nelif K-A <= B:\n print(K)\nelse:\n print(K-C)', 'S = list(map(int,input().split()))\nA = S[0]\nB = S[1]\nC = S[2]\nK = S[3]\n\nif K <= A:\n print(K)\nelif K-A <= B:\n print(K)\nelse:\n print(K-C)', 'S = list(map(int,input().split()))\nA = S[0]\nB = S[1]\nC = S[2]\nK = S[3]\n\nif K <= A:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(A-(K-A-B))']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s200919381', 's954169144', 's983760661', 's009657328']
[9000.0, 9044.0, 9156.0, 8860.0]
[20.0, 20.0, 21.0, 21.0]
[126, 123, 138, 144]
p02682
u646083276
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int, input().split())\n\nres = 0\nif k < a:\n res = a\nelif k < a+b:\n res = a\nelse:\n res = a-c\n\nprint(res)', 'a,b,c,k = map(int, input().split())\n\nres = 0\nif k < a:\n res = a\nelif k < a+b:\n res = a\nelse:\n res = a-(k-b-c)\n\nprint(res)', 'a, b, c, k = map(int, input().split())\nres = 0\nif k <= a :\n res = k\n print(res)\nelse:\n if b >= k-a:\n res = a\n print(res)\n elif b < k-a:\n res = a - (k-b-a)\n print(res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s211360903', 's423146433', 's792323485']
[9172.0, 9072.0, 9076.0]
[24.0, 23.0, 32.0]
[127, 133, 182]
p02682
u648913791
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['ls = list(map(int, input().split()))\ncheck = 0\nfor i, j in zip(ls[:-1], [1, 0 -1]):\n check+=i\n nokori = ls[-1] - check\n if check =< ls[-1]:\n sum_max += i*j\n else:\n sum_max += nokori*j\n break\n\nprint(sum_max)\n', 'ls = list(map(int, input().split()))\nnokori = ls[-1]\nnokori_ = ls[-1]\nsum_max = 0\nfor i, j in zip(ls[:-1], [1, 0, -1]):\n nokori -= i\n if nokori > 0:\n sum_max += i*j\n elif nokori == 0:\n sum_max += i*j\n break\n else:\n sum_max += nokori_*j\n break\n nokori_ = nokori\nprint(sum_max)\n']
['Runtime Error', 'Accepted']
['s496619002', 's971856529']
[8944.0, 9124.0]
[23.0, 21.0]
[240, 326]
p02682
u656919695
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k =map(int,input().split())\n\nif a>=k or (a+b) >=k: \n print(k)\n \nelse:\n print(-(k-a)+a)\n', 'a,b,c,k =map(int,input().split())\n\nz=0\n\nif a !=0 and k >0 :\n z +=1*k\n k -=a\n\nif b!= 0 and k>0 :\n k-=b\n\nif k>0 and c !=0 :\n\n z = z -k\n \nprint(z)', '\na,b,c,k =map(int,input().split())\n\nz=0\n\nif a !=0 and k >0 and a >= k:\n z +=1*k\n k -=a\n\nif b!= 0 and k>0 and b >= k:\n k-=b\n\nif k>0 and c !=0 and c >= k:\n\n z = z -k\n \nprint(z)', 'a,b,c,k = map(int,input().split())\n\nif a>=k:\n print(k)\n \nelif a <= k<= a+b:\n print(a)\n \nelse:\n print(a-(k-a-b))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s054236065', 's840217232', 's966819410', 's629045759']
[9172.0, 9176.0, 9072.0, 9084.0]
[18.0, 21.0, 21.0, 21.0]
[105, 158, 189, 126]
p02682
u657786757
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = list(map(int,input().split()))\nans = 0\nif a>=k:\n ans=k\nelse:\n ans+=a\n k-=a\n if b>=k:\n print(ans)\n else:\n k-=b\n ans-=k\nprint(ans)', 'a,b,c,k = list(map(int,input().split()))\nans = 0\nif a>=k:\n ans=k\nelse:\n ans+=a\n k-=a\n if b<k:\n k-=b\n ans-=k\nprint(ans)']
['Wrong Answer', 'Accepted']
['s723120776', 's275718563']
[9180.0, 9120.0]
[24.0, 23.0]
[174, 144]
p02682
u658575357
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A = input()\nB = input()\nC = input()\nK = input()\nif A+B+C <= K:\n print(A-C)\n\nelif A+B <= K:\n print(A)\n\nelif A <= K:\n print(K)', 'if A+B+C <= K:\n print(A-C)\n\nelif A+B <= K:\n print(A)\n\nelif A <= K:\n print(K)', 'if A+B+C <= K:\n print(A-C)\n\nelif A+B <= K:\n print(A)\n\nelif A <= K:\n print(K)', 'A, B, C, K =map(input().split())\nif A <= K:\n print(K)\n \nelif A+B <= K:\n print(A)\n \nelif A+B+C <= K:\n print(A-C)', 'A,B,C,K = map(int,input().split())\nsum = 0;\nif A <= K:\n\tsum += A;\n\tK -= A\nelse:\n\tsum += K;\n\tK -= K\nif B <= K:\n\tK -= B\nelse:\n\tK -= K\nif C <= K:\n\tsum -= C\n\tK -= C\nelse:\n\tsum -= K\n\tK -= K\nprint(sum)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s115785383', 's385836451', 's573557538', 's740264448', 's913626470']
[9096.0, 9052.0, 9008.0, 9108.0, 9156.0]
[25.0, 21.0, 23.0, 21.0, 20.0]
[133, 85, 85, 126, 195]
p02682
u661347997
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["# S = input()\n# N = int(input())\n# A, B = map(int, input().split(' '))\n# A = list(map(int, input().split(' ')))\n\nA, B, C, K = map(int, input().split(' '))\nresult = 0\n\nif A < K:\n result += A\n K -= A\nelse:\n result = A\n \nif B < K:\n K -= B\n\nif C < K:\n result -= C\n K -= C\nelse:\n result -= K\n\nprint(result)", "# S = input()\n# N = int(input())\n# A, B = map(int, input().split(' '))\n# A = list(map(int, input().split(' ')))\n\nA, B, C, K = map(int, input().split(' '))\nresult = 0\n\nif A < K:\n result += A\n K -= A\nelse:\n result = K\n K -= A\n\nif K > 0:\n if B < K:\n K -= B\n else:\n K -= B\n\nif K > 0:\n if C < K:\n result -= C\n K -= C\n else:\n result -= K\n\nprint(result)\n"]
['Wrong Answer', 'Accepted']
['s298528945', 's147511072']
[9180.0, 9192.0]
[21.0, 23.0]
[309, 370]
p02682
u665038048
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\nif a >= k:\n print(a)\nelse:\n if k - a - b >= 0:\n print(a - k + a)\n else:\n print(a)\n', 'a, b, c, k = map(int, input().split())\nif a >= k:\n print(k)\nelse:\n if k - a - b >= 0:\n print(a - k + a + b)\n else:\n print(a)\n']
['Wrong Answer', 'Accepted']
['s845767007', 's514572930']
[9100.0, 9164.0]
[24.0, 22.0]
[144, 148]
p02682
u667427469
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["if __name__ == '__main__':\n A = input()\n B = input()\n C = input()\n K = input()\n\n if A > K:\n print(K)\n elif A+B >K:\n print(A)\n else:\n print(2*A-K-B)", "if __name__ == '__main__':\n A = input()\n B = input()\n C = input()\n K = input()\n\n a = int(A)\n b = int(B)\n c = int(C)\n k = int(K)\n\n if a > k:\n print(k)\n elif (a+b) > k:\n print(a)\n else:\n ans = 2*a-k+b\n print(ans)\n", "if __name__ == '__main__':\n A = input()\n B = input()\n C = input()\n K = input()\n\n if A > K:\n print(K)\n elif A+B >k:\n print(A)\n else:\n print(2*A-K-B)\n", "if __name__ == '__main__':\n A =[]\n B = input()\n A = B.split()\n\n a = int(A[0])\n b = int(A[1])\n c = int(A[2])\n k = int(A[3])\n\n if a > k:\n print(k)\n elif (a+b) > k:\n print(a)\n else:\n ans = 2*a-k+b\n print(ans)"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s072144817', 's197584657', 's299620125', 's577531162']
[9020.0, 8840.0, 8988.0, 8956.0]
[21.0, 25.0, 24.0, 24.0]
[189, 272, 190, 263]
p02682
u668078904
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a=input().split()\npl1=int(a[0])\npl0=int(a[1])\npl_1=int(a[2])\ndraw=int(a[3])\n\nif(pl1+pl0>draw):\n print(pl1)\nelse:\n all_card=pl1+pl0+pl_1\n #print(all_card)\n draw_pl_1=all_card-draw\n \n print(pl1-draw_pl_1)\n', 'a=input().split()\npl1=int(a[0])\npl0=int(a[1])\npl_1=int(a[2])\ndraw=int(a[3])\n\nif(pl1>=draw):\n print(draw)\nelif(pl1+pl0>=draw):\n print(pl1)\nelse:\n #all_card=pl1+pl0+pl_1\n #print(all_card)\n draw_pl_1=draw-pl1-pl0\n \n print(pl1-draw_pl_1)']
['Wrong Answer', 'Accepted']
['s607106460', 's999099597']
[9120.0, 9168.0]
[24.0, 23.0]
[226, 282]
p02682
u668642853
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['x = sum(list(map(int, input().split(" "))))\nprint(x)', 'A, B, C, K = map(int, input().split())\n\nif A >= K:\n print(K)\nelif A + B >= K:\n print(A)\nelse:\n k = K - A - B\n print(A - k)']
['Wrong Answer', 'Accepted']
['s746299780', 's103839997']
[9152.0, 9172.0]
[19.0, 20.0]
[52, 126]
p02682
u669812251
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['# -*- coding: utf-8 -*-\n\nA, B, C, K = [int(i) for i in input().split()]\n\nif K <= A:\n print(K)\nelif k <= A+B:\n print(A)\nelse:\n print((K-(A+B))*(-1)+A)\n', '# -*- coding: utf-8 -*-\n\nA, B, C, K = [int(i) for i in input().split()]\n\nif K <= A:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print((K-(A+B))*(-1)+A)\n']
['Runtime Error', 'Accepted']
['s023880130', 's110522126']
[9108.0, 9168.0]
[20.0, 21.0]
[160, 160]
p02682
u672475305
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nif a+b>=k:\n print(max(a, k))\nelse:\n print(a-(k-a-b))', 'a,b,c,k = map(int,input().split())\nif a+b>=k:\n print(min(a, k))\nelse:\n print(a-(k-a-b))']
['Wrong Answer', 'Accepted']
['s576030100', 's244074957']
[9168.0, 9044.0]
[24.0, 23.0]
[93, 93]
p02682
u672542358
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\nif a<=k:\n print(k)\nelif a+b<=k:\n print(a)\nelse:\n print(a-c)', 'a,b,c,k=map(int,input().split())\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelse:\n print(a-(k-a-b))']
['Wrong Answer', 'Accepted']
['s000433347', 's888643622']
[9168.0, 9172.0]
[18.0, 20.0]
[95, 101]
p02682
u674343825
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\nif A >= K:\n for a in range(A):\n if a == K:\n print(a)\nelif A+B >= K:\n for b in range(B):\n if A+b == K:\n print(A)\nelse:\n for c in range(C):\n if A+B+c == K:\n print(A-c)', 'A,B,C,K = map(int,input().split())\nfor a in range(A):\n if a == K:\n print(a)\n exit()\nfor b in range(B):\n if a+b == K:\n print(a)\n exit()\nfor c in range(C):\n if a+b+c == K:\n print(a-c)\n exit()', 'A,B,C,K = map(int,input().split())\nfor c in range(C):\n for b in range(B):\n for a in range(A):\n if a + b + c == K:\n print(a-c)\n exit()', 'A,B,C,K = map(int,input().split())\nif A >= K:\n print(K)\nelif A+B >= K:\n print(A)\nelse:\n print(2*A+B-K)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s492852278', 's537649068', 's785875421', 's740563482']
[9124.0, 9188.0, 9028.0, 9076.0]
[2206.0, 2205.0, 2206.0, 27.0]
[263, 240, 184, 111]
p02682
u675168568
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\n\nif k <= a:\n print(k)\nelif k <= a+b:\n print(a)\nelse:\n print(a - (k - (a + b))', 'a, b, c, k = map(int, input().split())\n\nif k <= a:\n print(k)\nelif k <= a+b:\n print(a)\nelse:\n print(2*a - k + b)']
['Runtime Error', 'Accepted']
['s701055649', 's509850579']
[8968.0, 8912.0]
[18.0, 23.0]
[119, 114]
p02682
u675205065
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int, input().split())\nans = 0\nl = [a,b,c]\nwhile k>0:\n if k < a:\n ans=k\n break\n else:\n ans += a \n k-=a \n a-=a \n if k > b:\n k-=b\n b-=b\n if k < c:\n ans += -k \n k-=k\n break\n \nprint(ans)', 'a,b,c,k = map(int, input().split())\nans = 0\nl = [a,b,c]\nwhile k>0:\n if k < a:\n print(k)\n break\n else:\n ans += a \n k-=a \n a-=a \n if k > b:\n k-=b\n b-=b\n if k < c:\n ans += -k \n k-=k\n \nprint(ans)', 'a,b,c,k = map(int, input().split())\nans = 0\nl = [a,b,c]\nwhile k>0:\n if k < a:\n ans=k\n break\n else:\n ans += a \n k-=a \n a-=a \n if k ==0:\n break \n if k > b:\n k-=b\n b-=b\n else:\n k-=k\n b-=k \n if k ==0:\n break \n if k < c:\n ans += -k \n k-=k\n else:\n ans += -c\n k -= c\n if k ==0:\n break \nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s340824125', 's637534018', 's229109698']
[9200.0, 9200.0, 9220.0]
[2205.0, 2205.0, 23.0]
[281, 270, 438]
p02682
u682563287
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['def main():\n A,B,C,K = map(int, input().split())\n score=0\n count=K\n i=0\n while count>0:\n if i==0:\n score=score+count\n count=count-A\n # print(score,"s",count)\n elif i ==1:\n count=count-B\n # print(score,"s",count)\n else:\n score=score-count\n count=count-C\n # print(score,"s",count)\n i=i+1\n \n print(score)\nmain()', 'def main():\n A,B,C,K = map(int, input().split())\n score=0\n count=K\n i=0\n while count>0:\n if i==0:\n if A<=K:\n score=score+A\n else:\n score=K\n \n count=count-A\n # print(score,"s",count)\n elif i ==1:\n count=count-B\n # print(score,"s",count)\n else:\n score=score-count\n count=count-C\n # print(score,"s",count)\n i=i+1\n \n print(score)\nmain()']
['Wrong Answer', 'Accepted']
['s706812679', 's773794550']
[9184.0, 9092.0]
[21.0, 23.0]
[449, 525]
p02682
u682730715
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\ns = 0\nfor in range(k):\n if a > 0:\n s += 1\n a -= 1\n elif b > 0:\n b += 0\n else:\n s += -1\nprint(s)', '# coding: UTF-8\nimport sys\n\nimport heapq\nimport re\nimport bisect\nimport random\nimport math\nimport itertools\nfrom collections import defaultdict, deque\nfrom copy import deepcopy\nfrom decimal import *\n\nreadl= lambda: list(map(int, sys.stdin.readline().split()))\nreadt= lambda: tuple(map(int, sys.stdin.readline().split()))\nread = lambda: sys.stdin.readline().rstrip()\nreadi = lambda: int(read())\nreadmi = lambda: map(int, sys.stdin.readline().split())\nreadms = lambda: map(str, sys.stdin.readline().split())\n\na, b, c, k = readmi()\ns = min(a, k)\nk -= a\nif k <= 0:\n print(s)\n exit()\nk -= b\nif k <= 0:\n print(s)\n exit()\ns -= k\nprint(s)']
['Runtime Error', 'Accepted']
['s816712773', 's254576869']
[9024.0, 10768.0]
[24.0, 36.0]
[149, 667]
p02682
u684267998
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nif k == 0:\n print("0")\nelif a < k:\n print(a-k)\nelif a+b > k:\n print(a)\nelse:\n ab = a+b\n ans = a - (k-ab)\n print(ans) ', 'a,b,c,k = map(int,input().split())\naa=a\nif k == 0:\n print(0)\nelif a > k:\n print(k)\nelif a+b >= k:\n print(a)\nelse:\n ab = a+b\n ans = aa-(k-ab)\n print(ans) ']
['Wrong Answer', 'Accepted']
['s293867754', 's150999202']
[9128.0, 9148.0]
[24.0, 23.0]
[173, 174]
p02682
u686989171
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['def resolve():\n a,b,c,k=map(int,input().split())\n if a+b >=k:\n print(a)\n else:\n d=k-a-b\n print(a-d)\nreslove()', 'def resolve():\n a,b,c,k=map(int,input().split())\n\n if a>k:\n print(k)\n elif a + b >= k:\n print(a)\n elif a+b<k:\n d=k-a-b\n print(a-d)\nresolve()']
['Runtime Error', 'Accepted']
['s591746133', 's900129424']
[9040.0, 9180.0]
[23.0, 19.0]
[139, 180]
p02682
u687135117
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["#import collections\n# c = collections.Counter()\n#import itertools as it\n#import math\n#import numpy as np\n#import sys \n#sys.exit()\n \n#s = input()\n#t = input()\n#k = int(input())\na,b,c,k = map(int, input().split())\n'''\n# = list(map(int, input().split()))\n'''\n\n'''\nn,m = map(int, input().split())\na = [list(map(int, input().split())) for _ in range(m)]\n'''\n \n#-------------------------------#\n#len(t)==len(s)+1\nprint(a,b,c,k)\nif a+b>=k:\n print(a+b)\nelse:\n print(a+b-a+b-k)", "a,b,c,k = map(int, input().split())\n'''\n# = list(map(int, input().split()))\n'''\n\n'''\nn,m = map(int, input().split())\na = [list(map(int, input().split())) for _ in range(m)]\n'''\n \n#-------------------------------#\n#len(t)==len(s)+1\n#print(a,b,c,k)\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelif a+b+c>=k:\n print(a-(k-a-b))"]
['Wrong Answer', 'Accepted']
['s609399522', 's331856012']
[9176.0, 9180.0]
[22.0, 23.0]
[531, 387]
p02682
u693173434
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k= int(input().split())\n\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelse:\n print(2*a-k-b)', 'a, b, c, k= map(int, input().split())\n\nif a>=k:\n print(k)\nelif a+b>=k:\n print(a)\nelse:\n print(2*a-k+b)']
['Runtime Error', 'Accepted']
['s428745810', 's449306816']
[9096.0, 9160.0]
[23.0, 22.0]
[106, 111]
p02682
u693723949
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = [int(x) for x in input().split()]\n\nab = a+b\nabc = a+b+c\nif k <= a:\n print(k)\nelif k<= ab:\n print(k)\nelse:\n print(a-(k-a-b))', 'a, b, c, k = [int(x) for x in input().split()]\n\nab = a+b\nabc = a+b+c\nprint(a,b,c,k)\nif k <= a:\n print(k)\nelif k<= ab:\n print(a)\nelse:\n print(a-(k-ab))', 'a, b, c, k = [int(x) for x in input().split()]\n\nab = a+b\nabc = a+b+c\nprint(a,b,c,k)\nif k <= ab:\n print(k)\nelse:\n print(a-(k-ab))', 'a, b, c, k = [int(x) for x in input().split()]\n\nab = a+b\nabc = a+b+c\n\nif k <= a:\n print(k)\nelif k<= ab:\n print(k):\nelse:\n print(a-(k-ab))\n', 'a, b, c, k = [int(x) for x in input().split()]\n \nif k <= a:\n print(k)\nelif a < k and k<= a+b:\n print(a)\nelse:\n print(a-(k-a-b))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s274499060', 's293163530', 's298675090', 's806143379', 's401489210']
[9176.0, 9200.0, 9176.0, 9056.0, 9148.0]
[20.0, 23.0, 21.0, 23.0, 24.0]
[139, 153, 130, 141, 130]
p02682
u695329583
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nm = min(k,a)\nif m == k :\n n = 0\n l = 0\nn = min(k-a,b)\nif n == k=a :\n l = 0\nl = min(k-a-b,c)\nprint(1*m+0*n+(-1)*l)', 'a,b,c,k = map(int,input().split())\nif k <= a :\n print(k)\nelse :\n m = min(k,a)\n k -= a\n\n if k <= b :\n print(k)\n else :\n n = min(k,b)\n k -= b\n l = k\n print(1*m+(-1)*l)', 'a,b,c,k = map(int,input().split())\nif k <= a :\n print(k)\nelse :\n m = min(k,a)\n k -= a\n\n if k <= b :\n print(a)\n else :\n n = min(k,b)\n k -= b\n l = k\n print(1*m+(-1)*l)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s683076647', 's970474965', 's916998205']
[8964.0, 9044.0, 9176.0]
[26.0, 23.0, 26.0]
[157, 215, 215]
p02682
u697063004
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,d = input().split()\nif int(d) < int(a):\n print(int(d))\nelif int(d) < int(a) + int(b):\n print(int(a) + (int(d) - int(a))* 0)\nelse:\n res = int(a) - (int(d)-(int(a)+ int(b)))\n print(res)\n~ ', 'a,b,c,d = input().split()\nif int(d) < int(a):\n print(int(d))\nelif int(d) < int(a) + int(b):\n print(int(a) + (int(d) - int(a))* 0)\nelse:\n res = int(a) - (int(d)-(int(a)+ int(b)))\n print(res)']
['Runtime Error', 'Accepted']
['s210961165', 's849063946']
[9056.0, 9220.0]
[25.0, 23.0]
[219, 201]
p02682
u697422981
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,A,B,C,K=map(int,input().split())\nif K<=A:\n print(K)\nelif A<K<=A+B:\n print(A)\nelif A+B<K<=A+B+C:\n print(2*A+B-K)\n ', 'A,B,C,K=map(int,input().split())\nif K<=A:\n print(K)\nelif A<K<=A+B:\n print(A)\nelif A+B<K<=A+B+C:\n print(2*A+B-K)']
['Runtime Error', 'Accepted']
['s464721276', 's447053733']
[9168.0, 9176.0]
[25.0, 21.0]
[123, 114]
p02682
u699912843
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
["def a():\n s = input()\n t = input()\n if s == t[0:-1]:\n print('Yes')\n else:\n print('No')\n\n\ndef b():\n a, b, c, k = map(int, input().split())\n sum = 0\n k -= a\n if k < 0:\n sum = k\n else:\n sum = a\n print(sum)\n k -= b\n if k >= 1:\n sum -= k\n print(sum)\n\n\n\n\n\n\nb()", "def a():\n s = input()\n t = input()\n if s == t[0:-1]:\n print('Yes')\n else:\n print('No')\n\n\n\ndef b():\n a, b, c, k = map(int, input().split())\n xa = min(k, a)\n k1 = k - xa\n xb = min(k1, b)\n k2 = k1 - xb\n print(xa - k2)\n \n\n print(sum)\n\n\n\n\n\n\nb()", "def a():\n s = input()\n t = input()\n if s == t[0:-1]:\n print('Yes')\n else:\n print('No')\n\n\n\ndef b():\n a, b, c, k = map(int, input().split())\n xa = min(k, a)\n k1 = k - xa\n xb = min(k1, b)\n k2 = k1 - xb\n print(xa - k2)\n\n\n\n\n\n\nb()"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s009560485', 's831635537', 's139560743']
[9192.0, 9108.0, 9188.0]
[22.0, 23.0, 21.0]
[348, 309, 288]