problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02935
s530193704
Accepted
n = int(input()) a = sorted(list(map(int, input().split()))) x = a[0] for i in range(n - 1): x = (x + a[i + 1]) / 2 print(x)
p02555
s047523250
Accepted
s = int(input()) dp = [0]*(2001) dp[3] = 1 mod = 10**9+7 for i in range(4,s+1): dp[i] = (dp[i-1] + dp[i-3]) % mod print(dp[s])
p02684
s315666316
Accepted
n,k = map(int,input().split()) b = [bi-1 for bi in list(map(int,input().split()))] a = 0 f = [0]*n c = 1 for i in range(k): if f[a]: k %= c-f[a] for i in range(k): a = b[a] print(a+1) break f[a] = c k -= 1 c += 1 a = b[a] else: print(a+1)
p02744
s986488142
Accepted
import itertools n = int(input()) alpha = "abcdefghij" ans_s = {} if n == 1: print("a") exit() def ans_string(max_num, num, ans): if num == 0: ans_s[ans] = 1 else: for i in range(max_num + 2): ans_string(max(i, max_num), num - 1, ans + alpha[i]) ans_string(0, n - 1, "a") for key, value in ans_s.items(): print(key)
p02583
s890211699
Accepted
N = int(input()) L = list(map(int, input().split())) L.sort() ans = 0 if N < 3: print('0') exit() for i in range(N - 2): for j in range(i + 1, N - 1): for k in range(j + 1, N): if L[i] == L[j] or L[j] == L[k] or L[i] == L[k]: continue if L[k] < L[i] + L[j]: ans += 1 print(ans)
p02779
s919549153
Accepted
n=int(input()) A=[int(i) for i in input().split()] if len(set(A))==n: print("YES") else: print("NO")
p03637
s202969178
Wrong Answer
N = int(input()) A = list(map(int,input().split())) four = 0 two = 0 odd = 0 for i in A: if i%4 == 0: four += 1 elif i%2 == 0: two += 1 else: odd += 1 if two == 1: odd += 1 if odd <= 2*four: print("Yes") else: print("No")
p02829
s217041510
Accepted
a = int(input()) b = int(input()) ans = [1,2,3] ans.remove(a) ans.remove(b) print(ans[0])
p02848
s974745080
Accepted
N = int(input()) S = input() for i in range(len(S)): a = ord(S[i])+N if a > ord('Z'): a -= 26 print(chr(a),end ='')
p02843
s004677506
Wrong Answer
X = int(input()) num_item = int(X // 100) remain = X - num_item * 100 if remain < num_item * 5: print(1) else: print(0)
p03657
s907661976
Wrong Answer
a,b = map(int,input().split()) print("Possible" if (a+b)%3 == 0 else "Impossible")
p03323
s374867510
Accepted
A,B = map(int,input().split()) print("Yay!") if A<=8 and B<=8 else print(':(')
p03605
s550834027
Accepted
t=input() if '9' in t: print("Yes") else: print("No")
p03160
s968260846
Accepted
def rec(a): dp=[0]*len(a) for i in range(len(a)): if i==0: dp[i]=0 elif i==1: dp[i]=abs(a[i]-a[i-1]) else: dp[i]=min(abs(a[i]-a[i-1])+dp[i-1],abs(a[i]-a[i-2])+dp[i-2]) return dp[len(a)-1] n=int(input()) a=[int(i) for i in input().split()] print(rec(a))
p02678
s913219443
Accepted
import sys input = sys.stdin.readline N, M = map(int, input().split()) AB = [tuple(map(int,input().split())) for i in range(M)] es = [[] for _ in range(N)] for a, b in AB: es[a-1].append(b-1) es[b-1].append(a-1) ans = [-1] * N ans[0] = 0 from collections import deque que = deque([]) que.append(0) while que: s = que.popleft() for v in es[s]: if ans[v] == -1: ans[v] = s+1 que.append(v) print("Yes") print(*ans[1:], sep="\n")
p03720
s698949500
Accepted
n,m = map(int,input().split()) count_list = [0] * n list = [input() for i in range(m)] for i in range(m): ary = list[i].split() count_list[int(ary[0])-1] += 1 count_list[int(ary[1])-1] += 1 for i in range(n): print(count_list[i])
p03659
s627507219
Accepted
N = int(input()) a = list(map(int, input().split())) s = a[:1] t = a[1:] x = sum(s) y = sum(t) if x==y: ans = 0 else: ans = abs(x-y) for i in range(1,N-1): x += a[i] y -= a[i] if x==y: ans = 0 break elif abs(x-y)<ans: ans = abs(x-y) print(ans)
p03673
s541916188
Accepted
n = int(input()) a = list(map(int, input().split())) if n%2==1: tmp = a[::-2]+a[1::2] else: tmp = a[::-2]+a[0::2] print(' '.join(map(str, tmp)))
p03680
s151082259
Accepted
N = int(input()) a = [int(input()) for i in range(N)] index=0 for i in range(N): next = a[index] if next==2: count = i+1 break index = next-1 count = -1 print(count)
p02660
s546416599
Wrong Answer
N = int(input()) ans = 0 ans_list = list() skip_list = list() import math as math sqrt = math.sqrt(N) wide = math.ceil(sqrt) for i in range(3,wide,2): if N % i == 0: div = i ans +=1 n = 1 while N % div == 0: ans += 1 N = N/div n += 1 div = div**n if ans == 0 and N != 0: print(1) else: print(ans)
p03408
s914280692
Wrong Answer
from collections import Counter from sys import maxsize # input N = int(input()) S = Counter([input() for i in range(N)]) M = int(input()) T = Counter([input() for j in range(M)]) # check max_cnt = -maxsize for s in S.keys(): cnt = S[s] if s in T.keys(): cnt -= T[s] if max_cnt < cnt: max_cnt = cnt print(max_cnt)
p03427
s117304180
Accepted
S = input() N = len(S) ans = int(S[0]) + 9 * (N - 1) if not S[1:] == "9" * (N - 1): ans -= 1 print(ans)
p03206
s142742082
Accepted
d = int(input()) if d == 25: print("Christmas") elif d == 24: print("Christmas Eve") elif d == 23: print("Christmas Eve Eve") else: print("Christmas Eve Eve Eve") # n = 25 - int(input()) # print("Christmas" + "Eve" * n) #かしこい
p03220
s064543136
Wrong Answer
def calc(T, x): return T - x * 0.0006 N = int(input()) T, A = map(int, input().split()) L = list(map(int, input().split())) l = [] for i in L: l.append(abs(A - calc(T, i))) mi = min(l) print(l.index(mi)+1)
p02787
s158074259
Accepted
import sys input = sys.stdin.readline H,N = map(int,input().split()) spells = [list(map(int,input().split())) for i in range(N)] INF = 10**10 dp = [INF]*(H+1) dp[0] = 0 for use in spells: damage = use[0] mp = use[1] for i in range(1,H+1): dp[i] = min(dp[max(0,i-damage)] + mp, dp[i]) print(dp[-1])
p02765
s062209894
Wrong Answer
n,r=map(int,input().split(" ")) if n >= 10: print(r) else: print(r+100*(10*n))
p02813
s124002308
Accepted
def main(): import sys import itertools N=int(sys.stdin.readline()) PL=list(map(int,sys.stdin.readline().split())) QL=list(map(int,sys.stdin.readline().split())) for i,L in enumerate(itertools.permutations(range(1,N+1))): if tuple(L)==tuple(PL): a=i if tuple(L)==tuple(QL): b=i print(abs(a-b)) main()
p04043
s886287336
Accepted
abc = list(map(int,input().split())) if 5 in abc and 7 in abc and abc.count(7)==1: print('YES') else: print('NO')
p03408
s823413797
Accepted
N = int(input()) S = [input() for _ in range(N)] M = int(input()) T = [input() for _ in range(M)] print(max(0, *[S.count(s) - T.count(s) for s in set(S)]))
p02577
s907643561
Accepted
#ABC176 B N = list(map(int,input())) n = 0 for i in N: n += i if n % 9 == 0: print('Yes') else: print('No')
p03042
s677213232
Accepted
S = input() heads = int(S[:2]) tails = int(S[2:]) def is_month(n): return n >= 1 and n <= 12 if is_month(heads) and (not is_month(tails)): print("MMYY") elif (not is_month(heads)) and (not is_month(tails)): print("NA") elif (not is_month(heads)) and is_month(tails): print("YYMM") else: print("AMBIGUOUS")
p03796
s412127788
Accepted
N=int(input()) import math power=math.factorial(N) print(power%(10**9+7))
p02607
s174942929
Accepted
N = int(input()) ans = 0 a = list(map(int, input().split())) for i in range(1,N+1): if a[i-1] % 2 != 0 and i % 2 != 0: ans+=1 print(ans)
p03309
s739475299
Wrong Answer
import numpy as np N=int(input()) A=list(map(int, input().split())) mean=0 for i in range(N): A[i]-=(i+1) mean+=A[i]/(N) A=np.array(A) #平均を0に近づけるようにする mean=round(mean) def sudness(A): sad=0 for a in A: sad+=abs(a) return sad print(sudness(A-mean))
p02923
s482857543
Wrong Answer
N = int(input()) H = input().split() l=0 t_l = 0 for i in range(N-1): if H[i] >= H[i+1]: t_l = t_l + 1 if l < t_l: l = t_l else: t_l=0 print(l)
p03817
s438729860
Accepted
x=int(input()) mod=x%11 if mod==0: print(x*2//11) elif mod<=6: print((x//11)*2 + 1) else: print((x//11)*2 + 2)
p02645
s599702621
Accepted
S = input() print(S[:3])
p03679
s623218535
Wrong Answer
x,a,b=map(int,input().split()) print('delicious' if a>b else 'dangerous' if b>a+x else 'safe')
p02577
s076097077
Accepted
n = list(input()) n = list(map(int, n)) print("Yes" if sum(n)%9 == 0 else "No")
p03285
s038226833
Accepted
N = int(input()) l = [] for i in range(25): for j in range(25): l.append(i * 4 + j * 7) ans = 'No' if N in l: ans = 'Yes' print(ans)
p02678
s627938477
Wrong Answer
n,m=map(int,input().split()) li=[[] for i in range(n)] for i in range(m): ai,bi=map(int,input().split()) li[ai-1].append(bi-1) li[bi-1].append(ai-1) flag=0 for i in range(n): if len(li[i])==0: flag=1 break if flag==1: print("No") else: print("Yes") for i in range(1,n): print(min(li[i])+1)
p03012
s023856492
Accepted
import math, sys inp = int(input()) var = list(map(int,input().split())) l = [] for i in range(inp-1): a = math.fabs(sum(var[0:i+1]) - sum(var[i+1:inp+1])) if a==0: print(0) sys.exit() l.append(a) l.sort() print(int(l[0]))
p02676
s111328529
Accepted
import sys import math k=int(input()) s=input() if len(s)<=k: print(s) else: s_s=s[:k] print(s_s+'...')
p02719
s792849149
Wrong Answer
n,k=map(int,input().split()) a=b=abs(n-k) ans=n if n%k==0: print("0") exit() while a!=abs(b-k): b=abs(b-k) if b<ans: ans=b print(ans)
p02780
s820006808
Wrong Answer
n,k,*p=map(int,open(0).read().split()) s=[p[0]]*n for i in range(1,n): s[i]=s[i-1]+p[i] ans=0 for i in range(n-k): ans=max(ans,s[i+k]-s[i]) print((ans+k)/2)
p03359
s955823421
Accepted
a, b = map(int, input().split()) if a <= b: print(a) else: print(a-1)
p02848
s164007068
Accepted
n = int(input()) s = input() for i in s: i = ord(i) + n if (i > 90): d = i - 90 print(chr(64+d),end = '') else: print(chr(i),end = '')
p02600
s204448075
Accepted
def solve(): n = int(input()) if n <= 599: print(8) elif n <= 799: print(7) elif n <= 999: print(6) elif n <= 1199: print(5) elif n <= 1399: print(4) elif n <= 1599: print(3) elif n <= 1799: print(2) else: print(1) solve()
p02924
s992790077
Accepted
N = int(input()) print(N*(N-1)//2)
p03043
s126006528
Accepted
N, K = [int(_) for _ in input().split()] scores = [] max_patterns = 0 for dice in range(1, N + 1): score = dice coin_counts = 0 while score < K: score *= 2 coin_counts += 1 patterns = 2 ** coin_counts max_patterns = max(patterns, max_patterns) lose = patterns - 1 win = 1 scores.append((win, lose, patterns)) total_win = 0 total_lose = 0 for win, lose, patterns in scores: ratio = max_patterns // patterns total_win += win * ratio total_lose += lose * ratio win_ratio = total_win / (total_win + total_lose) print(win_ratio)
p03730
s164450300
Wrong Answer
A,B,C=map(int,input().split()) print('YES' if A%2==C%2 else 'NO')
p02820
s309266226
Wrong Answer
N, K = [int(n) for n in input().split()] R, S, P = [int(n) for n in input().split()] T = input() scoredict = {'r':R, 's':S, 'p':P} winning = {'r':'p', 's':'r', 'p':'s'} picks = [] score = 0 for i in range(N): current = T[i] pick = winning[current] if i - K >= 0 and pick == picks[i-K]: pick = current else: score += scoredict[pick] picks.append(pick) print(score)
p02689
s166667468
Accepted
N, M = map(int, input().split()) H = list(map(int, input().split())) A_list = [] B_list = [] Remove_list = [] for _ in range(M): A, B = map(int, input().split()) A_list.append(A - 1) B_list.append(B - 1) for A, B in zip(A_list, B_list): A_height = H[A] B_height = H[B] if A_height <= B_height: Remove_list.append(A) if B_height <= A_height: Remove_list.append(B) S = set(range(N)) S = S - set(Remove_list) print(len(S))
p03407
s844754028
Wrong Answer
a, b, c = map(int, input().split()) if c<=a+b*2: print("Yes") else: print("No")
p03408
s033515659
Accepted
n=int(input()) from collections import Counter cc=Counter() for _ in range(n): cc[input()]+=1 m=int(input()) ans=0 for _ in range(m): x=input() if cc[x]==0: continue else: cc[x]-=1 for i in cc: ans=max(ans,cc[i]) print(ans)
p03719
s872870369
Accepted
a,b,c=map(int,input().split()) if a<=c<=b: print("Yes") else: print("No")
p02594
s725500163
Accepted
X = int(input()) if 30 <= X: print('Yes') else: print('No')
p02790
s365759301
Wrong Answer
a,b= input().split() x=int(a*int(b)) y=int(b*int(a)) c=[x,y] c=sorted(c) print(c[0])
p03720
s737998053
Accepted
n,m,*ab = map(int, open(0).read().split()) from collections import Counter c = Counter(ab) for i in range(1,n+1): print(c[i])
p03163
s001377053
Accepted
N,W=map(int,input().split(' ')) w=[0]*N ; v=[0]*N for i in range(N): w[i],v[i]=map(int,input().split(' ')) dp=[[0]*(W+1) for _ in range(N+1)] for i in range(1,N+1): for j in range(1,W+1): if j<w[i-1]: dp[i][j]=dp[i-1][j] else: dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+v[i-1]) print(dp[N][W])
p02596
s000880307
Wrong Answer
K = int(input()) num = 0 cnt = 0 ans = False for i in range(K): num = num*10+7 cnt += 1 if num % K == 0: print(cnt) ans = True if ans == False: print(-1)
p02784
s892767804
Accepted
h, n = map(int, input().split()) a = map(int, input().split()) if sum(a) >= h: print('Yes') else: print('No')
p02923
s199283234
Accepted
n=int(input()) h=list(map(int,input().split()))[::-1] ans=[0]*n for i in range(n-1): if h[i]<=h[i+1]: ans[i+1]+=ans[i]+1 print(max(ans))
p03494
s883043405
Accepted
n = int(input()) a = list(map(int, input().split())) ans = 0 q = True while q == True: for i in range(n): if a[i]%2 == 0: a[i] = a[i]//2 else: print(ans) q = False break ans += 1
p02835
s069031755
Wrong Answer
num = list(map(int,input().split())) sum = 0 for i in num: sum += i if sum > 22: print("best") else: print("win")
p03861
s320267927
Wrong Answer
a, b, x = map(int, input().split()) if x == 1: print(b - a + 1) exit() if a == b: if b % x == 0: print(1) else: print(0) print(b // x - (a-1) // x)
p04043
s207654453
Accepted
import sys input = sys.stdin.readline a, b, c = map(int, input().split()) match = [a, b, c] cnt = 0 for i in range(3): if match[i] == 5: cnt += 2 elif match[i] == 7: cnt += 1 if cnt == 5: ans = 'YES' else: ans = 'NO' print(ans)
p04030
s477995549
Wrong Answer
t = "" s = input() for i in s: if len(t) == 0: continue elif i == 'B' and len(t) > 0: t = t[:-1] else: t += i print(t)
p03860
s798449999
Wrong Answer
a,b,c = map(str,input().split()) print(a+b[0]+c)
p02631
s159624182
Accepted
n = int(input()) a = list(map(int, input().split())) xor = 0 for i in a: xor ^= i for i in a: print(xor^i, end=" ")
p03779
s136069440
Accepted
import math x = int(input()) ans = math.ceil((-1 + math.sqrt(8 * x + 1)) / 2) print(ans)
p03944
s636319917
Wrong Answer
W,H,N = map(int,input().split()) XYA = [tuple(map(int,input().split())) for _ in range(N)] xmin = 0 ymin = 0 xmax = W ymax = H for x,y,a in XYA: if a == 1: xmin = x elif a == 2: xmax = x elif a == 3: ymin = y else: ymax = y #print(xmax,xmin,ymax,ymin) print(max(xmax-xmin,0)*max(ymax-ymin,0))
p03435
s870872540
Accepted
C = [] import numpy as np for _ in range(3): C.append(list(map(int,input().split()))) for i in range(1,3): ALL = [] for j in range(3): a = C[0][j] - C[i][j] ALL.append(a) if len(set(ALL)) != 1: print('No') exit() print('Yes')
p04034
s496340639
Accepted
n,m = map(int, input().split()) ball_cnts = [1]*(n+1) ball_cnts[0] = 0 red_flag = [False]*(n+1) red_flag[1] = True for _ in range(m): x,y = map(int, input().split()) if red_flag[x]: red_flag[y] = True if ball_cnts[x] == 1: red_flag[x] = False ball_cnts[x] -= 1 ball_cnts[y] += 1 ans = 0 for v in red_flag: if v: ans += 1 print(ans)
p03331
s343218160
Accepted
N = int(input()) def wa(x): s = 0 while x > 0: s += x % 10 x = int(x / 10) return s L = [] for i in range(1,N): A = i B = N - i x = wa(A) + wa(B) L.append(x) L = sorted(L) print(L[0])
p02881
s168451116
Accepted
N = int(input()) p = 1 for i in range(1,int(N**0.5+1)): if N%i == 0: p = i print(p+N//p-2)
p03469
s896727160
Wrong Answer
s=input();print(s[:2]+'8'+s[4:])
p02796
s633438929
Accepted
N = int(input()) # X, L = [], [] A = [] for i in range(N): x, l = map(int, input().split()) # X.append(x) # L.append(l) A.append((x - l, x + l)) A.sort(key=lambda x: x[1]) ans = 0 x = -10e50 for i in range(N): l, r = A[i] if x <= l: ans += 1 x = r print(ans) # 選べるロボットの中で最もX+Lが小さいもの
p02628
s634184035
Wrong Answer
a = input().split() # a[0] is N個 # a[1] is K個 b = input().split() b.sort() sum = 0 for i in range(int(a[1])): sum += int(b[i]) print(sum)
p03042
s591629275
Accepted
s = input() s1 = int(s[0]+s[1]) s2 = int(s[2]+s[3]) if 1<=s1<=12 and 0<=s2<=99: if 1<=s2<=12: print("AMBIGUOUS") else: print("MMYY") else: if 0<=s1<=99 and 1<=s2<=12: print("YYMM") else: print("NA")
p02952
s778004283
Accepted
N = int(input()) count = 0 for i in range(1, N+1): if len(str(i)) % 2 != 0: count += 1 print(count)
p03419
s817915782
Wrong Answer
N, M = map(int, input().split()) if N == M == 1: print(1) elif N == 1 and M != 1: print(M - 2) else: print((N - 2) * (M - 2))
p03137
s215699740
Accepted
import math import collections import fractions import itertools def solve(): n, m = map(int, input().split()) x = list(map(int, input().split())) x.sort() if n >= m: print(0) else: diff = [abs(x[i] - x[i+1]) for i in range(m-1)] diff.sort(reverse=True) ans = sum(diff) for i in range(n-1): ans -= diff[i] print(ans) return 0 if __name__ == "__main__": solve()
p02766
s662415679
Accepted
a,b=map(int, input().split()) def Base_10_to_n(X, n): if (int(X/n)): return Base_10_to_n(int(X/n), n)+str(X%n) return str(X%n) x10 = a c = Base_10_to_n(a,b ) print( len(c) )
p02554
s087071473
Accepted
N = int(input()) if N == 1: print(0) exit() if N == 2: print(2) exit() # N >= 3 # 全事象 all_pattern = 10 ** N # 0も9もない pattern_a = 8 ** N # 0あるが9ない pattern_b = 9 ** N - 8 ** N ans = all_pattern - pattern_a - pattern_b * 2 ans = ans % (10**9 + 7) print(ans)
p02688
s110636729
Wrong Answer
NK = list(map(int, input().split())) ans = [0]*NK[0] for i in range(0,NK[1]): d = int(input()) table = list(map(int, input().split())) for j in range(1,NK[0]+1): if table.count(j) != 0: ans[j-1] = 1 print(NK[1]-sum(ans))
p03760
s119023133
Accepted
O = input() E = input() ans = "" while len(O)>0: ans += O[:1]+E[:1] O = O[1:] E = E[1:] print(ans)
p02785
s232920755
Accepted
n, k = map(int, input().split()) h = list(map(int, input().split())) h.sort(reverse = True) if k > n: k = n for i in range(k): h[i] = 0 ans = 0 for i in range(n): ans += h[i] print(ans)
p02729
s950046177
Accepted
N, M = map(int, input().strip().split()) a = max(N*(N-1)//2, 0) b = max(M*(M-1)//2, 0) print(a+b)
p02695
s769568348
Accepted
n,m,q=map(int,input().split()) q_list=[] for i in range(q): a=list(map(int,input().split())) q_list.append(a) import itertools ans=0 for i in itertools.combinations_with_replacement(range(1,m+1),n): # i=sorted(i) count=0 for a,b,c,d in q_list: if i[b-1]-i[a-1]==c: count+=d ans=max(count,ans) print(ans)
p02796
s337459067
Wrong Answer
#!/usr/bin/env python3 n = int(input()) X = [] L = [] T = [] for i in range(n): a, b = map(int, input().split()) T.append( (a-b, a+b) ) X.append(a) L.append(b) T.sort(key=lambda x: -x[1]) ans = 1 cur = T[0][0] for k, v in enumerate(T): if k == 0: continue if v[1] <= cur: ans += 1 cur = T[k][0] print(ans)
p02994
s778051715
Wrong Answer
n,l=map(int,input().split()) min =1000 ans = 0 for i in range(n): if(min > abs(i+l)): min = abs(i+l) ans = ans+i+l print(ans-min)
p03617
s369906286
Accepted
Q,H,S,D=map(int,input().split()) N=int(input()) q=Q*8 h=H*4 s=S*2 d=D if N%2==0: ans=(N//2)*min(q,h,s,d) print(ans) else: ans=(N//2)*min(q,h,s,d) q=Q*4 h=H*2 s=S ans+=min(q,h,s) print(ans)
p03087
s116813591
Wrong Answer
N,Q=map(int,input().split()) S=input() t=[0]*(N+1) for i in range(N): t[i+1]=t[i]+(1 if S[i:i+2] == 'AC' else 0) print(t) for i in range(Q): l,r=map(int,input().split()) print(t[r-1]-t[l-1])
p02631
s829110781
Accepted
n = int(input()) a = list(map(int, input().split())) s = 0 for i in a: s = s ^ i ans = [s ^ i for i in a] print(*ans, sep=' ')
p03012
s497338652
Accepted
N = int(input()) W = list(map(int,input().split())) for i in range(N-1): W[i+1]+=W[i] MIN = 10**8 for i in range(N-1): if MIN>abs(W[N-1]-2*W[i]): MIN = abs(W[N-1]-2*W[i]) print(MIN)
p02831
s360086874
Accepted
A,B=map(int,input().split()) from fractions import gcd print(int(A*B/gcd(A,B)))
p02835
s307501884
Accepted
a, b, c = map(int, input().split()) if a + b + c <= 21: print("win") else: print("bust")
p02755
s656299520
Accepted
import math a,b=map(int,input().split()) A=a/0.08 B=(a+1)/0.08 C=b/0.1 D=(b+1)/0.1 P=max(A,C) Q=min(B,D) if math.ceil(P)<Q: print(math.ceil(P)) else: print(-1)
p03774
s275951373
Accepted
n,m=map(int,input().split()) a=[] b=[] for i in range(n): a.append(list(map(int,input().split()))) for i in range(m): b.append(list(map(int,input().split()))) for i in range(n): tmp=10**9 for j in range(m): man=abs(a[i][0]-b[j][0]) + abs(a[i][1]-b[j][1]) if man < tmp: tmp=man ans=j+1 print(ans)