diff --git "a/valid.csv" "b/valid.csv" new file mode 100644--- /dev/null +++ "b/valid.csv" @@ -0,0 +1,116879 @@ +problem_id,submission_id,status,code +p02547,s702699872,Accepted,"n=int(input()) +D = [list(map(int,input().split())) for i in range(n)] +for i in range(n-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print(""Yes"") + break +else: + print(""No"")" +p02547,s003487850,Accepted,"n = int(input()) +li = [0]*n +for i in range(n): + d1,d2 = map(int,input().split()) + if d1==d2: + li[i] = 1 +lii = [0]*n +lii[0]=li[0] +for i in range(n-1): + if li[i+1]==1: + lii[i+1]=lii[i]+li[i+1] + else: + lii[i+1]=0 + +if max(lii)>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s849077240,Accepted,"n=int(input()) +q=[] +for _ in range(n): + d_1,d_2=map(int,input().split()) + if d_1==d_2: + q.append(1) + else: + q.append(0) +for i in range(n-2): + if q[i]==q[i+1]==q[i+2]==1: + print(""Yes"") + exit() +print(""No"")" +p02547,s056825648,Accepted,"def main(): + n = int(input()) + + cont = 0 + for _ in range(n): + a, b = map(int, input().split()) + if a == b: + cont += 1 + if cont >= 3: + print('Yes') + return + else: + cont = 0 + print('No') + + +if __name__ == '__main__': + main() +" +p02547,s706697739,Accepted,"n = int(input().rstrip()) +cnt = 0 +flg = False +d_list = [[0, 0] for i in range(n)] +for i in range(n): + d_list[i] = list(map(int, input().rstrip().split("" ""))) +for ds in d_list: + if ds[0] == ds[1]: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + flg = True + break +if flg: + print(""Yes"") +else: + print(""No"")" +p02547,s733223973,Accepted,"import sys + +def main(): + N = int(sys.stdin.readline().rstrip()) + + cnt = 0 + ans = ""No"" + for i in range(N): + a,b = map(int, sys.stdin.readline().rstrip().split()) + if a == b: + cnt += 1 + else: + cnt =0 + + if cnt == 3: + ans = ""Yes"" + + print(ans) + + +main()" +p02547,s676211455,Accepted,"LI = lambda: list(map(int, input().split())) + +N = int(input()) +D = [LI() for _ in range(N)] + + +def main(): + m = 0 + x = 0 + for a, b in D: + if a == b: + x += 1 + m = max(m, x) + else: + x = 0 + ans = ""Yes"" if m >= 3 else ""No"" + print(ans) + + +if __name__ == ""__main__"": + main() +" +p02547,s177766368,Accepted,"import numpy as np +n = int(input()) +d = np.array([input().split() for i in range(n)]) + +for i in range(n - 2): + if d[i, 0] == d[i, 1] and d[i + 1, 0] == d[i + 1, 1] and d[i + 2, 0] == d[i + 2, 1]: + print(""Yes"") + exit() + +print(""No"")" +p02547,s150835576,Accepted,"n=int(input()) +s=0 +l=0 +for i in range(n): + b,c=map(int,input().split()) + if b==c: + l+=1 + else: + l=0 + if l>=3: + s+=1 + +if s==0: + print(""No"") +else: + print(""Yes"")" +p02547,s823633845,Accepted,"n = int(input()) +a = [] +res = False +for i in range(n): + x, y = map(int, input().split()) + a.append(x == y) + if i >= 2 and a[-1] and a[-2] and a[-3]: + res = True +print('Yes' if res else 'No') +" +p02547,s351582822,Accepted,"N = int(input()) +ans = 0 +for i in range(N): + x, y = map(int, input().split()) + if x == y: + ans += 1 + else: + ans = 0 + if ans == 3: + break +if ans == 3: + print('Yes') +else: + print('No')" +p02547,s638419675,Accepted,"n = int(input()) +count = 0 +flag = False +for i in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + count += 1 + if count == 3: + flag = True + else: + count = 0 +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s152866798,Accepted,"n = int(input()) +cnt = 0 +ans = ""No"" +for i in range(n): + d1, d2 = map(int,input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + ans = ""Yes"" +print(ans)" +p02547,s722370148,Accepted,"n = int(input()) +c = 0 +for i in range(n): + a,b = map(int,input().split()) + if a == b: + c += 1 + else: + c = 0 + if c == 3: + break +if c == 3: + print(""Yes"") +else: + print(""No"")" +p02547,s106696776,Accepted,"N = int(input()) + +D1, D2 = [0] * N, [0] * N + +for i in range(N): + a, b = map(int, input().split()) + + D1[i], D2[i] = a, b + +for i in range(2, N): + + if D1[i-2] == D2[i-2] and D1[i-1] == D2[i-1] and D1[i] == D2[i]: + print(""Yes"") + exit() + +print(""No"") +" +p02547,s161146354,Accepted,"N = int(input()) + +i = 0 +res = False + +for _ in range(N): + a, b = map(int,input().split()) + + if a == b: + i += 1 + else: + i = 0 + + if i >= 3: + res = True + +print(""Yes"" if res else ""No"")" +p02547,s654545971,Accepted,"N = int(input()) +count = 0 +for i in range(N): + D1, D2 = map(int, input().split()) + if D1==D2: + count += 1 + else: + count = 0 + if count == 3: + print('Yes') + exit() +print('No') +" +p02547,s281958177,Accepted,"import sys +import math +def get_array(): return list(map(int, sys.stdin.readline().strip().split())) +def get_ints(): return map(int, sys.stdin.readline().strip().split()) +def input(): return sys.stdin.readline().strip() +n=int(input()) +ans=0 +flag=0 +for i in range(n): + d1,d2=get_ints() + if d1==d2: + ans=ans+1 + if ans>=3: + flag=1 + else: + ans=0 +if flag==1: + print(""Yes"") +else: + print(""No"")" +p02547,s895197771,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for i in range(n)] +cnt = 0 + +for i in range(n): + if d[i][0] == d[i][1]: + cnt += 1 + if cnt == 3: + print('Yes') + break + else: + cnt = 0 +else: + print('No')" +p02547,s518351150,Accepted,"N = int(input()) + +cnt = 0 +for i in range(N): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + exit() +print('No')" +p02547,s243540979,Accepted,"n = int(input()) + +c = 0 +flag = False + +for i in range(n): + x, y = list(map(int, input().split())) + if x == y: + c += 1 + if c == 3: + flag = True + break + else: + c = 0 + +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s128751717,Accepted,"N = int(input()) + +d = [ list(map(int,input().split())) for i in range(N)] + +for i in range(N-2): + if d[i][0] == d[i][1] and d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]: + print(""Yes"") + break +else: + print(""No"")" +p02547,s326896680,Accepted,"n=int(input()) +d1=[] +d2=[] +f=0 +for i in range(n): + x,y=map(int, input().split()) + d1.append(x) + d2.append(y) +for i in range(2,n): + if d1[i]==d2[i] and d1[i-1]==d2[i-1] and d1[i-2]==d2[i-2] : + f=1 +if f==1: + print('Yes') +else: + print('No')" +p02547,s927984583,Accepted,"n = int(input()) +cnt = 0 +flg = False +for i in range(n): + a,b = list(map(int,input().split())) + if a == b: + cnt +=1 + if cnt > 2: + flg = True + else: + cnt = 0 +if flg: + print('Yes') +else: + print('No')" +p02547,s540917350,Accepted,"def solve(): + N = int(input()) + + D1 = [0] * N + D2 = [0] * N + + for i in range(N): + D1[i], D2[i] = map(int, input().split()) + + c = 0 + judge = 0 + + for i in range(N): + if D1[i]==D2[i]: + c += 1 + else: + c = 0 + + if c>2: + judge += 1 + + if judge!=0: + print(""Yes"") + else: + print(""No"") + + +if __name__ == ""__main__"": + solve() +" +p02547,s998941842,Accepted,"N=int(input()) +flag=0 +count=0 +for i in range(N): + d1,d2=map(int,input().split()) + if(d1==d2): + count+=1 + else: + count=0 + if(count==3): + flag=1 + break +if(flag==1): + print(""Yes"") +else: + print(""No"")" +p02547,s969155046,Accepted,"n= int(input()) +cont=0 +yes=0 +for x in range(n): + a,b= input().split() + a, b= int(a), int(b) + if a==b: + cont+=1 + else: + cont=0 + if cont>=3: + yes=1 +if yes==1: + print(""Yes"") +else: + print(""No"")" +p02547,s300858855,Accepted,"N = int(input()) + +D = [] +for i in range(N): + d1, d2 = map(int, input().split()) + D.append([d1, d2]) + +count = 0 +for i in range(N): + if D[i][0] == D[i][1]: + count += 1 + if count == 3: + break + else: + count = 0 + +print(""Yes"") if count == 3 else print(""No"") +" +p02547,s032099533,Accepted,"N = int(input()) +flag = 0 +ans = ""No"" +for i in range(N): + A,B = input().split() + if A == B: + flag += 1 + else: + flag = 0 + if flag == 3: + ans = ""Yes"" + break + +print(ans)" +p02547,s458394018,Accepted,"n=int(input()) +cnt=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + cnt+=1 + if cnt==3: + print(""Yes"") + exit() + else: + cnt=0 +print(""No"") " +p02547,s350538019,Accepted,"n = int(input()) +count = 0 +ans = ""No"" +for i in range(n): + a,b = input().split() + if a == b: + count += 1 + else: + count = 0 + if count == 3: + ans =""Yes"" + +print(ans)" +p02547,s312770512,Accepted,"N = int(input()) + +xy = [map(int,input().split()) for _ in range(N)] +x,y = [list(i) for i in zip(*xy)] + +ans = 0 +flag = False + +for i in range(N): + if x[i] == y[i]: + ans +=1 + elif ans >= 3: + flag = True + ans = 0 + else: + ans = 0 + +if ans >= 3 or flag ==True: + print(""Yes"") + +else: + print(""No"")" +p02547,s211718590,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for x in range(N)] +flag = """" + +for p in range(N): + if D[p][0] == D[p][1]: + flag += ""1"" + else: + flag += ""0"" + +if ""111"" in flag: + print(""Yes"") +else: + print(""No"") + +" +p02547,s988935142,Accepted,"n=int(input()) +a=0 +h=0 +for i in range(n): + x,y=map(int,input().split()) + if x==y: + a=a+1 + else: + a=0 + if a==3: + h=1 +if h==1: + print(""Yes"") +else: + print(""No"")" +p02547,s856449591,Accepted,print('NYoe s'[' 1 1 1'in' '.join(str(len({*t.split()}))for t in open(0))::2]) +p02547,s607119976,Accepted,"import sys +input = sys.stdin.readline + + +def main(): + N = int(input()) + D = [list(map(int, input().split())) for _ in range(N)] + + zorome_count = 0 + for d in D: + if d[0] == d[1]: + zorome_count += 1 + else: + zorome_count = 0 + if zorome_count == 3: + break + + print('Yes' if zorome_count == 3 else 'No') + + +if __name__ == ""__main__"": + main() +" +p02547,s655544320,Accepted,"def checkDoublet(arr): + count = 0 + for d in arr: + if d[0] == d[1]: + count += 1 + if count >= 3: + return 'Yes' + else: + count = 0 + return 'No' + +n = int(input()) +arr = [] +for i in range(n): + arr.append(list(map(int, input().rstrip().split()))) +print(checkDoublet(arr))" +p02547,s649906186,Accepted,"def main(): + N = int(input()) + zorome_count = 0 + for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + zorome_count += 1 + else: + zorome_count = 0 + + if zorome_count == 3: + print('Yes') + return + print('No') + +if __name__ == '__main__': + main()" +p02547,s574351674,Accepted,"N = int(input()) + +ans = 0 +for i in range(N): + d1,d2 = map(int, input().split()) + if d1 == d2: + ans += 1 + if ans == 3: + print(""Yes"") + exit() + else: + ans = 0 +else: + print(""No"")" +p02547,s747823865,Accepted,"# author: Taichicchi +# created: 19.09.2020 21:01:22 + +import sys + +N = int(input()) + +c = 0 + + +for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + c += 1 + else: + c = 0 + if c == 3: + print(""Yes"") + exit() + +print(""No"") +" +p02547,s322885101,Accepted,"N = int(input()) +count = 0 +flg = False +for i in range(N): + + d1,d2 = map(int,input().split()) + if d1 == d2: + count += 1 + if count ==3: + flg = True + else: + count = 0 +if flg: + print(""Yes"") +else: + print(""No"")" +p02547,s782543432,Accepted,"n = int(input()) +d = [list(map(int, input().split()))for _ in range(n)] + +cnt = 0 +for i, (p, q) in enumerate(d): + if p == q: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s354859689,Accepted,"n = int(input()) + +a = [0]*n + +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + a[i] = 1 +ans = 'No' +for i in range(n-2): + if a[i]*a[i+1]*a[i+2] ==1: + ans = 'Yes' + +print(ans)" +p02547,s293648401,Accepted,"def main(): + import sys + N=int(sys.stdin.readline()) + count=0 + for i in range(N): + D1,D2=list(map(int,sys.stdin.readline().split())) + if D1==D2: + count+=1 + else: + count=0 + if count==3: + print('Yes') + break + else: + print('No') + +main()" +p02547,s161905407,Accepted,"def myfunc(): + N = int(input()) + + counter = 0 + for i in range(N): + A, B = map(int, input().split()) + if A == B: + counter += 1 + if counter >= 3: + print('Yes') + return 0 + else: + counter = 0 + print('No') + +if __name__ == ""__main__"": + myfunc()" +p02547,s960040996,Accepted,"N = int(input()) +D = [None] * N +for i in range(N): + D[i] = list(map(int, input().split())) +for i in range(N-2): + for j in range(3): + if D[i+j][0] != D[i+j][1]: + break + else: + print('Yes') + exit() +print('No') +" +p02547,s126399967,Accepted,"# import sys; input = sys.stdin.buffer.readline +# sys.setrecursionlimit(10**7) +from collections import defaultdict +mod = 10 ** 9 + 7; INF = float(""inf"") + +def getlist(): + return list(map(int, input().split())) + +def inverse(N, mod): + return (pow(N, mod - 2, mod)) + +def main(): + N = int(input()) + L = [] + for i in range(N): + D1, D2 = getlist() + if D1 == D2: + L.append(1) + else: + L.append(0) + + for i in range(N - 2): + if L[i] + L[i + 1] + L[i + 2] == 3: + print(""Yes"") + return + + print(""No"") + + + + +if __name__ == '__main__': + main()" +p02547,s791743981,Accepted,"N=int(input()) +sum=0 +ans=""No"" +for i in range(N): + d=list(map(int,input().split())) + if d[0]==d[1]: + sum+=1 + if sum>2: + ans=""Yes"" + break + else: + sum=0 +print(ans)" +p02547,s543347343,Accepted,"import sys +S = int(input()) +xy = [map(int, input().split()) for _ in range(S)] +x, y = [list(i) for i in zip(*xy)] +count = 0 + +for i in range(S): + if x[i] == y[i]: + count += 1 + if count == 3: + print(""Yes"") + sys.exit() + else: + pass + else: + count = 0 +print(""No"")" +p02547,s190785365,Accepted,"n = int(input()) + +dices = [] + +successive_cnt = 0 + +for i in range(n): + d, e = [int(x) for x in input().split(' ')] + + if d == e: + successive_cnt += 1 + else: + successive_cnt = 0 + + if successive_cnt == 3: + break + +if successive_cnt == 3: + print('Yes') +else: + print('No')" +p02547,s923062211,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for i in range(N)] +for i in range(N-2): + if D[i][0] == D[i][1]: + if D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print('Yes') + exit() +print('No')" +p02547,s826086455,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +ans = ""No"" +cnt = 0 + +for i in range(N): + if len(set(D[i])) == 1: + cnt += 1 + else: + cnt = 0 + + if cnt >= 3: + ans = ""Yes"" + +print(ans)" +p02547,s758354257,Accepted,"L=0 +N=int(input()) +for i in range(N): + a,b=map(int,input().split()) + if a==b: + L+=1 + if L==3: + print(""Yes"") + exit() + else: + L=0 +print(""No"")" +p02547,s088278562,Accepted,"# coding: utf-8 + +def main(): + n = int(input()) + count = 0 + for _ in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + count = 0 + if count >= 3: + print('Yes') + return + print('No') + +main() + +" +p02547,s718515338,Accepted,"N = int(input()) +number = [0]*N +for i in range(N): + a,b = map(int,input().split()) + if a==b: + number[i]=1 + +for i in range(N-2): + if number[i]==1 and number[i+1]==1 and number[i+2]==1: + print(""Yes"") + exit(0) + +print(""No"") +" +p02547,s287810989,Accepted,"#coding:utf-8 + +N = int(input()) + +D = [] + +for i in range(N): + d1,d2 = map(int,input().split()) + + D.append(d1==d2) + +for i in range(N-2): + if D[i] and D[i+1] and D[i+2]: + print(""Yes"") + break + + if i == N-3: + print(""No"")" +p02547,s396007019,Accepted,"n = int(input()) # nは入力回数 +num_list = [list(map(int, input().split())) for _ in range(n)] +ans = ""No"" + +for i in range(n-2): + if num_list[i][0] == num_list[i][1] and num_list[i+1][0] == num_list[i+1][1] and num_list[i+2][0] == num_list[i+2][1]: + ans = ""Yes"" + +print(ans)" +p02547,s355127878,Accepted,"N = int(input()) + +now = 0 + +ans = ""No"" + +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: now += 1 + else: now = 0 + if now == 3: + ans = ""Yes"" + break + +print(ans)" +p02547,s792549085,Accepted,"N = int(input()) + +count = 0 +flag = False +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + count += 1 + else: + count = 0 + if count == 3: + flag = True + +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s827435553,Accepted,"n=int(input()) +arr=[] +for i in range(n): + arr.append(list(map(int,input().split()))) +flag=0 +for i in range(n-2): + if(arr[i][0]==arr[i][1] and arr[i+1][0]==arr[i+1][1] and arr[i+2][0]==arr[i+2][1]): + flag=1 + print(""Yes"") + break +if(flag==0): + print(""No"")" +p02547,s058759886,Accepted,"c=0 +for _ in range(int(input())): + a,b=map(int,input().split()) + if a==b: + c+=1 + if c==3: + print(""Yes"") + break + else: + c=0 +else: + print(""No"")" +p02547,s862118392,Accepted,"n = int(input()) +a = [] +for i in range(n): + l,m = map(int,input().split()) + a.append([l,m]) +f = 0 +for i in range(n-2): + if a[i][0] == a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]: + f = 1 +if f == 0: + print('No') +else: + print('Yes') +" +p02547,s493692217,Accepted,"count = 0 +for i in range(int(input())): + l = list(map(int, input().split())) + if l[0] == l[1]: + count += 1 + elif l[0] != l[1]: + count = 0 + if count >= 3: + print(""Yes"") + break +if count < 3: + print(""No"") +" +p02547,s294504776,Accepted,"N = int(input()) +D = [False for _ in range(N)] +for i in range(N): + x, y = map(int, input().split()) + if x == y: + D[i] = True +tmp = 0 +for i in range(N - 2): + if D[i] == D[i + 1] == D[i + 2] == True: + print('Yes') + break +else: + print('No')" +p02547,s547707347,Accepted,"n = int(input()) +def count(): + count = 0 + result = '' + for i in range(n): + d1, d2 = map(int, input().split()) + if result == 'Yes': + continue + if d1 == d2: + count += 1 + if count == 3: + result = 'Yes' + else: + count = 0 + result = 'No' + return result + +print(count()) " +p02547,s133499973,Accepted,"n = int(input()) +d = [list( map( int, input().split() ) ) for i in range(n)] + +for i in range(n-2): + if d[i][0] == d[i][1]: + if d[i+1][0] ==d[i+1][1]: + if d[i+2][0] == d[i+2][1]: + print('Yes') + exit() +print('No')" +p02547,s174961295,Accepted,"import time +from math import ceil +from collections import defaultdict, deque + + +def A(s): + if s[-1] == 's': + return s + 'es' + return s + 's' + + +def B(n, d): + for i in range(n - 2): + if (d[i][0] == d[i][1] and d[i + 1][0] == d[i + 1][1] and + d[i + 2][0] == d[i + 2][1]): + return 'Yes' + return 'No' + + +def main(): + n = int(input()) + d = [list(map(int, input().split())) for i in range(n)] + print(B(n, d)) + + +if __name__ == '__main__': + main() +" +p02547,s904168178,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for _ in range(N)] + +ans = 0 + +for i in range(N-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + ans += 1 + else: + ans += 0 + +if ans >= 1: + print(""Yes"") +else: + print(""No"") +" +p02547,s876529582,Accepted,"n = int(input()) +cnt = 0 +ok = False +for _ in range(n): + x, y = map(int, input().split()) + if x == y: + cnt += 1 + if cnt >= 3: + ok = True + else: + cnt = 0 +print('Yes' if ok else 'No') +" +p02547,s320932694,Accepted,"N = int(input()) + +D = [] +for i in range(N): + Da,Db = (map(int,input().split())) + if Da == Db: + D.append(1) + else: + D.append(0) + +for i in range(N-2): + if D[i]==1 and D[i+1] == 1 and D[i+2] == 1: + ans = ""Yes"" + break + else: + ans = ""No"" +print(ans)" +p02547,s815704259,Accepted,"N = int(input()) + +count = 0 +ans = ""No"" +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + count += 1 + if count == 3: + ans = ""Yes"" + else: + count = 0 +print(ans)" +p02547,s904897320,Accepted,"n = int(input()) +cnt = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + print(""Yes"") + break + if cnt < 3 and i == n-1: + print(""No"")" +p02547,s112789857,Accepted,"n=int(input()) +l=[list(map(int,input().split())) for _ in range(n)] +for i in range(n-2): + if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]: + print('Yes') + exit() +print('No') + " +p02547,s599305372,Accepted,"n = int(input()) +cnt = 0 +flag = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3: + flag = 1 + break + else: + cnt = 0 + +if flag == 0: + print('No') +else: + print('Yes') + " +p02547,s844531437,Accepted,"N = int(input()) +zoro = [] +for _ in range(N): + a, b = map(int, input().split()) + zoro.append(a == b) + +for i in range(N - 2): + if zoro[i] and zoro[i + 1] and zoro[i + 2]: + print(""Yes"") + exit() + +print(""No"")" +p02547,s934151668,Accepted,"n = int(input()) +results = [list(map(int, input().split())) for _ in range(n)] +ans = 0 + +for i in range(n): + if ans >= 3: + break + if results[i][0] == results[i][1]: + ans += 1 + else: + ans = 0 +if ans >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s670451733,Accepted,"N = int(input()) +D = [input().split() for i in range(N)] +ans = 0 +for i in range(N-2): + if D[i][0] == D[i][1]: + if D[i+1][0] == D[i+1][1]: + if D[i+2][0] == D[i+2][1]: + ans = 1 + break +if ans == 0: + print('No') +else: + print('Yes')" +p02547,s706497773,Accepted,"num = int(input()) +count = 0 +for i in range(num): + ab = input().split("" "") + a = int(ab[0]) + b = int(ab[1]) + if a == b: + count += 1 + if count >= 3: + break + else: + count = 0 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s565491231,Accepted,"import sys +n = int(input()) +ans = 0 +flag = False +for i in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + ans += 1 + else: + ans = 0 + if ans == 3: + flag = True +if flag == True: + print(""Yes"") +else: + print(""No"")" +p02547,s046845124,Accepted,"N=int(input()) +D=[map(int, input().split()) for i in range(N)] +x, y = [list(i) for i in zip(*D)] + +s=0 +l=[] +for i in range(N): + if x[i]==y[i]: + s+=1 + if i==N-1: + l.append(s) + elif x[i]!=y[i]: + l.append(s) + s=0 + +if max(l)>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s206397129,Accepted,"N = int(input()) + +x = 0 +for i in range(N): + a, b = map(int, input().split()) + if a == b: + x += 1 + else: + x = 0 + + if x >= 3: + print(""Yes"") + break +else: + print(""No"") " +p02547,s376099509,Accepted,"def main(): + from sys import stdin + + readline = stdin.readline + + N=int(readline().rstrip()) + + count=0 + + for i in range(N): + x,y = list(map(int,readline().rstrip().split())) + if ( x == y ): + count += 1 + if ( count >= 3): + break + else: + count = 0 + + + if ( count >= 3 ): + print('Yes') + else: + print('No') + +main()" +p02547,s629175165,Accepted,"import sys +input = sys.stdin.readline +sys.setrecursionlimit(10**6) +n=int(input().rstrip()) +cnt=0 +tmp=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + tmp+=1 + else: + cnt=max(cnt,tmp) + tmp=0 +cnt=max(cnt,tmp) + +if cnt>=3: + print(""Yes"") +else:print(""No"")" +p02547,s812073346,Accepted,"n = int(input()) +flg = False +tmp = 0 +ans = 0 +for i in range(n): + a, b = map(int, input().split()) + if not flg and a == b: + tmp = 1 + flg = True + elif flg and a == b: + tmp += 1 + else: + tmp = 0 + ans = max(ans, tmp) +print(""Yes"" if ans >= 3 else ""No"") +" +p02547,s782540818,Accepted,"import sys +input = sys.stdin.readline + +n = int(input()) + +cnt = 0 +for _ in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 + + if cnt == 3: + break + +if cnt == 3: + print('Yes') +else: + print('No')" +p02547,s716098100,Accepted,"n = int(input()) + +cnt = 0 +for i in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3: + print(""Yes"") + exit() + else: + cnt = 0 +else: + print(""No"")" +p02547,s750814217,Accepted,"n=int(input()) +l=[list(map(int,input().split())) for i in range(n)] +cnt=0 +for i in range(n-2): + if (l[i][0]==l[i][1]) and (l[i+1][0]==l[i+1][1]) and (l[i+2][0]==l[i+2][1]): + print(""Yes"") + exit() +print(""No"")" +p02547,s538111121,Accepted,"# 初期入力 +import sys +input = sys.stdin.readline #文字列では使わない +N = int(input()) +renzoku =0 +ans =""No"" +for _ in range(N): + d1,d2 = map(int, input().split()) + if d1 ==d2: + renzoku +=1 + if renzoku ==3: + print(""Yes"") + sys.exit() + else: + renzoku =0 +print(ans) + " +p02547,s704321029,Accepted,"N = int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +ans=""No"" +for i in range(0,N-2): + if x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]: + ans=""Yes"" +print(ans)" +p02547,s591146139,Accepted,"n = int(input()) +total = 0 +for i in range(n): + d = list(map(int,input().split())) + if d[0]==d[1]: + if total != 0: + total +=1 + if total ==3: + print('Yes') + break + else: + total = 1 + else: + total = 0 +if total !=3: + print('No')" +p02547,s714880457,Accepted,"N = int(input()) +D1 = [0]*N +D2 = [0]*N + +for i in range(N): + D1[i], D2[i] = map(int, input().split()) + +a = 0 + +for i in range(N-2): + if D1[i] == D2[i] and D1[i+1] == D2[i+1] and D1[i+2] == D2[i+2]: + a = 1 + +if a == 1: + print(""Yes"") + +else: + print(""No"")" +p02547,s082742625,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +for i in range(2, N): + if D[i - 2][0] == D[i - 2][1] and D[i - 1][0] == D[i - 1][1] and D[i][0] == D[i][1]: + print('Yes') + exit() + +print('No')" +p02547,s282517962,Accepted,"a = int(input()) +l = [] +c,f =0, 0 +for i in range(a): + ta,tb = map(int,input().split()) + if ta==tb : c+=1 + else: c = 0 + if c>=3 : f = 1 +if f: + print(""Yes"") +else: + print(""No"") +" +p02547,s886520068,Accepted,"n = int(input()) +d_1 = [] +d_2 = [] + +for i in range(n): + a = list(map(int, input().split())) + d_1.append(a[0]) + d_2.append(a[1]) + +for i in range(n-2): + if d_1[i] == d_2[i] and d_1[i+1] == d_2[i+1] and d_1[i+2] == d_2[i+2]: + print(""Yes"") + exit() + +print(""No"")" +p02547,s882693915,Accepted,"n = int(input()) +d_lst = [list(map(int, input().split())) for _ in range(n)] + +flag = False +count = 0 +for i in range(n): + d1 = d_lst[i][0] + d2 = d_lst[i][1] + + if d1 == d2: + count += 1 + + if count == 3: + flag = True + + else: + count = 0 + +if flag: + print('Yes') +else: + print('No')" +p02547,s856209031,Accepted,"def main(): + count=0 + n=int(input()) + x = [list(map(int, input().split())) for i in range(n)] + for i in range(n): + if x[i][0]==x[i][1]: + count=count+1 + else: + count=0 + + if count==3: + print(""Yes"") + break + + + if count!=3: + print(""No"") + + + + + +if __name__ == '__main__': + main()" +p02547,s860858718,Accepted,"def func(): + count = 0 + for _ in range(N): + a, b = map(int, input().split()) + if a == b: + count += 1 + else: + count = 0 + if count >= 3: + return ""Yes"" + return ""No"" + + +N = int(input()) + +print(func()) +" +p02547,s302968847,Accepted,"n = int(input()) +d = [] +for _ in range(n): + d.append(list(map(int, input().split()))) + +cnt = 0 +for i in d: + if i[0] == i[1]: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + print('Yes') + exit() + +print('No') +" +p02547,s366685504,Accepted,"n = int(input()) +d = [input().split("" "") for _ in range(n)] + +f = False +for i in range(n-2): + if d[i][0] == d[i][1] and not f : + if d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]: + f = True +if f: + print(""Yes"") +else: + print(""No"")" +p02547,s329335594,Accepted,"N = int(input()) +dice = [tuple(map(int, input().split())) for _ in range(N)] +count = 0 +for d1, d2 in dice: + if d1 != d2: + count = 0 + continue + else: + count += 1 + if count == 3: + print('Yes') + break +else: + print('No')" +p02547,s849109895,Accepted,"n=int(input()) +ans=0 +c=True +d=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + d.append(i) +if len(d)<3: + print(""No"") +else: + j=0 + for i in range(1,len(d)-1): + + if d[i]-d[i-1]==1 and d[i+1]-d[i]==1: + print(""Yes"") + c=False + break + + if c==True: + print(""No"")" +p02547,s010473216,Accepted,"n = int(input()) +m = 0 +s = ""No"" +for i in range(n): + a,b = map(int, input().split()) + if a == b: + m += 1 + if m == 3: + s = ""Yes"" + break + elif a != b: + m = 0 +print(s)" +p02547,s010563244,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +for i, j, k in zip(range(N), range(1, N), range(2, N)): + if D[i][0] == D[i][1] and D[j][0] == D[j][1] and D[k][0] == D[k][1]: + print('Yes') + exit() +print('No') +" +p02547,s718024012,Accepted,"n = int(input()) +flag = 0 +max_ = 0 +for i in range(n): + d = list(map(int, input().split())) + if d[0] == d[1]: + flag += 1 + else: + flag = 0 + + if max_ < flag: + max_ = flag + +if max_ >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s188791806,Accepted,"def main(): + n = int(input()) + count = 0 + for _ in range(n): + a, b = [int(x) for x in input().split()] + if a == b: + count += 1 + else: + count = 0 + + if count >= 3: + return 'Yes' + return 'No' + + +if __name__ == '__main__': + print(main()) +" +p02547,s490965210,Accepted,"N = int(input()) +l = [] +for _ in range(N): + a, b = map(int, input().split()) + l.append((a, b)) + +cnt = 0 +for t in l: + if t[0] == t[1]: + cnt += 1 + if cnt >= 3: + break + else: + cnt = 0 +if cnt >= 3: + print('Yes') +else: + print('No') +" +p02547,s928785145,Accepted,"n=int(input()) +m=0 +l=0 +for i in range(n): + A,B=map(int,input().split()) + if (A==B): + m+=1 + else: + m=0 + if (m==3): + print(""Yes"") + l=1 + break + +if (l==0): + print(""No"")" +p02547,s645876120,Accepted,"n = int(input()) +cnt = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + if cnt == 3: + print(""Yes"") + exit() + else: + cnt = 0 + +print(""No"")" +p02547,s420149414,Accepted,"N = int(input()) +ans1 = False +ans2 = False +ans3 = False +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2 and ans1 == False: + ans1 = True + elif D1 == D2 and ans1 == True and ans2 == False: + ans2 = True + elif D1 == D2 and ans1 == True and ans2 == True and ans3 == False: + ans3 = True + print(""Yes"") + exit() + elif D1 != D2: + ans1 = False + ans2 = False + ans3 = False +print(""No"")" +p02547,s506331955,Accepted,"N = int(input()) +list_D = [list(map(int, input().split())) for i in range(N)] + +count = 0 +for i in range(N-2): + if list_D[N-i-1][0] == list_D[N-i-1][1] and list_D[N-i-2][0] == list_D[N-i-2][1] and list_D[N-i-3][0] == list_D[N-i-3][1]: + count += 1 +if count > 0: + print('Yes') +else: + print('No')" +p02547,s636616686,Accepted,"n = int(input().strip()) +count = 0 +for i in range(n): + a,b = map(int,input().strip().split()) + if count == 3: + print('Yes') + exit(0) + elif a == b: + count += 1 + elif(a != b): + count = 0 +if count == 3: + print('Yes') +else: + print('No') +" +p02547,s547725422,Accepted,"N = int(input()) + +count = 0 +for _ in range(N): + D = map(int, input().split()) + D = list(D) + if D[0] == D[1]: + count += 1 + if count >= 3: + print('Yes') + break + continue + count = 0 +else: + print('No')" +p02547,s078672753,Accepted,"s = int(input()) +count = 0 + +for i in range(s): + dice1, dice2 = map(int, input().split()) + if dice1 == dice2: + count += 1 + if count >= 3: + print(""Yes"") + break + else: + count = 0 +else: + print(""No"")" +p02547,s259017478,Accepted,"# -*- coding: utf-8 -*- +N = int(input()) + +counter = 0 +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + counter += 1 + else: + counter = 0 + if counter == 3: + break + +print(""Yes"" if counter == 3 else ""No"")" +p02547,s593476248,Accepted,"N = int(input()) +D = [[0 for j in range(2)] for i in range(N)] +c, t = 0, 0 + +for i in range(N): + D[i][0], D[i][1] = map(int, input().split()) + if D[i][0] == D[i][1]: + c += 1 + else: + c = 0 + if c == 3: + t = 1 +if t == 1: + print('Yes') +else: + print('No')" +p02547,s224478658,Accepted,"n = int(input()) +c = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + c += 1 + else: + c = 0 + if c >= 3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s452625624,Accepted,"n = int(input()) + +d1 = [0]*n +d2 = [0]*n + +for i in range(n): + d1[i], d2[i] = map(int, input().split()) + +for i in range(n-2): + if d1[i] == d2[i]: + if d1[i+1] == d2[i+1]: + if d1[i+2] == d2[i+2]: + print('Yes') + exit(0) + +print('No')" +p02547,s151454076,Accepted,"N = int(input()) +cnt = 0 +ans = 'No' +for i in range(N): + x,y = [int(x) for x in input().split()] + if x == y: + cnt += 1 + if cnt == 3: + ans = 'Yes' + else: + cnt = 0 + + +print(ans)" +p02547,s892410143,Accepted,"# coding: utf-8 +# Your code here! +import sys +readline = sys.stdin.readline +read = sys.stdin.read + +#n,q = map(int, readline().split()) +#*a, = map(int, readline().split()) + +n = int(input()) + +cnt = 0 +for i in range(n): + a,b = map(int, readline().split()) + if a==b: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s967447344,Accepted,"n = int(input()) +lis = [list(map(int,input().split())) for _ in range(n)] + +cnt = 0 +flg = 0 + +for i in lis: + if i[0]==i[1]: + cnt += 1 + if cnt >= 3: + flg = 1 + else: + cnt = 0 + +if flg == 1: + print('Yes') +else: + print('No')" +p02547,s178624451,Accepted," +N=int(input()) + +ok=False +count=0 +for i in range(N): + d1,d2=map(int, input().split()) + if d1==d2: + count+=1 + else: + count=0 + + if count==3: + ok=True + break + +if ok: + print(""Yes"") +else: + print(""No"")" +p02547,s382109701,Accepted,"n = int(input()) +lst = [ [ int(i) for i in input().split() ] for j in range(n) ] +r = 0 +for i in range(n-2): + if lst[i][0] == lst[i][1]: + if lst[i+1][0] == lst[i+1][1]: + if lst[i+2][0] == lst[i+2][1]: + r = 1 +if r == 0: + print(""No"") +else: + print(""Yes"")" +p02547,s227083533,Accepted,"n = int(input()) +c = 0 +flag = False +for _ in range(n): + a, b = map(int, input().split()) + if a == b: + c += 1 + if c >= 3: + flag = True + else: + c = 0 +print('Yes' if flag else 'No')" +p02547,s583841298,Accepted,"N = int(input()) +c = 0 +for i in range(N): + a, b = map(int, input().split()) + if a == b: + c += 1 + else: + c =0 + if c == 3: + break +if c == 3: + print(""Yes"") +else: + print(""No"") + " +p02547,s801693512,Accepted,"n=int(input()) +count=0 +counts=[] +z=[] +for i in range(n): + x,y=list(map(int,input().split())) + z.append([x,y]) +z.append([-14,-20]) +for i in z: + if i[0]==i[1]: + count+=1 + else: + counts.append(count) + count=0 +if max(counts)>=3: + print('Yes') +else: + print('No')" +p02547,s314549772,Accepted,"n = int(input()) +c = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if(d1 == d2): + c += 1 + else: + c = 0 + if(c >= 3): + print(""Yes"") + exit() +print(""No"")" +p02547,s871839492,Accepted,"N = int(input()) +ans = False +count = 0 +D1, D2 = 0, 0 +for i in range(N): + D1, D2 = list(map(int, input().split())) + if D1 == D2: + count += 1 + if count >= 3: + ans = True + else: + count = 0 + +if ans == True: + print(""Yes"") +else: + print(""No"")" +p02547,s523999741,Accepted,"n=int(input()) +c=0 +m=1 +for i in [0]*n: + a,b=map(int,input().split()) + if a==b: + c+=1 + if c==3: + m=0 + else: + c=0 +print('YNeos'[m==1::2])" +p02547,s339048537,Accepted,"N = int(input()) +count = 0 +for i in range(N): + a, b = map(int, input().split()) + if a == b: + count += 1 + else: + count = 0 + if count == 3: + break +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s655578303,Accepted,"N = int(input()) +sub_yes = 0 +max_yes = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + sub_yes += 1 + if sub_yes > max_yes: + max_yes = sub_yes + else: + if sub_yes > max_yes: + max_yes = sub_yes + sub_yes = 0 +if max_yes >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s324097292,Accepted,"n = int(input()) +s = 0 +b = False +for _ in range(n): + w = input().split() + if w[0] == w[1]: + s += 1 + if s == 3: + b = True + break + else: + s = 0 +print('Yes' if b else 'No') +" +p02547,s380510734,Accepted,"N = int(input()) + +isDouble = [] + +for i in range(N): + temp = [int(j) for j in input().split("" "")] + if temp[0] == temp[1]: + isDouble.append(1) + else: + isDouble.append(0) + +cnt = 0 +flg = False + +for i in range(len(isDouble)): + if isDouble[i] == 0: + cnt = 0 + else: + cnt += isDouble[i] + if cnt == 3: + flg = True + break + +if flg: + print(""Yes"") +else: + print(""No"")" +p02547,s271418304,Accepted,"#!/usr/bin/python3 +# -*- coding: utf-8 -*- +n = int(input()) +check_list = [] +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + check_list.append(1) + else: + check_list.append(0) +flag = 0 +for i in range(n - 2): + if sum(check_list[i:(i+3)]) == 3: + flag = 1 + break +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s714725791,Accepted,"n=int(input()) +xy = [map(int, input().split()) for _ in range(n)] +x, y = [list(i) for i in zip(*xy)] +a=0 +for i in range(n): + if x[i]==y[i]: + a+=1 + if a==3: + break + else: + a=0 + +if a>=3: + print(""Yes"") +else: + print(""No"") +" +p02547,s156124000,Accepted,"N = int(input()) +count = 0 +for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + if count >= 3: + print(""Yes"") + break + else: + count = 0 +if count < 3: + print(""No"") +" +p02547,s368110180,Accepted,"n=int(input()) +x,y=[],[] +for i in range(n): + x_,y_=map(int,input().split()) + x.append(x_) + y.append(y_) +for i in range(n-2): + if x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]: + print(""Yes"") + break +else: + print(""No"")" +p02547,s152767180,Accepted,"N = int(input()) +flug = False +cnt = 0 +for _ in range(N): + D1, D2 = list(map(int, input().split())) + if D1 == D2: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + flug = True +if flug: + print(""Yes"") +else: + print(""No"")" +p02547,s174664619,Accepted,"n=int(input()) +cnt=0 +ans=""No"" +for i in range(n): + d,k=map(int,input().split()) + if d==k: + cnt+=1 + else: + cnt=0 + if cnt==3: + ans=""Yes"" + break +print(ans)" +p02547,s403275119,Accepted,"import sys + +n = int(input()) + +n_concecutive = 0 + +for _ in range(n): + d1, d2 = map(lambda x: int(x), input().split()) + if d1 == d2: + n_concecutive += 1 + if n_concecutive >= 3: + print('Yes') + sys.exit() + else: + n_concecutive = 0 +print('No')" +p02547,s202669114,Accepted,"N=int(input()) +D1,D2=[],[] +for i in range(N): + d1,d2=map(int,input().split()) + D1.append(d1) + D2.append(d2) + +flag=False +for i in range(2,N): + if D1[i-2]==D2[i-2] and D1[i-1]==D2[i-1] and D1[i]==D2[i]: + flag=True + break + +if flag: + print('Yes') +else: + print('No')" +p02547,s770702245,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] + +cnt = 0 +ans = 0 +for d1, d2 in d: + if d1 == d2: + cnt += 1 + if cnt >= 3: + print('Yes') + exit() + else: + cnt = 0 + +print('No')" +p02547,s899033955,Accepted,"N = int(input()) +D = [input().split() for i in range(N)] + +ans = 'No' +for i in range(N-2): + if D[i][0] == D[i][1] : + if D[i+1][0] == D[i+1][1] : + if D[i+2][0] == D[i+2][1] : + ans = 'Yes' + +print(ans)" +p02547,s930162797,Accepted,"import sys + +input = sys.stdin.readline + + +def main(): + N = int(input()) + ans = False + p = 0 + for i in range(N): + D = list(map(int, input().split())) + if D[0] == D[1]: + p += 1 + else: + p = 0 + if p == 3: + ans = True + break + if ans: + print('Yes') + else: + print('No') + + +if __name__ == '__main__': + main() +" +p02547,s681993283,Accepted,"N=int(input()) +cnt = 0 +ans = 0 +for i in range(N): + D1,D2 = map(int,input().split()) + if D1 == D2: + cnt += 1 + if cnt == 3: + ans += 1 + print(""Yes"") + break + else: + cnt = 0 +if ans == 0: + print(""No"") +" +p02547,s306543988,Accepted,"n = int(input()) +cnt = 0 +for _ in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + print('Yes') + exit() +print('No')" +p02547,s976640080,Accepted,"n = int(input()) + +count_max = 0 +count = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + count_max = max(count_max, count) + else: + count = 0 +print(""Yes"" if count_max >= 3 else ""No"")" +p02547,s826516238,Accepted,"n = int(input()) +num = 0 +flag = True +for _ in range(n): + a,b = map(int,input().split()) + if a ==b:num +=1 + else: num =0 + if num ==3: + flag= False + print('Yes') + break +if(flag):print('No')" +p02547,s945890803,Accepted,"n = int(input()) +c = 0 +for i in range(n): + x,y=map(int,input().split()) + if x==y: + c+=1 + else: + c=0 + if c==3: + print('Yes') + break +else: + print(""No"")" +p02547,s941233931,Accepted,"import sys + +N = int(input()) +D = [list(map(int, input().split())) for D in range(N)] +count = 0 + +for i in range(N): + if D[i][0] == D[i][1]: + count += 1 + if count == 3: + print('Yes') + sys.exit() + else: + count = 0 + +print('No')" +p02547,s967614682,Accepted,"def main(): + n = int(input()) + count = 0 + res = False + for _ in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + if count >= 3: + res = True + else: + count = 0 + if res: + print(""Yes"") + else: + print(""No"") + + +if __name__ == ""__main__"": + main()" +p02547,s819218033,Accepted,"N = int(input()) +D = [tuple(map(int, input().split())) for _ in range(N)] +cnt = 0 +for d1, d2 in D: + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + exit() +print('No')" +p02547,s902048464,Accepted,"n = int(input()) + +count = 0 +ans = False +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + count = 0 + + if count == 3: + ans = True + break + +print('Yes') if ans else print('No') +" +p02547,s523730737,Accepted,"#from collections import deque,defaultdict +printn = lambda x: print(x,end='') +inn = lambda : int(input()) +inl = lambda: list(map(int, input().split())) +inm = lambda: map(int, input().split()) +ins = lambda : input().strip() +DBG = True # and False +BIG = 10**18 +R = 10**9 + 7 +#R = 998244353 + +def ddprint(x): + if DBG: + print(x) + +n = inn() +x = 0 +for i in range(n): + d,e = inm() + if d==e: + x += 1 + if x==3: + print('Yes') + exit() + else: + x = 0 +print('No') +" +p02547,s801531419,Accepted,"n = int(input()) +cnt = 0 +for i in range(n): + a,b = map(int,input().split()) + if a==b: + cnt+=1 + else: + cnt = 0 + if cnt ==3: + print('Yes') + exit() +print('No')" +p02547,s951382112,Accepted,"import sys +n=int(input()) +ans=0 +for i in range(n): + d1,d2=map(int,input().split()) + if ans==3: + continue + if d1==d2: + ans+=1 + else: + ans=0 +if ans==3: + print(""Yes"") +else: + print(""No"")" +p02547,s693693967,Accepted,"n = int(input()) +ans = 0 +f1, f2, f3 = 0, 0, 0 +for i in range(n): + f3 = f2 + f2 = f1 + d1, d2 = map(int, input().split()) + f1 = d1 == d2 + if f1 == f2 == f3 == 1: + ans = 1 +print('Yes' if ans else 'No')" +p02547,s633152307,Accepted," +def main(): + n = int(input()) + count = 0 + + for i in range(n): + a, b = map(int, input().split()) + if a == b: + count += 1 + else: + count = 0 + + if count >= 3: + print(""Yes"") + return + + print(""No"") + +main() +" +p02547,s376062752,Accepted,"import sys +## io ## +def IS(): return sys.stdin.readline().rstrip() +def II(): return int(IS()) +def MII(): return list(map(int, IS().split())) +def MIIZ(): return list(map(lambda x: x-1, MII())) +#======================================================# +def main(): + n = II() + dd = [MII() for i in range(n)] + cnt = 0 + for d1, d2 in dd: + if d1 != d2: + cnt = 0 + else: + cnt += 1 + if cnt == 3: + print('Yes') + return + print('No') + +if __name__ == '__main__': + main()" +p02547,s830004504,Accepted,"import sys + +def I(): return int(sys.stdin.readline()) +def MI(): return map(int, sys.stdin.readline().split()) +def LI(): return list(map(int, sys.stdin.readline().split())) +def main(): + n = I() + ans = 0 + temp = 0 + for _ in range(n): + d1, d2 = MI() + if d1 == d2: + temp += 1 + else: + temp = 0 + ans = max(ans, temp) + if ans >= 3: + print('Yes') + else: + print('No') + +if __name__ == '__main__': + main()" +p02547,s256694142,Accepted,"def resolve(): + import sys + input = sys.stdin.readline + + n = int(input().rstrip()) + count = 0 + for i in range(n): + d1, d2 = [int(x) for x in input().rstrip().split("" "")] + if d1 == d2: + count += 1 + if count >= 3: + print(""Yes"") + return + else: + count = 0 + + print(""No"") + + +if __name__ == ""__main__"": + resolve() +" +p02547,s904887589,Accepted,"N = int(input()) +counter =0 +for i in range(N): + D = list(map(int, input().split(' '))) + if (D[0]==D[1]): + counter = counter+1 + else: + counter = 0 + if (counter==3): + print('Yes') + exit(0) +print('No')" +p02547,s296439360,Accepted,"# +# 179B +# +n = input() +n = int(n) +s = '' +for i in range(n): + t = input() + t = t.replace(' ','') + t = list(t) + if t[0]==t[1]: + s = s+'1' + else: + s = s+'0' + +if '111' in s: + print('Yes') +else: + print('No') +" +p02547,s733819415,Accepted,"n = int(input()) +t = 0 +f = False +for i in range(n): + a,b = map(int, input().split()) + if a == b: + t += 1 + else: + t = 0 + if t>= 3: + f = True + # break + +if f: + print(""Yes"") +else: + print(""No"") + + +" +p02547,s452127274,Accepted,"N = int(input()) +x = [0] * N +y = [0] * N +for i in range(N): + x[i], y[i] = map(int, input().split()) + +ansl=[] +ans=0 +for i in range(N): + if x[i]==y[i]: + ans+=1 + else: + ansl.append(ans) + ans=0 +ansl.append(ans) +if max(ansl)>=3: + print('Yes') +else: + print('No')" +p02547,s699100820,Accepted,"N = int(input()) +D = [tuple(map(int, input().split())) for _ in range(N)] +c = 0 +for a, b in D: + if a == b: c += 1 + else: c = 0 + if c >= 3: + print('Yes') + exit() +print('No') +" +p02547,s424670673,Accepted,"n = int(input()) +count = 0 + +for i in range(n): + d1,d2 = map(int,input().split()) + if(d1 == d2): + count += 1 + else: + count = 0 + if(count == 3): + print(""Yes"") + break + +if(count != 3): + print(""No"") +" +p02547,s506231570,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] + +exist = False +for i in range(n-2): + for j in range(3): + if d[i+j][0] != d[i+j][1]: + break + else: + exist = True +if exist: + print('Yes') +else: + print('No')" +p02547,s249030121,Accepted,"n=int(input()) +score=[] +point=0 +for i in range(n): + d=input().split() + if d[0]==d[1]: + point+=1 + score.append(point) + else: + point=0 + score.append(point) + +if max(score)>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s709998689,Accepted,"N=int(input()) +flag = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1==d2: + if flag<2: + flag+=1 + else: + print(""Yes"") + exit() + else: + flag = 0 +print(""No"")" +p02547,s304488739,Accepted,"N = int(input()) +c1 = 0 +c2 = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + c1 += 1 + else: + c1 = 0 + if c1 == 3: + c2 += 1 +if c2 > 0: + print(""Yes"") +else: + print(""No"")" +p02547,s562101934,Accepted,"N = int(input()) +count = 0 +for i in range(N): + D1,D2 = map(int,input().split()) + if D1 == D2: + count += 1 + if count == 3: + print('Yes') + exit() + else: + count = 0 +print('No')" +p02547,s998006633,Accepted,"n = int(input()) +s = ""aaa"" +for i in range(n): + d1 , d2 = map(int,input().split("" "")) + if d1 == d2: + s += ""b"" + else: + s += ""c"" + +if ""bbb"" in s: + print(""Yes"") +else: + print(""No"")" +p02547,s882627962,Accepted,"N = int(input()) + + +isSucceed = False +cnt = 0 +f = False +for _ in range(N): + d1, d2 = map(int,input().split()) + if d1 == d2: + if not isSucceed: + isSucceed = True + cnt = 1 + else: + cnt += 1 + if cnt >= 3: + f = True + + else: + isSucceed = False + cnt = 0 + +if f: + print(""Yes"") +else: + print(""No"") + + +" +p02547,s741366660,Accepted,"x=int(input()) +List=[] +counter=0 +for i in range(x): + List.append(list(map(int,input().split()))) +for i in range(len(List)): + if List[i][0]==List[i][1]: + counter+=1 + else: + counter=0 + if counter ==3: + print(""Yes"") + break +if counter<3: + print(""No"")" +p02547,s930115992,Accepted,"N=int(input()) +d=[0]*N;D=[0]*N +s=0 +for i in range(N): + d[i],D[i]=map(int,input().split()) + if d[i]==D[i]:s+=1 + else:s=0 + if s==3: + print('Yes') + exit() + +print('No')" +p02547,s390732226,Accepted,"N = int(input()) +cnt = 0 +for _ in range(N): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + + if cnt == 3: + print('Yes') + exit() +print('No')" +p02547,s145852240,Accepted,"n = int(input()) +flag = 0 +flagg = 1 +for _ in range(n): + a, b = map(int, input().split()) + if flagg: + if a==b: + flag+=1 + else: + flag = 0 + if flag==3: + print('Yes') + flagg = 0 +if flag<3: + print('No') +" +p02547,s486351011,Accepted,"import sys +input = sys.stdin.readline +def main(): + N = int(input()) + D = [list(map(int, input().split())) for i in range(N)] + cnt = 0 + for a, b in D: + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + return + print('No') + +if __name__ == '__main__': + main()" +p02547,s269848303,Accepted,"N = int(input()) +cnt = 0 +f = False +for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + f = True +if f: + print('Yes') +else: + print('No')" +p02547,s673650125,Accepted,"def main(): + n = int(input()) + cnt = 0 + for i in range(0, n): + d_1, d_2 = map(int, input().split()) + if d_1 == d_2: + cnt += 1 + else : + if cnt < 3 : + cnt = 0 + + if cnt >= 3: + print(""Yes"") + else : + print(""No"") +main()" +p02547,s819329894,Accepted,"N = int(input()) +x = [0] * N +y = [0] * N +for i in range(N): + x[i], y[i] = map(int, input().split()) + + + +n = 0 +for i in range(N): + if x[i] == y[i]: + n = n+1 + elif n >=3: + break + elif x[i] != y[i]: + n = 0 + +if n >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s985867827,Accepted,"N = int(input()) + +cnt = 0 +ans = 'No' + +for _ in range(N): + D = input().split() + cnt = (cnt + 1)*(D[0] == D[1]) + if cnt == 3: + ans = 'Yes' + +print(ans)" +p02547,s220589891,Accepted,"def get_pair(): + return map(int, input().split()) + +cnt = 0 +ans = ""No"" +for idx in range(int(input())): + D1, D2 = get_pair() + if D1 == D2: + cnt += 1 + else: + cnt = 0 + + if cnt >= 3: + ans = ""Yes"" + break +print(ans)" +p02547,s649197230,Accepted,"N = int(input()) +ans = 'No' +ls = [] +for i in range(N): + d1,d2 = map(int,input().split()) + ls.append([d1,d2]) +ii = 0 +for i in range(N): + if ls[i][0] == ls[i][1]: + ii += 1 + else: + ii = 0 + + if ii == 3: + ans = 'Yes' + break +print(ans)" +p02547,s925212137,Accepted,"n=int(input()) +zoro=0 +for i in range(n): + d1,d2=map(int,input().split()) + if d1==d2: + zoro+=1 + else: + zoro=0 + if zoro==3: + print('Yes') + exit() +print('No')" +p02547,s513205569,Accepted,"n=int(input()) +c=0 +for i in range(n): + a,b=map(int, input().split()) + if a==b: + c+=1 + if c==3: + print(""Yes"") + exit() + else: + c=0 +print(""No"")" +p02547,s440488086,Accepted,"N = int(input()) + +result = """" + +for _ in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + result += ""1"" + else: + result += ""0"" + +if ""111"" in result: + print(""Yes"") +else: + print(""No"")" +p02547,s719222592,Accepted,"n=int(input()) +count=0 +for i in range(n): + me1,me2=list(map(int,input().split())) + if me1==me2: + count+=1 + if count==3: + break + else: + count=0 +if count>=3: + print('Yes') +else: + print('No')" +p02547,s540221704,Accepted,"N=int(input()) +Di=[input() for i in range(N)] +count=0 +n=0 +D=[] +a=[] +A=0 +for i in range(N): + D.append(Di[i].split()) + +for i in range(N): + if D[i][0]==D[i][1]: + count+=1 + else: + a.append(count) + count=0 +if len(a)==0: + A=0 +else: + A=max(a) + +if A>count: + n+=A +else: + n+=count +if n>=3: + print(""Yes"") +else: + print(""No"") +" +p02547,s895032399,Accepted,"N = int(input()) +D_list = [] +for _ in range(N): + D1, D2 = map(int, input().split()) + D_list.append([D1, D2]) + +sequence_doublet = 0 +for D in D_list: + if D[0] == D[1]: + sequence_doublet += 1 + else: + sequence_doublet = 0 + + if sequence_doublet == 3: + break + +if sequence_doublet == 3: + print(""Yes"") +else: + print(""No"")" +p02547,s585253379,Accepted,"n = int(input()) +z = [] +y = 0 +for i in range(n): + line = input().split("" "") + if int(line[0])==int(line[1]): + z.append(i) + +for i in range(len(z)-2): + if z[i]==z[i+1]-1: + if z[i+1]==z[i+2]-1: + y += 1 +if y > 0: + print(""Yes"") +else: + print(""No"")" +p02547,s225685550,Accepted,"n = int(input()) +d1,d2 = [],[] +for _ in range(n): + a,b = map(int,input().split()) + d1.append(a) + d2.append(b) +check = True +for i in range(2,n): + if d1[i-2] == d2[i-2] and d1[i-1] == d2[i-1] and d1[i] == d2[i]: + print(""Yes"") + check = False + break +if check: + print(""No"")" +p02547,s600442066,Accepted,"n = int(input()) +d1, d2 = [], [] +for i in range(n): + a, b = input().split() + d1.append(int(a)) + d2.append(int(b)) + +count = 0 +for a, b in zip(d1, d2): + if a == b: + count += 1 + else: + count = 0 + if count == 3: + print('Yes') + break + +if count != 3: + print('No')" +p02547,s004789646,Accepted,"N = int(input()) + +count = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if(d1==d2): + count = count + 1 + else: + count = 0 + if(count == 3):break +if(count == 3): + print(""Yes"") +else: + print(""No"")" +p02547,s989891682,Accepted,"Count = 0 +Array = [] +for i in range(int(input())): + Dice_1, Dice_2 = map(int, input().split()) + if Dice_1 == Dice_2: + Array.append(1) + else: + Array.append(0) + +ans = [] +j_1 = 0 +for j in range(len(Array)): + if j_1 == 1 and Array[j] == 1: + Count = Count + 1 + else: + Count = 0 + j_1 = Array[j] + ans.append(Count) +if max(ans) >= 2: + print('Yes') +else: + print('No')" +p02547,s252309306,Accepted,"## coding: UTF-8 +N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +#print(N, D) + +ans = ""No"" +renzoku = 0 + +for i in range(N): + if(D[i][0] == D[i][1]): + renzoku += 1 + if(renzoku >= 3): + ans = ""Yes"" + else: + renzoku = 0 + +print(ans) + + + +" +p02547,s065239940,Accepted,"N = int(input()) +D = [input().split() for l in range(N)] + +zoro = [] +for i in range(N): + if D[i][0] == D[i][1]: + zoro.append(1) + else: + zoro.append(0) + +cnt = [] +for i in range(N-2): + cnt.append(zoro[i]+zoro[i+1]+zoro[i+2]) + + +zoro_cnt = 0 +for i in range(N-2): + if cnt[i] == 3: + zoro_cnt += 1 + + +if zoro_cnt >= 1: + print(""Yes"") +else: + print(""No"")" +p02547,s866734210,Accepted,"import sys +N = int(input()) +D = [] +for i in range(N): + D.append(input().split()) +cnt = 0 +for i in range(N): + if D[i][0] == D[i][1]: + cnt += 1 + if cnt == 3: + print(""Yes"") + sys.exit() + else: + cnt = 0 +print(""No"")" +p02547,s008716649,Accepted,"cnt = 0 +n = int(input()) +for i in range(n): + n,m = map(int,input().split()) + if n == m: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print(""Yes"") + exit() +print(""No"") + +" +p02547,s145042588,Accepted,"N=int(input()) +D=list() +for i in range(N): + tmp=list(map(int,input().split())) + D.append(tmp[0]==tmp[1]) +for i in range(N-2): + if D[i]==D[i+1]==D[i+2]==True: + print(""Yes"") + break +else: + print(""No"")" +p02547,s688058679,Accepted,"n=int(input()) +tmp=0 +flag=0 +for i in range(n): + x,y=map(int,input().split()) + if(x==y): + tmp+=1 + else: + tmp=0 + if(tmp==3): + flag=1 + break +if(flag): + print('Yes') +else: + print('No')" +p02547,s714378416,Accepted,"N = int(input()) +l = [0]*N +for i in range(N): + a,b = [int(x) for x in input().split()] + if a == b: + l[i] = 1 +for i in range(1,N): + if l[i] == 1: + l[i] = l[i-1] + 1 + else: + l[i] = 0 +if max(l) >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s106919715,Accepted,"n = int(input()) +D = [tuple(int(x) for x in input().split()) for _ in range(n)] +tmp = 0 +for d1, d2 in D: + if d1 == d2: + tmp += 1 + else: + tmp = 0 + if tmp == 3: + print(""Yes"") + exit() +print(""No"")" +p02547,s813107474,Accepted,"a = int(input()) +b = [] +c = """" +x = 0 +for i in range(a): + c = input().split() + if c[0] == c[1]: + x = x + 1 + else: + x = 0 + if x >= 3: + print(""Yes"") + exit() +if x <= 3: + print(""No"")" +p02547,s339963740,Accepted,"N=int(input()) +D=[list(map(int,input().split())) for i in range(N)] +tf=0 +for j in range(N-2):#Di1=Di2&Di+1_1=Di+1_2&Di1=Di2 3回連続ぞろ目 + if D[j][0]==D[j][1] and D[j+1][0]==D[j+1][1] and D[j+2][0]==D[j+2][1]: + tf=1 + break + +if tf==1: + print(""Yes"") +else: + print(""No"")" +p02547,s888329091,Accepted,"n=int(input()) +cnt=0 +for _ in range(n): + d=input().split() + if d[0]==d[1]: + cnt+=1 + else: + cnt=0 + if cnt==3: + print(""Yes"") + exit() +print(""No"") +" +p02547,s663121771,Accepted,"n = int(input()) +count = 0 +lis = [] +for i in range(n): + lis.append(list(map(int, input().split()))) + +for i in range(n): + if lis[i][0] == lis[i][1]: + count += 1 + else: + count = 0 + if count >= 3: + break +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s266176654,Accepted,"n = int(input()) +d = [] +for i in range(n): + d.append(list(map(int,input().split()))) +row = [] +for i in range(n): + if d[i][0]==d[i][1]: + row.append(True) + else: + row.append(False) +res = False +for i in range(n-2): + if all(row[i:i+3]): + res = True +if res: + print('Yes') +else: + print('No')" +p02547,s234693911,Accepted,"N=int(input()) +count = 0 +flag = ""No"" +for x in range(N): + a=input().split() + if (a[0]==a[1]): + count+=1 + if(count==3): + flag = ""Yes"" + else: + count = 0 +print(flag)" +p02547,s730249771,Accepted,"def main(): + N = int(input()) + cnt = 0 # 連続ゾロ目カウンター + ans = 'No' + + for n in range(N): + if len(set(map(int, input().split()))) == 1: # ゾロ目だったら + cnt += 1 + else: + cnt = 0 + if cnt >= 3: # 三回連続で出たら + ans = 'Yes' + else: + print(ans) + +if __name__ == '__main__': + main()" +p02547,s150802628,Accepted,"N = int(input()) + +D = [map(int, input().split()) for _ in range(N)] + +ans = 0 +flg = False +tmp = 0 +for c,d in D: + if c==d: + if flg: + tmp += 1 + ans = max(ans, tmp) + else: + tmp = 1 + flg = True + ans = max(ans, tmp) + else: + flg = False + +if ans >= 3: + print('Yes') +else: + print('No') +" +p02547,s671264013,Accepted,"N = int(input()) + +D = [list(map(int,input().split())) for i in range(N)] + +E = [D[i][0]==D[i][1] for i in range(N)] +flag = False +for i in range(N-2): + if E[i] and E[i+1] and E[i+2]: + flag=True + break + +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s690143865,Accepted,"def abc179b(): + n = int(input()) + cnt = 0 + flg = False + for _ in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + flg = True + if flg: + print('Yes') + else: + print('No') +abc179b()" +p02547,s207228179,Accepted,"N = int(input()) +check_list = [] +for _ in range(N): + a, b = input().split() + if a == b: + check_list.append(1) + else: + check_list.append(0) + +total_list = [] +for i in range(len(check_list) - 1): + total_list.append(sum(check_list[i:i + 3])) + +if max(total_list) >= 3: + print('Yes') +else: + print('No')" +p02547,s717792265,Accepted,"N = int(input()) + +count = 0 +flag = False +for i in range(N): + D1,D2 = map(int,input().split()) + if D1 == D2: + count += 1 + if count >= 3: + flag = True + else: + count = 0 + +if flag: + print(""Yes"") +else: + print(""No"") +" +p02547,s735943672,Accepted,"N = int(input()) + +count = 0 +ans = 0 +for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + count = 0 + if count == 3: + ans += 1 + +if ans > 0: + print(""Yes"") +else: + print(""No"")" +p02547,s531992872,Accepted,"def solve(): + n = int(input()) + ct = 0 + for _ in range(n): + a, b = input().split() + if a == b: + ct += 1 + if ct == 3: + return 'Yes' + else: + ct = 0 + return 'No' + + +print(solve())" +p02547,s767482800,Accepted,""""""" +abc179_B +"""""" +n = int(input()) +ans = 'No' + +a = [input().split() for i in range(n)] + +for i in range(0,n-2): + if a[i][0]== a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]: + ans = 'Yes' + break + +print(ans)" +p02547,s448110458,Accepted,"n = int(input()) + +cnt = 0 +l = [list(map(int,input().split())) for i in range(n)] +for i in range(n): + d1,d2 = l[i][0],l[i][1] + if(d1==d2): + cnt += 1 + else: + cnt = 0 + if(cnt == 3): + print('Yes') + exit() + +print('No') + " +p02547,s406366642,Accepted,"N=int(input()) +D=[] +for i in range(N): + D.append(list(map(int,input().split()))) +def total(N): + for i in range(N-2): + if D[i][0]==D[i][1] and D[i+1][0]==D[i+1][1] and D[i+2][0]==D[i+2][1]: + print('Yes') + return + print('No') + return +total(N)" +p02547,s755191842,Accepted,"N = int(input()) +cnt = 0 +ans = 'No' +for i in range(N): + d1,d2 = map(int, input().split()) + if d1==d2: + cnt += 1 + if cnt==3: + ans = 'Yes' + else: + cnt = 0 +print(ans)" +p02547,s141804910,Accepted,"n=int(input()) +cnt=0 +for _ in range(n): + d1,d2=map(int,input().split()) + if d1==d2: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + print('Yes') + break +else: + print('No')" +p02547,s308471879,Accepted,"N = int(input()) + +D = [[] for i in range(N+2)] + +for i in range(N) : + a = input().split() + D[i].append(int(a[0])) + D[i].append(int(a[1])) + a.clear() + +D[N].append(0) +D[N].append(1) + +D[N+1].append(0) +D[N+1].append(1) + +#print('N = ', N) +#print('D = ', D) + +judge = 'No' + +for i in range(N) : + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1] : + judge = 'Yes' + +print(judge) + +" +p02547,s107112347,Accepted,"i = int(input()) +count = 0 +res = False +for i in range(i): + a, b = input().split(' ') + if a == b: + count += 1 + else: + count = 0 + if count >= 3: + res = True +print('Yes' if res else 'No') +" +p02547,s237140469,Accepted,"n = int(input()) +count = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + count += 1 + else: + count = 0 + if count == 3: + print('Yes') + exit() +print('No')" +p02547,s899493008,Accepted,"def die(matrix, n): + for i in range(n-2): + if matrix[i][0] == matrix[i][1]: + if matrix[i+1][0] == matrix[i+1][1]: + if matrix[i+2][0] == matrix[i+2][1]: + return(""Yes"") + + return(""No"") + + + +n = int(input()) +matrix = [] +for i in range(n): + row = list(map(int, input().split())) + matrix.append(row) + + +print(die(matrix, n))" +p02547,s049769488,Accepted,"N=int(input()) +DD=[] +t=0 + +for _ in range(N): + D=list(map(int,input().split())) + DD.append(D) + +for i in range(N-2): + if (DD[i][0]-DD[i][1])**2+(DD[i+1][0]-DD[i+1][1])**2+(DD[i+2][0]-DD[i+2][1])**2==0: + t=1 + break + i+=1 +if t==1: + print('Yes') +else: + print('No')" +p02547,s560579046,Accepted,"n=int(input()) + +cnt=0 +ans=0 + +for i in range(n): + a,b=map(int,input().split()) + if a==b: + cnt+=1 + + else: + ans=max(ans,cnt) + cnt=0 + +ans=max(ans,cnt) + + +if ans>=3: + print('Yes') + +else: + print('No')" +p02547,s762786585,Accepted,"n = input() +x = 0 +flag = False +for i in range(int(n)): + a,b = input().split("" "") + if a == b: + x+=1 + else: x = 0 + if x==3: + flag = True +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s680012902,Accepted,"import sys + +n = int(input()) + +dice = [] + +for i in range(n): + dice.append(list(map(int,input().split()))) + +c = 0 + +for i in range(n): + if dice[i][0] == dice[i][1]: + c += 1 + else: + c = 0 + if c == 3: + print('Yes') + sys.exit() + +print('No') +" +p02547,s253635781,Accepted,"N = int(input()) +D = [] + +count = 0 +for i in range(N): + Di = list(map(int, input().split())) + D.append(Di) + +for i in range(N): + Di = D[i] + if Di[0] == Di[1]: + count += 1 + else: + count = 0 + if count >= 3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s258432045,Accepted,"_counter = 0 +_max = 0 +_throw = int(input()) + +for _i in range(_throw): + _numbers = list(map(int, input().split("" ""))) + if _numbers[0] == _numbers[1]: + _counter += 1 + if _counter > _max: + _max = _counter + else: + _counter = 0 + +if _max >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s489082041,Accepted,"n = int(input()) +x = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if x != 3: + if d1 != d2: + x = 0 + else: + x += 1 +print(""Yes"" if x == 3 else ""No"")" +p02547,s766903367,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for i in range(N)] +count = 0 +k = 0 +while count < 3 and k <= N-1: + if D[k][0] == D[k][1]: + count += 1 + else: + count = 0 + k+=1 + +if count == 3: + print('Yes') +else: + print(""No"") " +p02547,s170944370,Accepted,"# -*- coding: utf-8 -*- +# B + +import sys +from collections import defaultdict, deque +from heapq import heappush, heappop +import math +import bisect +input = sys.stdin.readline + +# 再起回数上限変更 +# sys.setrecursionlimit(1000000) + +n = int(input()) +d = [] * n * 2 +cnt = 0 +for _ in range(n): + a, b = map(int, input().split()) + d.append(a) + d.append(b) + if a == b: + cnt += 1 + if cnt == 3: + print('Yes') + sys.exit() + else: + cnt = 0 +print('No')" +p02547,s056048925,Accepted,"n = int(input()) + +ans = ""No"" +x = 0 +for _ in range(n): + d1, d2 = input().split() + if d1 == d2: + x += 1 + else: + x = 0 + + if x == 3: + ans = ""Yes"" + + +print(ans)" +p02547,s154657592,Accepted,"N = int(input()) + +ok = 0 +aa = 0 +for i in range(N): + A, B = map(int, input().split()) + if A == B: + aa += 1 + else: + aa = aa*0 + if aa == 3: + ok = 1 + + +if ok == 1: + print(""Yes"") +else: + print(""No"")" +p02547,s252377265,Accepted,"N = int(input()) +result = '0' +for i in range(N): + d1,d2 = map(int, input().split()) + if d1 == d2: + result += '1' + else: + result += '0' +if '111' in result: + print('Yes') +else: + print('No')" +p02547,s289191108,Accepted,"N = int(input()) +A = [] +B = [] +s = 0 +for x in range(N): + a, b = input().split() + a = int(a) + b = int(b) + A.append(a) + B.append(b) +for i in range(N): + if A[i] == B[i]: + s = s+1 + else: + if s >= 3: + s = s + 0 + else: + s = 0 +if s >= 3: + print('Yes') +else: + print('No') +" +p02547,s317077134,Accepted,"n = int(input()) +cou = 0 +ans = False +for i in range(n): + da, db = map(int, input().split()) + if da == db: + cou += 1 + else: + cou = 0 + if cou == 3: + ans = True + +if ans: + print('Yes') +else: + print('No')" +p02547,s945548308,Accepted,"import sys +input = sys.stdin.readline +N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] +result = 'No' +count = 0 +for i in range(N): + if D[i][0] == D[i][1]: + count += 1 + if count == 3: + result = 'Yes' + break + else: + count = 0 + +print (result) + +" +p02547,s305034272,Accepted,"N = int(input()) +zoro_count = 0 +zoro = False +for n in range(N): + dn1,dn2 = map(int, input().split()) + if dn1 == dn2: + zoro_count += 1 + else: + zoro_count = 0 + if zoro_count >= 3: + zoro = True +if zoro: + print('Yes') +else: + print('No')" +p02547,s592763271,Accepted,"N = int(input()) + +cnt = 0 +flag = 0 + +for i in range(N): + d1, d2 = map(int,input().split()) + + if d1 == d2: + cnt += 1 + if cnt >= 3: + flag = 1 + else: + cnt = 0 + +if flag == 1: + print('Yes') +else: + print('No')" +p02547,s786883664,Accepted,"n=int(input()) +c=0 +ans=False +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c+=1 + else: + c=0 + if c==3: + ans=True +if ans: + print('Yes') +else: + print('No')" +p02547,s940182311,Accepted,"import sys +from math import sqrt, gcd, ceil, log, floor +from bisect import bisect, bisect_left +from collections import defaultdict, Counter, deque +from heapq import heapify, heappush, heappop +input = sys.stdin.readline +read = lambda: list(map(int, input().strip().split())) + +# MOD = 10**9 + 7 +def main(): + f = 0; flag = 0 + for i in range(int(input())): + a, b = read() + if a == b:f+=1 + else:f = 0 + + if f == 3:flag |= 1 + print(""YNeos""[flag == 0::2]) + + + + + + + +if __name__ == ""__main__"": + main() +" +p02547,s662311543,Accepted,"N,*D=map(int,open(0).read().split()) +def main(): + cnt=0 + for i in range(0,N*2,2): + n1=D[i] + n2=D[i+1] + if n1==n2: + cnt+=1 + if cnt>=3: + return True + else: + cnt=0 + return False +if main(): + print(""Yes"") +else: + print(""No"")" +p02547,s265786873,Accepted,"# URL : https://atcoder.jp/contests/abc179/tasks/abc179_b +n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] +ok = False + + +def f(p): + return p[0] == p[1] + + +for i in range(n - 2): + a = True + for j in range(3): + a &= f(d[i + j]) + ok |= a +if ok: + print('Yes') +else: + print('No') +" +p02547,s074314757,Accepted,"n = int(input()) +a = [] +for i in range(n): + a.append(input().split()) +for i in range(len(a)-2): + if(a[i][0] == a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]): + print(""Yes"") + exit() +print(""No"")" +p02547,s116080257,Accepted,"N = int(input()) +zc = 0 +ret = ""No"" +for i in range(N): + a,b = map(int,input().split()) + if a == b: + zc += 1 + if zc == 3: + ret = ""Yes"" + else: + zc = 0 +print(ret)" +p02547,s257156464,Accepted,"n = int(input()) + +a = [] +for i in range(n): + d,e = map(int,input().split()) + a.append([d,e]) + + +b = [] +for i in range(n): + if a[i][0] == a[i][1]: + b.append(1) + else: + b.append(0) + +c = 0 +for i in range(n-2): + if b[i] == 1 and b[i+1] == 1 and b[i+2] == 1: + c = 1 + break + +if c == 1: + print(""Yes"") +else: + print(""No"") +" +p02547,s143549010,Accepted,"n = int(input()) +cnt = 0 +for _ in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + + if cnt == 3: + print(""Yes"") + exit() + +print(""No"")" +p02547,s700106435,Accepted,"n = int(input()) +A = [[int(i) for i in input().split()] for j in range(n)] +for i in range(n-2): + if A[i][0] == A[i][1] and A[i+1][0] == A[i+1][1] and A[i+2][0] == A[i+2][1]: + print(""Yes"") + break +else: + print(""No"") +" +p02547,s785330872,Accepted,"n = int(input()) +c = 0 +d = False +for i in range(n): + x, y = map(int, input().split()) + if x == y: + c += 1 + else: + c = 0 + + d = d or (c == 3) +print('Yes' if d else 'No')" +p02547,s281658454,Accepted,"n = int(input()) +dlist = [list(map(int,input().split())) for _ in range(n)] + +cnt = 0 +renzoku = 0 +for d in dlist: + if d[0] == d[1]: + cnt+=1 + renzoku += 1 + else: + renzoku = 0 + cnt = 0 + if cnt == 3 and renzoku == 3: + print('Yes') + break +else: + print('No')" +p02547,s840687076,Accepted,"n=int(input()) +c=0 + +for i in range(n): + d,dd=map(int,input().split()) + if d==dd: + c+=1 + if c==3: + print(""Yes"") + exit() + else: + c=0 +print(""No"")" +p02547,s918931355,Accepted,"from sys import exit +N = int(input()) + +cnt = 0 +for i in range(N): + x,y = map(int,input().split()) + if cnt == 3: + print(""Yes"") + exit(0) + if x == y: + cnt += 1 + else: + cnt = 0 + +if cnt == 3: + print(""Yes"") +else: + print(""No"")" +p02547,s968768650,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for _ in range(n)] + +ans = [i[0] == i[1] for i in d] + [False, False] +ans2 = [sum( ans[i:i+3] ) for i in range(n)] + +if max(ans2) == 3: + print('Yes') +else: + print('No') " +p02547,s020264432,Accepted,"N=int(input()) +cnt=0 +flg='No' + +for i in range(N): + D1,D2=map(int,input().split()) + if D1==D2: + cnt+=1 + if cnt==3: + flg='Yes' + break + else: + cnt=0 + +print(flg) + +" +p02547,s221200152,Accepted,"n = int(input()) + +ans = 0 +zoro = 0 + +for i in range(n): + x,y = map(int,input().split()) + if x == y: + zoro = zoro + 1 + if ans < zoro: + ans = zoro + else: + if ans < zoro: + ans = zoro + zoro = 0 + else: + zoro = 0 + +if ans >= 3: + print('Yes') +else: + print('No') +" +p02547,s413672812,Accepted,"n = int(input()) +a = [] +for i in range(n): + x,y = map(int,input().split()) + a.append([x,y]) +count = 0 +flag = True +for x in a: + if x[0] == x[1]: + count += 1 + if count == 3: + print('Yes') + flag = False + break + else: + count = 0 + +if flag: + print('No')" +p02547,s636646571,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for i in range(n)] +ans = ""No"" +for i in range(n-2): + if d[i][0]==d[i][1] and d[i+1][0]==d[i+1][1] and d[i+2][0]==d[i+2][1]: + ans = ""Yes"" +print(ans)" +p02547,s589279318,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for _ in range(N)] +flag = 0 +for i in range(N-2): + if D[i][0]==D[i][1] and D[i+1][0]==D[i+1][1] and D[i+2][0]==D[i+2][1]: + flag = 1 + break +if flag==1: + print(""Yes"") +else: + print(""No"")" +p02547,s346174894,Accepted,"n = int(input()) + +count = 0 +for i in range(n): + a, b = map(int, input().split()) + + if a == b: + count += 1 + else: + count = 0 + + if count == 3: + print('Yes') + exit(0) + +print('No')" +p02547,s647896849,Accepted,"a=0 +for _ in range(int(input())): + i,j=map(int,input().split()) + if i==j: + a+=1 + if a>=3: + print(""Yes"") + exit() + else:a=0 +print(""No"") " +p02547,s371821416,Accepted,"N=int(input()) + +cnt=0 + +for i in range(N): + D1,D2=map(int,input().split()) + if D1!=D2: + cnt=0 + else: + cnt+=1 + if cnt==3: + print(""Yes"") + exit() + +print(""No"") +" +p02547,s501730064,Accepted,"n = int(input()) +D = [list(map(int, input().split())) for _ in range(n)] +ct = 0 +CT = [] +for i in range(n): + if D[i][0] == D[i][1]: + ct += 1 + if i == n-1: + CT.append(ct) + else: + CT.append(ct) + ct = 0 +for k in CT: + if k >= 3: + print('Yes') + exit() +print(""No"") +" +p02547,s924158352,Accepted,"# -*- coding: utf-8 -*- +N = int(input()) +count = 0 +flag = False +for i in range(N): + Di, Dj = map(int, input().split()) + if Di == Dj: + count += 1 + if count == 3: + flag = True + else: + count = 0 +if flag == True: + print(""Yes"") +else: + print(""No"")" +p02547,s644747769,Accepted,"N = int(input()) + +flag = 0 + +for i in range(N): + a, b = map(int,input().split()) + if a == b: + flag += 1 + if flag == 3: + print(""Yes"") + exit() + else: + flag = 0 +print(""No"")" +p02547,s393213835,Accepted,"c=int(input()) +ans=0 +now=0 +for _ in range(c): + if eval(input().replace("" "",""=="")): + now = now+1 + else: + now = 0 + ans = max(ans,now) +print(""Yes"") if ans >= 3 else print(""No"")" +p02547,s489023290,Accepted,"N = int(input()) +cnt = 0 +for _ in range(N): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + exit() +print('No')" +p02547,s671403510,Accepted,"import sys + +N = int(input()) +B=[] +for i in range(N): + b=list(map(int,input().split())) + B.append(b) +for i in range(N-2): + if B[i][0]==B[i][1]: + if B[i+1][0]==B[i+1][1]: + if B[i+2][0]==B[i+2][1]: + print(""Yes"") + sys.exit() +print(""No"")" +p02547,s707961486,Accepted,"n = int(input()) +d = [input().split() for i in range(n)] +total = 0 + +for i in range(n): + if len(set(d[i])) == len(d[i]): + if total >=3: + total +=0 + else: + total = 0 + else: + total += 1 + +if total >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s610987872,Accepted,"n = int(input()) +check = [] +ans = 0 +for _ in range(n): + n1, n2 = map(int, input().split()) + if n1 == n2: + check.append(1) + else: + check.append(0) + +for i in range(n-1): + if sum(check[i:i+3])==3: + ans = 1 + break +if ans: + print(""Yes"") +else: + print(""No"")" +p02547,s679520987,Accepted,"N = int(input()) +x = [list(map(int, input().split())) for i in range(N)] + +counter = 0 +max = 0 +for i in range(N): + if x[i][0] == x[i][1]: + counter = counter + 1 + else: + if max < counter: + max = counter + counter = 0 + +if max >=3 or counter >= 3: + a = 'Yes' +else: + a = 'No' + +print(a)" +p02547,s838419289,Accepted,"from sys import stdin +input = stdin.readline + +N = int(input()) + +cnt = 0 + +for _ in range(N): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + + if cnt >= 3: + print(""Yes"") + exit() + +print(""No"") +" +p02547,s812350437,Accepted,"time = int(input()) +xy = [map(int, input().split()) for _ in range(time)] +x, y = [list(i) for i in zip(*xy)] +sum = 0 +for i in range(time): + if x[i] == y[i]: + sum += 1 + if sum == 3: + print(""Yes"") + break + else: + sum = 0 + +if sum < 3: + print(""No"") +" +p02547,s729823501,Accepted,"def resolve(): + n = int(input()) + flag = False + count = 0 + for i in range(n): + d = list(map(int, input().split())) + if d[0] == d[1]: + count += 1 + else: + count = 0 + if count == 3: + flag = True + break + print('Yes' if flag else 'No') + + +if 'unittest' not in globals(): + resolve() +" +p02547,s021677914,Accepted,"N = int(input()) +listD = [] +for i in range(N): + listD.append(list(map(int,input().split())) ) + + +################################################### +count = 0 +flag = False +for j in range(N): + if listD[j][0] == listD[j][1]: + count += 1 + if count >= 3: + print(""Yes"") + flag = True + break + else: + count = 0 +if flag == False: + print(""No"") + + + + " +p02547,s667255214,Accepted,"N = int(input()) +D1, D2 = [], [] +for i in range(N): + li = list(map(int,input().split())) + D1.append(li[0]) + D2.append(li[1]) + +D = """" + +for i in range(N): + if D1[i]==D2[i]: + D += 'T' + else: + D += 'F' + +if 'TTT' in D: + print('Yes') +else: + print('No') +" +p02547,s275414550,Accepted,"N=int(input()) +D=[list(map(int, input().split())) for i in range(N)] +count=0 +for j in range(N-2): + if D[j][0]==D[j][1]: + if D[j+1][0]==D[j+1][1]: + if D[j+2][0]==D[j+2][1]: + count = 1 +if count==0: + print('No') +else: + print('Yes')" +p02547,s930717975,Accepted,"N = int(input()) +f = 0 +for k in range(N): + A, B = map(int,input().split()) + if A == B: + f += 1 + if f == 3: + print(""Yes"") + exit(0) + else: + f = 0 +print(""No"") +" +p02547,s131045762,Accepted,"n = int(input()) + +count = 0 +max_count = 0 +for i in range(n): + input_elements = input().split() + if input_elements[0] == input_elements[1]: + count += 1 + else: + if max_count < count: + max_count = count + count = 0 + +if max_count < count: + max_count = count + +if max_count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s216641706,Accepted,"N = int(input()) +count = 0 +flag = False +for i in range(N): + D1, D2 = map(int, input().split()) + + if D1 == D2: + count += 1 + else: + count = 0 + if count >= 3: + flag = True + +if flag: + print(""Yes"") +else: + print(""No"") +" +p02547,s438845724,Accepted,"n=int(input()) +counter=0 +flag=0 +for i in range(n): + a,b=input().split() + if(a==b): + counter=counter+1 + else: + counter=0 + if(counter>2): + flag=1 +if(flag==1): + print('Yes') +else: + print('No')" +p02547,s091797678,Accepted,"X=int(input()) +cnt=0 +for i in range(X): + A,B=list(map(int,input().split())) + if A==B: + cnt=cnt+1 + else: + cnt=0 + if cnt==3: + print('Yes') + exit() +print('No')" +p02547,s748703485,Accepted," +n=int(input()) +flag=False +count=0 +for i in range(n): + u,v=map(int,input().split()) + if u==v: + count+=1 + if count==3: + flag=True + + else: + count=0 +if flag==True: + print('Yes') +else: + print('No')" +p02547,s068239261,Accepted,"n = int(input()) +c = 0 +f = False +for i in range(n): + x,y = map(int,input().split()) + if x==y: + c += 1 + else: + if c>=3: + f = True + c = 0 +if c>=3: + f = True +print('Yes' if f else 'No')" +p02547,s676980340,Accepted,"d = int(input()) +l = [] +c = 0 +flag = False +for i in range(d): + a,b = list(map(int,input().split())) + l.append([a,b]) +for i in range(d): + if l[i][0] == l[i][1]: + c += 1 + if c >= 3: + flag = True + else: + c = 0 +if flag == True: + print(""Yes"") +else: + print(""No"") + " +p02547,s584670343,Accepted,"n = int(input()) +count = 0 +ans = 'No' +for i in range(n): + a,b = map(int, input().split()) + if a == b: + count += 1 + else: + count = 0 + if count >= 3: + ans = 'Yes' + break +print(ans) +" +p02547,s623863007,Accepted,"N = int(input()) +ans = ""No"" +tmp = 0 +for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + tmp += 1 + if tmp == 3: + ans = ""Yes"" + break + else: + tmp = 0 +print(ans)" +p02547,s708189532,Accepted,"n = int(input()) + +count = 0 + +for _ in range(n): + a, b = map(int, input().split()) + + if a == b: + count += 1 + + if count >= 3: + print('Yes') + exit() + else: + count = 0 + +if count >= 3: + print('Yes') + +else: + print('No')" +p02547,s498845954,Accepted,"N = int(input()) +a = [] +for i in range(N): + x,y = map(int,input().split()) + a.append((x,y)) +ans = ""No"" +for i in range(N-2): + if a[i][0] == a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]: + ans = ""Yes"" +print(ans)" +p02547,s472741938,Accepted,"n=input() +cc=0 +ok=1 +for i in range(n): + a,b=map(int,raw_input().split()) + if a==b: + cc+=1 + else: + cc=0 + if cc==3: + print ""Yes"";ok=0;break +if ok: + print ""No""" +p02547,s356112369,Accepted,"N = int(input()) +D = [] +count = 0 +for i in range(N): + d = list(map(int, input().split())) + if d[0] == d[1]: + count += 1 + else: + count = 0 + if count == 3: + break + +if count >= 3: + print('Yes') +else: + print('No')" +p02547,s742303131,Accepted,"N=int(input()) +check=0 +Flag=False +for i in range(N): + d_1,d_2=map(int,input().split()) + if d_1==d_2: + check+=1 + else: + check=0 + if check==3: + Flag=True +if Flag: + print('Yes') +else: + print('No')" +p02547,s793983519,Accepted,"N, = map(int, input().split()) +c = 0 +for _ in range(N): + a, b = map(int, input().split()) + if a == b: + c += 1 + else: + c = 0 + if c == 3: + print(""Yes"") + break +else: + print(""No"") +" +p02547,s253637517,Accepted,"import sys +stdin = sys.stdin +sys.setrecursionlimit(10**6) +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) +nn = lambda: list(stdin.readline().split()) +ns = lambda: stdin.readline().rstrip() + +n = ni() + +a = 0 +for i in range(n): + d,dd = na() + if d == dd: + a += 1 + else: + a = 0 + if a >= 3: + print('Yes') + exit() + +print('No')" +p02547,s613693005,Accepted,"N = int(input()) +cnt = 0 +for n in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3: + print('Yes') + break + else: + cnt = 0 +else: + print('No')" +p02547,s838426960,Accepted,"N=int(input()) +D={} +for i in range(N): + D[i]=input().split() + +cou=0 +for i in range(N): + if D[i][0]==D[i][1]: + cou+=1 + if cou ==3: + print('Yes') + break + else: + cou=0 + +if cou < 3: + print('No')" +p02547,s408882300,Accepted,"import sys +N = int(input()) +K = [] +for i in range(N): + a, b = map(int, input().split()) + K.append([a, b]) +for i in range(N-2): + if K[i][0] == K[i][1] and K[i+1][0] == K[i+1][1] and K[i+2][0] == K[i+2][1]: + print(""Yes"") + sys.exit() +print(""No"")" +p02547,s618831021,Accepted,"n = int(input()) +cnt = 0 +for _ in range(n): + a,b = map(int, input().split()) + if a==b: + cnt+=1 + if cnt==3: + break + else: cnt = 0 +if cnt==3: print('Yes') +else: print('No')" +p02547,s540206807,Accepted,"def main(): + n = int(input()) + + l = [] + for _ in range(n): + d1,d2 = tuple(map(int,input().split())) + l.append(1 if d1==d2 else 0) + + for i in range(n-2): + if sum(l[i:i+3])==3: + print(""Yes"") + return + + print(""No"") + + +if __name__ == ""__main__"": + main()" +p02547,s532391048,Accepted,"n = int(input()) +cnt = 0 +isOK = False +for i in range(n): + x,y = map(int,input().split()) + if x==y: + cnt += 1 + else: + cnt = 0 + if cnt>=3: + isOK = True + break +#if cnt >= 3: +# isOK = True + +if isOK: + print('Yes') +else: + print('No') + " +p02547,s885095563,Accepted,"def solve(): + n = int(input()) + rolls = [list(map(int,input().split())) for i in range(n)] + for i in range(n-2): + if rolls[i][0]==rolls[i][1] and rolls[i+1][0]==rolls[i+1][1] and rolls[i+2][0]==rolls[i+2][1]: + return True + + return False + +print(""Yes"" if solve() else ""No"")" +p02547,s853795124,Accepted,"N=int(input()) +count=0 +result=""No"" +for n in range(N): + d=list(map(int,input().split())) + if (d[0]==d[1]): + count+=1 + if count==3: + result=""Yes"" + else: + count=0 +print(result)" +p02547,s540510210,Accepted,"n = int(input()) +str_list = [list(input().split()) for _ in range(n)] +ans = 0 +for i in range(n-2): + if str_list[i][0] == str_list[i][1]: + if str_list[i+1][0] == str_list[i+1][1]: + if str_list[i+2][0] == str_list[i+2][1]: + ans += 1 + +if ans: + print('Yes') +else: + print('No') +" +p02547,s013586042,Accepted,"N = int(input()) +k = 0 + +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] + +for i in range(N): + if x[i] == y[i]: + k += 1 + else: + k = 0 + if k == 3: + break + +if k == 3: + print(""Yes"") +else: + print(""No"")" +p02547,s129610351,Accepted,"N = int(input()) +cnt = 0 +ans = ""No"" +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + cnt += 1 + else: + cnt = 0 + + if cnt == 3: + ans = ""Yes"" + +print(ans) +" +p02547,s828933166,Accepted,"n=int(input()) +cnt=0 +flg=0 + +for i in range(n): + d1,d2=map(int,input().split()) + if d1==d2: + cnt+=1 + else: + cnt=0 + if cnt==3: + flg=1 + +if flg: + print('Yes') +else: + print('No')" +p02547,s220478979,Accepted,"n = int(input()) +count = 0 +for i in range(n): + a,b = map(int,input().split()) + if a == b: + count += 1 + else: + if count >= 3: + print(""Yes"") + exit() + count = 0 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s793966081,Accepted,"import sys +input = sys.stdin.readline + +n = int(input()) +dice = [] + +for _ in range(n): + d_1, d_2 = map(int,input().split()) + dice.append([d_1, d_2]) + +ans = 0 + +for i in range(n-2): + if dice[i][0] == dice[i][1]: + if dice[i+1][0] == dice[i+1][1] and dice[i+2][0] == dice[i+2][1]: + ans = 1 + break + else: + continue + break + +if ans > 0: + print(""Yes"") +else: + print(""No"")" +p02547,s733233365,Accepted,"import sys +N = int(input()) + +z = [0 for _ in range(N)] +tmp = 0 +for i in range(N): + d1, d2 = map(int,input().split()) + if d1 == d2: + tmp += 1 + else: + tmp = 0 + if tmp >= 3: + print(""Yes"") + sys.exit() + +print(""No"") + + " +p02547,s728606732,Accepted,"n = int(input()) +counter = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + counter += 1 + else: + counter = 0 + if counter >= 3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s882861660,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for i in range(n)] +ok = False +for i in range(n-2): + if d[i][1] == d[i][0]: + if d[i+1][1] == d[i+1][0]: + if d[i+2][1] == d[i+2][0]: + ok = True +if ok == True: + print(""Yes"") +else: + print(""No"") +" +p02547,s410241812,Accepted,"N = int(input()) +tmp = 0 +ans = False + +for i in range(N): + tmp += 1 + t = tuple(map(int, input().split())) + if t[0] != t[1]: + tmp = 0 + if tmp >= 3: + ans = True + +print('Yes' if ans else 'No') +" +p02547,s167094494,Accepted,"def main(): + n = int(input()) + + count = 0 + answer = 'No' + for i in range(n): + d = list(map(int, input().split())) + if d[0] == d[1]: + count += 1 + else: + count = 0 + if count >= 3: + answer = 'Yes' + + print(answer) + + +if __name__ == '__main__': + main() +" +p02547,s352072301,Accepted,"counter = int(input()) +result_flg = False + +fir_fir, fir_sec = map(int, input().split()) +sec_fir, sec_sec = map(int, input().split()) + + +for i in range(2, counter): + thi_fir, thi_sec = map(int, input().split()) + + if fir_fir == fir_sec: + if sec_fir == sec_sec: + if thi_fir == thi_sec: + result_flg = True + break + + # reset content + fir_fir = sec_fir + fir_sec = sec_sec + sec_fir = thi_fir + sec_sec = thi_sec + +if result_flg == True: + print('Yes') +else: + print('No')" +p02547,s396253386,Accepted,"x=[] +for i in range(int(input())): + a,b=map(int,input().split()) + x.append([a,b]) + an=0 +for j in range(len(x)-2): + if x[j][0]==x[j][1] and x[j+1][1] == x[j+1][0] and x[j+2][1] == x[j+2][0]: + an=1 +if an: + print(""Yes"") +else: + print(""No"")" +p02547,s316613416,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] +cnt = 0 +ans = False +for i in range(n): + if d[i][0] == d[i][1]: + cnt += 1 + if cnt >= 3: + ans = True + print('Yes') + exit() + else: + cnt = 0 +print('No') +" +p02547,s617275220,Accepted,"n = int(input()) +data = [list(map(int, input().split())) for i in range(n)] +cnt = 0 +for i in range(1, n-1): + if data[i][0] == data[i][1] and data[i-1][0] == data[i-1][1] and data[i+1][0] == data[i+1][1]: + print(""Yes"") + exit() + +print(""No"") +" +p02547,s498880986,Accepted,"N = int(input()) +cur = 0 +ok = False +for _ in range(N): + D1, D2 = input().split() + if D1 == D2: + cur += 1 + else: + cur = 0 + if cur == 3: + ok = True +if ok: + print('Yes') +else: + print('No')" +p02547,s027602909,Accepted,"N=int(input()) +D=list() +for i in range(0,N): + a,b=map(int,input().split()) + D.append((a,b)) +a = '' +for i in range(0,N): + if D[i][0]==D[i][1]: + a=a+'1' + else: + a=a+'0' +if '111' in a: + print('Yes') +else: + print('No')" +p02547,s009848126,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +ans = 'No' +for i in range(N-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + ans = 'Yes' + break + +print(ans)" +p02547,s210893022,Accepted,"n = int(input()) +ans = 0 +last = 0 +for i in range(n): + d1, d2 = map(int,input().split()) + if d1 == d2: + ans += 1 + else: + last = max(last,ans) + ans = 0 +last = max(last,ans) +if last > 2: + print('Yes') +else: + print('No') +" +p02547,s139163400,Accepted,"n=int(input()) +ct=0 +best=0 +arr=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + ct+=1 + best=max(ct,best) + else: + ct=0 +if best>=3: + print(""Yes"") +else: + print(""No"") +" +p02547,s896121641,Accepted,"def main(): + N = int(input()) + cnt = 0 + flag = False + for _ in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + flag = True + if flag: + print('Yes') + else: + print('No') + + + +if __name__ == ""__main__"": + main()" +p02547,s361878042,Accepted,"n = int(input()) +flag = 0 +out = False +for j in range(n): + ins = input().split() + if(ins[0]==ins[1]): + flag+=1 + if(flag==3): + out=True + else: + flag = 0 +if(out): + print(""Yes"") +else: + print(""No"")" +p02547,s328650466,Accepted,"n = int(input()) + +cnt = 0 +for _ in range(n): + d1, d2 = map(int,input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print(""Yes"") + exit() +print(""No"")" +p02547,s872803254,Accepted,"n = int(input()) +d = [] +for i in range(n): + t = [int(x) for x in input().split()] + d.append(t) + +for i in range(n-2): + if d[i][0] == d[i][1] and d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]: + print('Yes') + exit() + +print('No') " +p02547,s327272688,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for i in range(N)] +flag = 0 +for i in range(N-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1]: + if D[i+2][0] == D[i+2][1]: + flag = 1 +if flag == 1: + print('Yes') +else: + print('No')" +p02547,s863786631,Accepted,"n=int(input()) +ans='No' +tmp=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + tmp+=1 + else: + tmp=0 + if tmp==3: + ans='Yes' +print(ans)" +p02547,s326671149,Accepted,"N=int(input()) +x=0 +a=0 +for i in range(N): + A,B=map(int,input().split()) + if A==B: + x+=1 + else: + x=0 + if x==3: + a=1 +if a==1: + print('Yes') +else: + print('No')" +p02547,s637579352,Accepted,"n = int(input()) +count = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + count += 1 + if count == 3: + print(""Yes"") + exit() + else: + count = 0 + +print(""No"") +" +p02547,s807256406,Accepted,"def MI(): + return map(int, input().split()) + +n = int(input()) + +cnt=[0]*(n+1) +for i in range(n): + a,b= MI() + if a==b: + cnt[i+1]=cnt[i]+1 + else: + cnt[i+1]=0 + +if max(cnt)>2: + print('Yes') +else: + print('No')" +p02547,s258942786,Accepted,"n=int(input()) +count=0 +lists=[] +for i in range(n): + d1,d2=list(map(int,input().split())) + lists.append([d1,d2]) +for i in range(n-2): + if lists[i][0]==lists[i][1] and lists[i+1][0]==lists[i+1][1] and lists[i+2][0]==lists[i+2][1]: + print('Yes') + break + elif i==n-3: + print('No') + break + else: + continue +" +p02547,s986461484,Accepted,"n = int(input()) +d = [0]*n + +for i in range(n): + d[i] = input().split() + +c = 0 + +for i in range(n): + #print(c) + if d[i][0] == d[i][1]: + c += 1 + if c == 3: + print(""Yes"") + exit() + else: + c = 0 + +print(""No"")" +p02547,s612918626,Accepted,"n = int(input()) +zo=[False]*n +for i in range(n): + a,b = map(int,input().split()) + if a==b: + zo[i] = True +for i in range(n-2): + if zo[i] and zo[i+1] and zo[i+2]: + print(""Yes"");exit() +print(""No"")" +p02547,s391971963,Accepted,"N = int(input()) +ans = 'No' +cnt = 0 +for _ in range(N): + x, y = map(int, input().split()) + if x == y: + cnt += 1 + if cnt == 3: + ans = 'Yes' + else: + cnt = 0 +print(ans)" +p02547,s879328788,Accepted,"N = int(input()) +MAX = 0 +cnt = 0 +for _ in range(N): + d1, d2 = map(int,input().split()) + if d1 == d2: + cnt += 1 + MAX = max(MAX, cnt) + else: + cnt = 0 +if MAX >= 3: + print('Yes') +else: + print('No')" +p02547,s206330410,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for i in range(n)] +count = 0 + +# [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6]] + +for i in d: + if i[0] == i[1]: + count += 1 + else: + count = 0 + if count == 3: + print('Yes') + exit() +print('No')" +p02547,s750634950,Accepted,"N = int(input()) +li = list() +for i in range(N): + a, b = [int(x) for x in input().split()] + li.append([a,b]) + +count = 0 +for i in li: + if count < 3: + if i[0] == i[1]: + count += 1 + else: + count = 0 + else: + break + +if count >= 3: print('Yes') +else: print('No')" +p02547,s256815670,Accepted,"n = int(input()) +z = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + z += 1 + else: + z = 0 + + if z == 3: + print(""Yes"") + exit() +print(""No"") +" +p02547,s998895182,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for i in range(n)] + +cnt = 0 +for i in range(n): + if d[i][0] == d[i][1]: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + break +if cnt >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s484496524,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for _ in range(N)] + +cnt,cnt_max = 0,0 +for i in range(N): + if D[i][0] == D[i][1]: + cnt += 1 + else: + cnt = 0 + cnt_max = max(cnt,cnt_max) + +if cnt_max >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s318949502,Accepted,"t=int(input()) +ct=0 +ct1=0 +for i in range(0,t): + a,b=map(int,input().split()) + if(a==b): + ct+=1 + else: + ct=0 + if(ct==3): + ct1+=1 +if(ct1==0): + print(""No"") +else: + print(""Yes"") + + " +p02547,s349382182,Accepted,"n = int(input()) +cnt = 0 +for i in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3: + print(""Yes"") + exit() + else: + cnt = 0 +print(""No"")" +p02547,s609004598,Accepted,"N = int(input()) +cnt = 0 +ans = ""No"" +for i in range(N): + D = list(map(int, input().split())) + if D[0] == D[1]: + cnt += 1 + if cnt >= 3: + ans = ""Yes"" + continue + else: + cnt = 0 +print(ans) +" +p02547,s325806966,Accepted,"def main(): + N = int(input()) + D = [] + for _ in range(N): + a, b = (int(i) for i in input().split()) + D.append(int(a == b)) + + if any(sum(D[i:i+3]) == 3 for i in range(N-3+1)): + print(""Yes"") + else: + print(""No"") + + +if __name__ == '__main__': + main() +" +p02547,s803388046,Accepted,"n=int(input()) +x=[list(map(int,input().split()))for i in range(n)] +#print(x) + +for i in range(n-2): + cnt = 0 + if x[i][0]==x[i][1]: + cnt=1 + else: + continue + + if x[i+1][0]==x[i+1][1]: + cnt=cnt+1 + + else: + continue + + if x[i+2][0]==x[i+2][1]: + cnt=cnt+1 + if cnt==3: + print('Yes') + break + else: + break +if cnt!=3: + print('No') + + + " +p02547,s622295894,Accepted,"n = int(input()) +d_l = [ list(map(int, input().split())) for _ in range(n) ] + +ans = 'No' +z = 0 +for i, j in d_l: + if i == j: + z+=1 + else: + z=0 + if z == 3: + ans = 'Yes' + break +print(ans)" +p02547,s250942793,Accepted,"N = int(input("""")) +L = [0 for i in range(N)] +flag = False + +for i in range(N): + a, b = input().strip().split() + a, b = [int(a), int(b)] + L[i] = a - b +for i in range(N - 2): + if (L[i] == 0 and L[i+1] == 0 and L[i+2] == 0): + flag = True + +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s664025975,Accepted,"n = int(input()) +arr = [] +for i in range(n): + x, y = map(int, input().split()) + arr += [[x, y]] + +flag = 0 +for i in range(1, n-1): + if arr[i-1][0] == arr[i-1][1] and arr[i][0] == arr[i][1] and arr[i+1][0] == arr[i+1][1]: + flag = 1 + break +if flag == 1: + print(""Yes"") +else: + print(""No"")" +p02547,s340649204,Accepted,"n = int(input()) +tmp = 0 +import sys +for i in range(n): + d = list(map(int,input().split())) + if d[0] == d[1]: + tmp += 1 + #check + if tmp == 3: + print('Yes') + sys.exit() + else: + tmp = 0 +print('No')" +p02547,s468712382,Accepted,"n = int(input()) +t = [0] * n +x = [0] * n +for i in range(n): + t[i], x[i] = map(int, input().split()) +a=0 +for j in range(n-2): + if t[j]==x[j]and t[j+1]==x[j+1] and t[j+2]==x[j+2]: + a+=1 + else: + a+=0 +if a==0: + print('No') +else: + print('Yes')" +p02547,s927565272,Accepted,"n = input() +n = int(n) +d = [] +for i in range(n): + d.append(input().split()) +active = False +count = 0 +for x in d: + if x[0] == x[1]: + active = True + count += 1 + else: + count = 0 + active = False + if count >2: + break +if count > 2: + print(""Yes"") +else: + print(""No"")" +p02547,s539412298,Accepted,"N=int(input()) +T=False +k=0 +for i in range(N): + D1,D2=map(int,input().split()) + if D1==D2: + k+=1 + if k>=3: + T=True + else: + k=0 +if T: + print(""Yes"") +else: + print(""No"")" +p02547,s763340940,Accepted,"import math +import fractions +import collections +import itertools +N=int(input()) +l=[] +for i in range(N): + x,y=map(int,input().split()) + if x==y: + l.append(1) + else: + l.append(0) +flag=0 +#print(l) +for i in range(N-2): + num=l[i]+l[i+1]+l[i+2] + #print(i,i+1,i+2) + if num==3: + flag=1 + break +if flag==1: + print(""Yes"") +else: + print(""No"")" +p02547,s756554266,Accepted,"n = int(input()) +c, d = [], [] +for i in range(n): + a, b = [int(i) for i in input().split()] + c.append(a) + d.append(b) + +count = 0 + +for i in range(0, n): + if c[i] == d[i]: + count += 1 + else: + count = 0 + if count == 3: + break + +if count == 3: + print('Yes') + +else: + print('No') +" +p02547,s814779378,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +cnt = 0 +ans = False +for a, b in D: + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + ans = True + +if ans: + print(""Yes"") +else: + print(""No"")" +p02547,s420030247,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] +for d1, d2, d3 in zip(D, D[1:], D[2:]): + if d1[0] == d1[1] and d2[0] == d2[1] and d3[0] == d3[1]: + print(""Yes"") + exit() +print(""No"") +" +p02547,s147699018,Accepted,"N = int(input()) +d_ls=[] +for vakawkawelkn in range(N): + D1,D2=map(int, input().split()) + if D1==D2: + d_ls+=[1] + else: + d_ls+=[0] + +flag=0 +for i in range(N-2): + if d_ls[i]*d_ls[i+1]*d_ls[i+2]==1: + flag=1 + + +if flag==0: + print(""No"") +else: + print(""Yes"") + + +# 2darray [[0] * 4 for i in range(3)] +# import itertools" +p02547,s065279885,Accepted,"def main(): + n = int(input()) + d =[] + cnt = 0 + ans = 'No' + for i in range(n): + d1 = list(map(int,input().split())) + if d1[0] == d1[1]: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + ans = 'Yes' + d.append(d1) + print(ans) + +if __name__=='__main__': + main() +" +p02547,s204430842,Accepted,"N = int(input()) +L = [] +t = 0 +for i in range(N): + D = [int(i) for i in input().split()] + if D[0] == D[1]: + L.append(i) + if len(L) >= 3: + if L[-2] == i-1 and L[-3] == i-2: + print('Yes') + t = 1 + break + +if t == 0: + print('No')" +p02547,s342958042,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for i in range(n)] +cnt=[] +ans=0 +for a in range(n): + if d[a][0]==d[a][1]: + cnt.append(1) + if a>1: + if cnt[a-2]==cnt[a-1]==cnt[a]: + ans+=1 + else: + cnt.append(0) + +if ans >0: + print('Yes') +else: + print('No') + " +p02547,s722810411,Accepted,"n=int(input()) +a=[] +for i in range(n): + a.append(list(map(int,input().split()))) +ans=""No"" +for i in range(n-2): + if ((a[i][0]==a[i][1]) and (a[i+1][0]==a[i+1][1]) and (a[i+2][0]==a[i+2][1])): + ans=""Yes"" + break +print(ans)" +p02547,s642688985,Accepted,"N = int(input()) +count = 0 +for i in range(N): + a,b = map(int,input().split()) + if a == b: + count+=1 + if count == 3: + print(""Yes"") + break + else: + count = 0 +else: + print(""No"") +" +p02547,s862291140,Accepted,"N = int(input()) + +d = [] +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + ans = ""same"" + else: + ans = ""different"" + d.append(ans) +flag = ""No"" +for i in range(N-2): + if d[i] == ""same"" and d[i+1] == ""same"" and d[i+2] == ""same"": + flag = ""Yes"" +print(flag)" +p02547,s022696991,Accepted,"N = int(input()) + +count = 0 +for i in range(N): + d1, d2 = [int(d) for d in input().split()] + if d1 == d2: + count += 1 + else: + count = 0 + + if count == 3: + print(""Yes"") + exit() + +print(""No"") +" +p02547,s612180050,Accepted,"N = int(input()) +D1 = [] +D2 = [] + +for _ in range(N): + a, b = map(int, input().split()) + D1.append(a) + D2.append(b) + +for i in range(N-2): + if D1[i:i+3] == D2[i:i+3]: + print(""Yes"") + exit() + +print(""No"")" +p02547,s825912989,Accepted,"n=int(input()) + +a = 0 +for i in range(n): + li = input().split() + if(li[0]==li[1]): + a+=1 + elif(a<3): + a=0 + else: + print(""Yes"") + exit() +if(a>2): + print(""Yes"") + exit() + +print(""No"")" +p02547,s941255222,Accepted,"n = int(input()) +renz = 0 +for i in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + renz += 1 + if renz == 3: + break + else: + renz = 0 +if renz == 3: + print('Yes') +else: + print('No')" +p02547,s999347970,Accepted,"n = int(input()) +D = [list(map(int,input().split())) for _ in range(n)] +for i in range(n-2): + if (D[i][0] == D[i][1]) and (D[i+1][0]==D[i+1][1]) and (D[i+2][0]==D[i+2][1]): + print(""Yes"") + break + if i == n-3: + print(""No"")" +p02547,s027369849,Accepted,"N=int(input()) +ans = ""No"" +n=0 +for _ in range(N): + x, y = map(int, input().split()) + if x == y: + n+=1 + else: + n = 0 + if n >= 3: + ans=""Yes"" +print(ans) +" +p02547,s926640421,Accepted,"n = int(input()) + +nums = [] +for i in range(n): + nums.append(list(map(int, input().split()))) +ans = 'No' +count = 0 +for num in nums: + if num[1] == num[0]: + count += 1 + if count == 3: + ans = 'Yes' + break + else: + count = 0 + +print(ans)" +p02547,s206398683,Accepted,"n = int(input()) +cnt = 0 +judge = False +for i in range(n): + a,b = map(int,input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + judge = True +if judge: + print(""Yes"") +else: + print(""No"")" +p02547,s139529591,Accepted,"n = int(input()) + +ans = 0 +flag = 0 + +for i in range(0, n): + x, y = input().split() + if x == y: + ans = ans + 1 + else: + ans = 0 + if ans >= 3: + flag = 1 +if flag == 1: + print(""Yes"") +else : + print(""No"") +" +p02547,s588251210,Accepted,"N = int(input()) + + +check1 = 0 +ans = ""No"" +for i in range(N): + a, b = map(int,input().split()) + if a == b: + check1 += 1 + else: + check1 = 0 + if check1 == 3: + ans = ""Yes"" + +print(ans) +" +p02547,s418749801,Accepted,"import sys +N=int(input()) +a = [0] * N +b = [0] * N +for i in range(N): + a[i], b[i] = map(int, input().split()) +#print(a[1]) +for i in range(N-2): + if a[i]==b[i] and a[i+1]==b[i+1] and a[i+2]==b[i+2]: + print(""Yes"") + sys.exit() +print(""No"")" +p02547,s405468463,Accepted,"n=input() +a=[[int(i) for i in raw_input().split()]for j in range(n)] +flag=0 +for i in range(2,n): + if a[i][0]==a[i][1] and a[i-1][0]==a[i-1][1] and a[i-2][0]==a[i-2][1]: + flag=1 +if flag: + print ""Yes"" +else: + print ""No"" +" +p02547,s789251572,Accepted,"n = int(input()) +c = [0] * n +d = [0] * n +for i in range(n): + c[i],d[i] = map(int,input().split()) +f = 0 + +for i in range(n-2): + if c[i] == d[i] and c[i+1] == d[i+1] and c[i+2] == d[i+2]: + f = 1 +if f == 0: + print('No') +else: + print('Yes')" +p02547,s532294403,Accepted,"N = int(input()) +c = 0 +for _ in range(N): + di1, di2 = input().split("" "") + if di1 == di2: + c += 1 + if c == 3: + print(""Yes"") + break + else: + c = 0 +else: + print(""No"")" +p02547,s004417155,Accepted,"#!/usr/bin/env python3 +import sys +import collections as cl + + +def II(): return int(sys.stdin.readline()) + + +def MI(): return map(int, sys.stdin.readline().split()) + + +def LI(): return list(map(int, sys.stdin.readline().split())) + + +def main(): + N = II() + num = 0 + for i in range(N): + a, b = MI() + if a == b: + num += 1 + if num == 3: + print(""Yes"") + return + else: + num = 0 + + print(""No"") + + +main() +" +p02547,s440148607,Accepted,"n = int(input()) +d = [] +for i in range(n): + a,b = map(int,input().split()) + d.append([a,b]) +cnt,ans = 0,0 +for i in d: + if i[0] == i[1]: + cnt += 1 + ans = max(ans,cnt) + else: + cnt = 0 +if ans>2: + print(""Yes"") +else: + print(""No"")" +p02547,s041453856,Accepted,"def dice(m, n): + for i in range(0, n-2): + if (m[i][0] == m[i][1]) and (m[i + 1][0] == m[i + 1][1]) and (m[i + 2][0] == m[i + 2][1]): + return 'Yes' + return 'No' + +N = int(input()) +mylist = [] +for i in range(0, N): + num = list(map(int, input().split(' '))) + mylist.append(num) + +print(dice(mylist, N))" +p02547,s524304812,Accepted,"def solve(): + n = int(input()) + cnt = 0 + for i in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt > 2: + print(""Yes"") + exit() + print(""No"") + return 0 + +if __name__ == ""__main__"": + solve() +" +p02547,s004912108,Accepted,"N = int(input()) +count = 0 +for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + count = 0 + if count == 3: + print('Yes') + exit() +print('No') +" +p02547,s390158657,Accepted,"N =int(input()) + +now = 0 +ans = ""No"" +for i in range(N): + x, y = map(int, input().split()) + if x == y: + now += 1 + if now == 3: + ans = ""Yes"" + else: + now = 0 + +print(ans) " +p02547,s054361067,Accepted,"n=int(input()) +d= [list(map(int, input().split())) for i in range(n)] +cnt=0 +for i in range(n): + if d[i][0]==d[i][1]: + cnt+=1 + if cnt==3: + print('Yes') + exit() + else: + cnt=0 +print('No')" +p02547,s601300337,Accepted,"N=int(input()) +j=0 +J=0 +for i in range(N): + D1,D2=map(int,input().split()) + if D1==D2: + j+=1 + if j>=3: + J=3 + else: + j=0 +if J>=3: + print('Yes') +else: + print('No')" +p02547,s071968807,Accepted,"n = int(input()) + +renzoku = 0 +flag = 0 +for i in range(n): + d = list(map(int, input().split())) + if d[0] == d[1]: + renzoku += 1 + if renzoku == 3: + flag = 1 + break + else: + renzoku = 0 + +if flag == 0: + print(""No"") +else: + print(""Yes"")" +p02547,s057225253,Accepted,"N = int(input()) +D1, D2 = [], [] +for i in range(N): + li = list(map(int,input().split())) + D1.append(li[0]) + D2.append(li[1]) + +for i in range(N-2): + if D1[i]==D2[i] and D1[i+1]==D2[i+1] and D1[i+2]==D2[i+2]: + print('Yes') + break +else: + print('No') +" +p02547,s089923479,Accepted," +def resolve(): + n = int(input()) + cnt = 0 + for i in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + print('Yes') + return + print('No') + +if __name__ == ""__main__"": + resolve() +" +p02547,s926154248,Accepted,"N=int(input()) +D=[] +count=0 +ans=0 +for i in range(N): + a,b=map(int,input().split()) + D.append([a,b]) + if a==b: + count+=1 + else: + count=0 + if count==3: + ans+=1 +if ans>=1: + print(""Yes"") +else: + print(""No"")" +p02547,s018710310,Accepted,"n=int(input()) +count=0 +for i in range(n): + d1,d2=map(int,input().split()) + if d1==d2: + count+=1 + if count==3: + print('Yes') + exit() + else: + count=0 +print('No') + " +p02547,s656270036,Accepted,"N = int(input()) + +mycnt = 0 +flag = 0 +for n in range(N): + a, b = map(int, input().split()) + if a == b: + mycnt += 1 + if mycnt >= 3: + flag = 1 + else: + mycnt = 0 +if flag == 1: + print('Yes') +else: + print('No')" +p02547,s583772799,Accepted,"import sys +N = int(input()) +x = 0 +for i in range(N): + a,b = map(int,input().split()) + if a == b: + x += 1 + else: + x = 0 + if x == 3: + print(""Yes"") + sys.exit() +print(""No"")" +p02547,s502044853,Accepted,"n = input() +dlist = [] +count = 0 + +for i in range(int(n)): + d = input().split() + dlist.append(d) + +for j in range(int(n)): + if dlist[j][0] == dlist[j][1]: + count += 1 + if count == 3: + break + else: + count = 0 + +if count == 3: + print(""Yes"") +else: + print(""No"")" +p02547,s724120070,Accepted,"def main(): + N = int(input()) + Ds = [list(map(int,input().split())) for _ in range(N)] + count = 0 + for D in Ds: + if D[0]==D[1]: + count += 1 + else: + count = 0 + if count == 3: + print(""Yes"") + return + print(""No"") + +main()" +p02547,s225553380,Accepted,"N = int(input()) +D1 = [0] * N +D2 = [0] * N +for i in range(N): + D1[i], D2[i] = input().split() + +flg = False +for i in range(N -2): + if D1[i] == D2[i] and D1[i + 1] == D2[i + 1] and D1[i + 2] == D2[i + 2]: + flg = True + # break +if flg: + print(""Yes"") +else: + print(""No"") +" +p02547,s293462955,Accepted,"N = int(input()) +D1 = [0]*N +D2 = [0]*N +for i in range(N): + D1[i],D2[i] = map(int, input().split()) + +check = 0 +for i in range(N): + if D1[i]==D2[i]: + check += 1 + else: + check = 0 + + if check == 3: + break + +if check >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s860919041,Accepted,"num = int(input()) + +count = 0 +flag = False +for i in range(num): + a,b = input().split() + if a == b: + count += 1 + if count >= 3: + print(""Yes"") + flag = True + break + else: + count = 0 +if not flag: + print(""No"")" +p02547,s386518491,Accepted,"rolls = [] +for _ in range(int(input())): + x,y = list(map(int,input().split())) + rolls.append((x,y)) +n = len(rolls) +i = 0 +curr = 0 +answer = False; +while i < n: + if rolls[i][0] == rolls[i][1]: + curr+=1; + if curr == 3: + answer = True; + break; + i+=1 + else: + curr = 0 + i+=1; +if answer: + print(""Yes"") +else: + print(""No"") + + " +p02547,s574166492,Accepted,"# 2020/09/19 +# AtCoder Beginner Contest 179 - B + +# Input +n = int(input()) +ans = 'No' +cnt = 0 + +for i in range(n): + d1, d2 = map(int,input().split()) + if d1 == d2: + cnt = cnt + 1 + if cnt >= 3: + ans = 'Yes' + break + else: + cnt = 0 + +# Output +print(ans) +" +p02547,s220552538,Accepted,"N = int(input()) + +max_zoro = 0 +zoro = 0 + +for _ in range(N): + a,b = map(int, input().split()) + if a==b: + zoro += 1 + max_zoro = max(max_zoro, zoro) + else: + zoro = 0 + +if max_zoro >= 3: + print('Yes') +else: + print('No')" +p02547,s618752036,Accepted,"n=int(input()) +l=[] +m=[] +for i in range(0,n): + a,b=map(int,input().split()) + l.append(a) + m.append(b) +c=0 +i=0 +while i<=n-3: + if l[i]==m[i] and l[i+1]==m[i+1] and l[i+2]==m[i+2]: + c=3 + i=i+1 +if c==3: + print('Yes') +else: + print('No') +" +p02547,s581545936,Accepted,"n = int(input()) + +result = False +count = 0 +for i in range(n): + a, b = map(int,input().split()) + if a == b: + count += 1 + if count >= 3: + result = True + break + else: + count = 0 + +if result : + print(""Yes"") +else : + print(""No"")" +p02547,s237376296,Accepted,"def check(): + N = int(input()) + cnt = 0 + for i in range(N): + a,b = map(int, input().split()) + if a==b: + cnt += 1 + if cnt==3: + return 'Yes' + else: + cnt = 0 + return 'No' +print(check())" +p02547,s600503126,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for _ in range(n)] +num = 0 +ans = 0 + +for i in range(n): + d1, d2 = d[i] + if d1==d2: + num += 1 + ans = max(ans, num) + else: + num = 0 + +if ans>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s993303409,Accepted,"N=input() +n=int(N) +x=0 +for s in range(n): + ds1,ds2=input().split() + if ds1==ds2: + x+=1 + else: + x=0 + if x==3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s879978785,Accepted,"N=int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +cnt=0 +result=""No"" +# 出力して確認 +#for n in range(N-1): +for i in range(N): + cnt=cnt+1 if x[i]==y[i] else 0 + if cnt>2: + result=""Yes"" +print(result)" +p02547,s471903142,Accepted,"import sys + +n = int(input()) + +cnt = 0 +for i in range(n): + d1, d2 = input().split() + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + sys.exit() +print('No') +" +p02547,s669418234,Accepted,"n = int(input()) + +flag = 0 +count = 0 +for i in range(n): + sai = input().split("" "") + + if int(sai[0]) == int(sai[1]): + count += 1 + else: + count = 0 + + if count == 3: + flag = 1 + +if flag == 1: + print(""Yes"") +else: + print(""No"") + " +p02547,s755181865,Accepted,"import numpy as np + +N=int(input()) + +D=[] + +for i in range(N): + D.append(np.array(input().split("" ""),dtype=np.int64)) + +cnt=0 +max_cnt=0 +for i in range(N): + if(D[i][0]==D[i][1]): + cnt+=1 + else: + if(cnt>max_cnt): + max_cnt=cnt + cnt=0 + +if(cnt>max_cnt): + max_cnt=cnt + +if(max_cnt>=3): + print(""Yes"") +else: + print(""No"")" +p02547,s553535612,Accepted,"n=int(input()) +d=0 +x=[0 for i in range(n)] +y=[0 for i in range(n)] +for i in range(n): + x[i],y[i]=map(int,input().split()) + +for i in range(n-2): + if(x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]): + d=d+1 + else: + d=d +if(d>0): + print(""Yes"") +else: + print(""No"")" +p02547,s832105978,Accepted,"n=int(input()) + +num_list = [] +for i in range(n): + num_list.append(list(map(int,input().split()))) + +flag_a=0 +flag_b=0 +for i in range(n): + if num_list[i][0]==num_list[i][1] : + flag_a+=1 + else: + flag_a=0 + + if flag_a==3: + flag_b=1 + +if flag_b==1: + print('Yes') +else: + print('No')" +p02547,s309368311,Accepted,"from typing import List, Any + + +def read_int() -> int: + return int(input().strip()) + + +def read_ints() -> List[int]: + return list(map(int, input().strip().split(' '))) + + +def solve() -> Any: + N = read_int() + count = 0 + for _ in range(N): + d0, d1 = read_ints() + if d0 == d1: + count += 1 + if count > 2: + return 'Yes' + else: + count = 0 + return 'No' + + +if __name__ == '__main__': + print(solve()) +" +p02547,s665251556,Accepted,"N = int(input()) +l = [] +m = [] +for i in range(N): + a,b = map(int,input().split()) + l.append(a) + m.append(b) +flg = 0 +c = 0 +for i in range(len(l)): + + if l[i] == m[i]: + c += 1 + if c==3: + flg += 1 + + else: + c = 0 +if flg == 0: + print(""No"") +else: + print(""Yes"")" +p02547,s506404061,Accepted,"N = int(input()) + +c = 0 +for _ in range(N): + a,b = map(int,input().split()) + if a == b: + c += 1 + else: + c = 0 + if c >= 3: + print('Yes') + exit() + +print('No')" +p02547,s786466356,Accepted,"count=0 +result='No' +n=int(input()) +for i in range(n): + d1,d2=map(int,input().split()) + if d1==d2: + count+=1 + if count==3: + result='Yes' + else: + count=0 +print(result)" +p02547,s149383585,Accepted,"N=int(input()) +a=0 +for i in range(N): + x,y=map(int, input().split()) + if x == y: + a += 1 + elif a < 3: + a = 0 +print('Yes' if a >= 3 else 'No') +" +p02547,s939405219,Accepted,"n = int(input()) + +cnt = 0 +for i in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + cnt +=1 + if cnt == 3: + print(""Yes"") + break + else: + cnt = 0 +else: + print(""No"")" +p02547,s832491268,Accepted,"N = int(input()) +ans = 0 +tmp = 0 +for _ in range(N): + a, b = map(int, input().split()) + if a == b: + tmp += 1 + else: + tmp = 0 + ans = max(ans, tmp) + +print(""Yes"" if ans >= 3 else ""No"")" +p02547,s801119951,Accepted,"cnt = input() +same_val_cnt = 0 +ans = ""No"" +for _ in range(1,int(cnt)+1): + a, b = input().split("" "") + if a == b: + same_val_cnt += 1 + else: + same_val_cnt = 0 + + if same_val_cnt == 3: + ans = ""Yes"" + break + +print(ans)" +p02547,s294480361,Accepted,"#B + +N = int(input()) +D = [] +counter = [] + +for i in range(N): + D.append(list(map(int,input().split()))) + +for i in range(N): + if D[i][0] == D[i][1]: + counter.append(1) + if (i >= 2 and counter[i-1]==1 and counter[i-2]==1): + print('Yes') + break + else: + counter.append(0) + if i == N-1: + print('No') + +" +p02547,s267993977,Accepted,"N = int(input()) +ans =0 +cout =0 +for i in range(N): + d1,d2 = list(map(int,input().split())) + if d1==d2: + ans +=1 + if ans ==3: + cout =1 + else: + ans =0 +if cout==1: + print('Yes') +else: + print('No')" +p02547,s950903558,Accepted,"import sys + +n = int(input()) +z = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 != d2: + z = 0 + continue + + z += 1 + if z >= 3: + print('Yes') + sys.exit() + +print('No') +" +p02547,s621608447,Accepted,"def main(): + n = int(input()) + result = [] + for i in range(n): + d1, d2 = map(int, input().split()) + result.append(d1 == d2) + for i in range(n-2): + if result[i] and result[i+1] and result[i+2]: + print(""Yes"") + return 0 + print(""No"") + return 0 + +if __name__ == ""__main__"": + a = main()" +p02547,s336473875,Accepted,"n=int(input()) +ans='No' +daice=[] +for i in range(n): + daice.append(list(map(int,input().split()))) +for j in range(n-2): + if daice[j][0]==daice[j][1]: + if daice[j+1][0]==daice[j+1][1]: + if daice[j+2][0]==daice[j+2][1]: + ans='Yes' +print(ans)" +p02547,s583727858,Accepted,"n = int(input()) +d = [[] for _ in range(n)] +for i in range(n): + d[i] = list(map(int, input().split())) +counter = 0 +for i in d: + if i[0] == i[1]: + if counter == 2: + print(""Yes"") + exit() + else: + counter += 1 + else: + counter = 0 +print(""No"")" +p02547,s999126407,Accepted,"n = int(input()) + +d = [list(map(int, input().split())) for i in range(n)] +count = 0 +for i, j in d: + if i==j: + count += 1 + else: + count = 0 + + if count>=3: + print('Yes') + exit() +print('No')" +p02547,s703990782,Accepted,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +for i in range(N-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print(""Yes"") + break +else: + print(""No"")" +p02547,s707992436,Accepted,"import os +import sys +from atexit import register +from io import BytesIO +sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size)) +sys.stdout = BytesIO() +register(lambda: os.write(1, sys.stdout.getvalue())) +input = lambda: sys.stdin.readline().rstrip('\r\n') +raw_input = lambda: sys.stdin.readline().rstrip('\r\n') + +n = int(input()) +ok = False +cont = 0 +for i in xrange(n): + a,b = (int(x) for x in input().split()) + if a == b: + cont += 1 + if cont == 3: + ok = True + else: + cont = 0 +if ok: + print(""Yes"") +else: + print(""No"")" +p02547,s702622679,Accepted,"n = int(input()) +cnt = 0 +for _ in range(n): + a,b = map(int,input().split()) + if(a==b): + cnt += 1 + else: + cnt = 0 + if(cnt==3): + print('Yes') + exit() +print('No')" +p02547,s956520074,Accepted,"n=int(input()) +g=0 +for i in range(n): + a,b=map(int,input().split("" "")) + if a==b: + g=g+1 + if g==3: + break + break + else: + g=0 + + +if g==3: + print(""Yes"") +else: + print(""No"")" +p02547,s776696035,Accepted,"n = int(input()) +cnt = 0 +flag = False + +for i in range(n): + da, db = map(int, input().split()) + if da == db: + cnt += 1 + else: + cnt = 0 + + if cnt == 3: + flag = True + +if flag: + print(""Yes"") +else: + print(""No"") + " +p02547,s123099127,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for i in range(N)] +tmp = 0 +ans = ""No"" +for i in range(N): + if D[i][0] == D[i][1]: + tmp += 1 + else: + tmp = 0 + if tmp == 3: + ans = ""Yes"" +print(ans)" +p02547,s743409277,Accepted,"def readinput(): + n=int(input()) + ab=[] + for _ in range(n): + a,b=map(int,input().split()) + ab.append((a,b)) + return n,ab + +def main(n,ab): + count=0 + for a,b in ab: + if a==b: + count+=1 + if count>=3: + return 'Yes' + else: + count=0 + return 'No' + +if __name__=='__main__': + n,ab=readinput() + ans=main(n,ab) + print(ans) +" +p02547,s619650518,Accepted,"N = int(input()) +F_S = [list(map(int,input().split())) for _ in range(N)] + +cnt = 0 +for f,s in F_S: + if cnt >= 3: + break + if f == s: + cnt += 1 + else: + cnt = 0 +if cnt >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s340120087,Accepted,"d = 0 +o = 0 +for i in range(int(input())): + a, b = map(int, input().split()) + if a==b: + d += 1 + else: + d = 0 + if d == 3: + o = 1 +if o: print(""Yes"") +else: + print(""No"") + +" +p02547,s127294748,Accepted,"n = int(input()) +d = [] +cnt = 0 + +for i in range(n): + d.append(list(map(int, input().split()))) + +for i in range(n): + if d[i][0] == d[i][1]: + cnt += 1 + if cnt == 3: + print('Yes') + exit() + else: + cnt = 0 + +print('No')" +p02547,s274156742,Accepted,"n=int(input()) +x= [list(map(int, input().split())) for i in range(n)] +ans=""No"" +for i in range(n-2): + if (x[i][0]==x[i][1]) and (x[i+1][0]==x[i+1][1]) and (x[i+2][0]==x[i+2][1]): + ans=""Yes"" +print(ans)" +p02547,s247568211,Accepted,"N = int(input()) +D = list() +D.append(0) +for i in range(1, N + 1): + x, y = input().split() + s = 1 + D[i - 1]if x == y else 0 + D.append(s) +if 3 in D: + print('Yes') +else: + print('No') +" +p02547,s238057027,Accepted,"n = int(input()) +a = [0] * n +b = [0] * n +for i in range(n): + a[i], b[i] = map(int, input().split()) + +cnt = 0 + +for i in range(n-2): + c = a[i] - b[i] + if c == 0: + d = a[i+1] - b[i+1] + if d == 0: + e = a[i+2] - b[i+2] + if e == 0: + cnt += 1 + +if cnt == 0: + print('No') +else: + print('Yes')" +p02547,s465551869,Accepted,"#B +N=int(input()) +cnt=0 +ans=""No"" +for i in range(N): + a,b = map(int,input().split()) + if a==b: + cnt +=1 + else: + cnt=0 + if cnt==3: + ans=""Yes"" + break +print(ans)" +p02547,s166525442,Accepted,"N = int(input()) +cnt = 0 +ans = ""No"" +for _ in range(N): + d, a = list(map(int, input().split())) + if d == a: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + ans = ""Yes"" + +print(ans)" +p02547,s386428215,Accepted,"t=int(input()) +count = 0 +flag = False +for test in range(t): + a,b = map(int,input().split()) + if a==b: + count+=1 + if count==3: + flag=True + else: + count=0 + +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s130670097,Accepted,"n = int(input()) +cnt = [False]*n + +for i in range(n): + x,y = map(int, input().split()) + cnt[i] = x == y + +ans = 'No' + +for i in range(n-2): + if cnt[i] and cnt[i+1] and cnt[i+2]: + ans = 'Yes' + +print(ans)" +p02547,s135283405,Accepted,"N = int(input()) +val = 0 +def mojicheck(a,b): + if a==b: + return 1 + else: + return 0 +flag = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + flag = mojicheck(d1,d2) + + if flag == 0: + val = 0 + elif flag == 1: + val += 1 + if val ==3: + break +if val >=3: + print('Yes') +else: + print('No') +" +p02547,s196358439,Accepted,"N = int(input()) +count = 0 +result = False +for i in range(N): + D1, D2 = map(int, input().split("" "")) + if D1 == D2: + count = count + 1 + if count >= 3: + result = True + else: + count = 0 +if result: + print('Yes') +else: + print('No') +" +p02547,s142789996,Accepted,"N = int(input()) + +M = 0 +ans = 'No' + +for _ in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + M += 1 + if M >= 3: + ans = 'Yes' + else: + M = 0 + +print(ans) +" +p02547,s392134103,Accepted,"c=0 +for _ in range(int(input())): + x,y = map(int,input().split()) + + if x==y: + c+=1 + else: + c=0 + if c==3: + c=-1 + print('Yes') + break +if c!=-1: + print('No') +" +p02547,s349633130,Accepted,"n=int(input()) + +count=0 +c_list=[1] + +for i in range(n): + d1, d2=map(int, input().split()) + if d1==d2: + count+=1 + c_list.append(count) + #print(c_list) + else: + count=0 + +if max(c_list)>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s360496668,Accepted,"import sys +input = sys.stdin.readline + +N=int(input()) +D=[tuple(map(int,input().split())) for i in range(N)] +flag=0 + +for i in range(N-2): + if D[i][0]==D[i][1] and D[i+1][0]==D[i+1][1] and D[i+2][0]==D[i+2][1]: + flag=1 + +if flag==1: + print(""Yes"") +else: + print(""No"") +" +p02547,s623664243,Accepted,"import sys + +def main(): + N = int(input()) + zoro = 0 + for i in range(N): + Ds = [int(s) for s in sys.stdin.readline().split()] + if(Ds[0] == Ds[1]): + zoro += 1 + if(zoro > 2): + print(""Yes"") + return(0) + else: + zoro = 0 + print(""No"") + +main()" +p02547,s300814951,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] +cnt = 0 + +for i in range(n): + d1, d2 = d[i] + if d1 == d2: + cnt += 1 + if cnt == 3: + print(""Yes"") + exit(0) + else: + cnt = 0 + +print(""No"")" +p02547,s547993620,Accepted,"a =int( input()) +_number=0;_kaerichi=""No"" +for i in range(a): + b, c = map(int, input().split()) + if(b==c): + _number+=1 + else: + _number=0 + + if(_number==3): + _kaerichi=""Yes"" +print(_kaerichi) +" +p02547,s064280385,Accepted,"n = int(input()) +s = '' +for i in range(n): + a, b = map(int, input().split(' ')) + if a == b: + s += '1' + else: + s += '0' + +if '111' in s: + print('Yes') +else: + print('No')" +p02547,s833627231,Accepted,"N = int(input()) +happed = [list(map(int, input().split())) for _ in range(N)] +cnt = 0 +for d1, d2 in happed: + if d1 == d2: + cnt += 1 + if cnt == 3: + print(""Yes"") + exit() + else: + cnt = 0 +print(""No"") +" +p02547,s417718127,Accepted,"n=int(input()) + +d1=[0]*n +d2=[0]*n + +for i in range(n): + d1[i],d2[i]=map(int,input().split()) + +cnt=0 +ans=""No"" + +for i in range(n): + if d1[i]==d2[i]: + cnt+=1 + + if cnt==3: + ans=""Yes"" + break + + if d1[i]!=d2[i]: + cnt=0 + + +print(ans)" +p02547,s462145105,Accepted,"import sys +N = int(input()) +count = 0 +for i in range(N): + tmp = input().split() + if tmp[0] == tmp[1]: + count = count + 1 + if count >= 3: + print(""Yes"") + sys.exit() + else: + count = 0; + +print(""No"")" +p02547,s930820045,Accepted,"N = int(input()) + +D = [] +for _ in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + D.append(True) + else: + D.append(False) + +for i in range(N-2): + if D[i] and D[i+1] and D[i+2]: + print('Yes') + exit(0) +print('No') +" +p02547,s600029750,Accepted,"n = int(input()) +c = 0 +for i in range(n): + d,e = map(int, input().split()) + if d == e: + c += 1 + if c == 3: + print(""Yes"") + break + else: + c = 0 +else: + print(""No"")" +p02547,s650804820,Accepted,"n = int(input()) + +ans = 'No' +count = 0 +for i in range(n): + a,b = map(int,input().split()) + if a==b: + count += 1 + if count == 3: + ans = 'Yes' + else: + count = 0 + +print(ans) " +p02547,s953171929,Accepted,"N = int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] + +count=0 +for i in range(0,N-2): + if x[i]==y[i]: + if x[i+1]==y[i+1]: + if x[i+2]==y[i+2]: + count = count+1 + else: + pass + else: + pass + else: + pass + +if count>0: + print(""Yes"") +else: + print(""No"")" +p02547,s303110523,Accepted,"N=int(input()) + +cnt=0 +for _ in range(N): + D1,D2=map(int,input().split()) + if D1==D2: + cnt+=1 + else: + cnt=0 + + if cnt==3: + print(""Yes"") + break +else: + print(""No"")" +p02547,s644486141,Accepted,"N=int(input()) +cnt=0 +maxcnt=0 +for i in range(N): + tmp = input().split() + tmp1=int(tmp[0]) + tmp2=int(tmp[1]) + if tmp1 == tmp2: + cnt+=1 + else: + cnt=0 + + if cnt > maxcnt: + maxcnt=cnt + +if maxcnt >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s197380496,Accepted,"n = int(input()) +l = [list(map(int, input().split())) for l in range(n)] +tmp = 0 +ans = False +for i in range(n): + if l[i][0] == l[i][1]: + tmp += 1 + if tmp == 3: + ans = True + break + else: + tmp = 0 +if ans: + print(""Yes"") +else: + print(""No"")" +p02547,s936269743,Accepted,"n = int(input()) +ans = 0 +cnt = 0 +ch = [[0,0]]*1000 +for i in range(n): + a,b = map(int,input().split()) + ch.append([a,b]) + if a == b: + cnt += 1 + else: + ans = max(ans,cnt) + cnt = 0 +for i in range(len(ch)): + if ch[i][0] != ch[i][1]: + break +else: + print(""Yes"") + exit() +if ans >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s397156353,Accepted,"N = int(input()) + +flg = False +cnt = 0 +for i in range(N): + d1, d2 = map(int, input().split()) + + if(d1 == d2): + cnt += 1 + else: + cnt = 0 + + if(cnt >= 3): + flg = True + + +print(""Yes"" if flg else ""No"")" +p02547,s091654454,Accepted,"n=int(input()) +count=0 +l=[] +for _ in range(n): + d1,d2=map(int,input().split()) + if d1==d2: + count+=1 + else: + count=0 + l.append(count) +if l.count(3)!=0: + print('Yes') +else: + print('No')" +p02547,s547234591,Accepted,"N = int(input()) +A=[list(map(int, input().split())) for i in range(N)] +num = 0 +zoro = 0 +while num < N: + if A[num][0] ==A[num][1]: + num +=1 + zoro +=1 + else: + num +=1 + if zoro >2: + zoro = zoro + else: + zoro = 0 +if zoro >2 : + print(""Yes"") +else: + print(""No"")" +p02547,s336308536,Accepted,"n=int(input()) +cnt=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + cnt+=1 + if cnt==3: + print(""Yes"") + break + else: + cnt=0 +else: + print(""No"")" +p02547,s191734917,Accepted,"cnt=0 +b=True +for i in range(int(input())): + x,y=list(map(int,input().split())) + if x==y: + cnt+=1 + else: + cnt=0 + if cnt==3: + b=False + print(""Yes"") +if b: + print('No') +" +p02547,s059272731,Accepted,"N = int(input()) +D1 = [0] * N +D2 = [0] * N +for i in range(N): + D1[i], D2[i] = map(int, input().split()) +c = 0 +a = 0 + +for d1, d2 in zip(D1, D2): + if d1 == d2: + c += 1 + else: + c = 0 + if c >= 3: + print(""Yes"") + break + +if c < 3: + print(""No"")" +p02547,s470269191,Accepted,"n = int(input()) +d = [list(map(int,input().split())) for _ in range(n)] +cnt = """" +for x,y in d: + if x==y: + cnt+=""1"" + else: + cnt+=""0"" + +cnt = cnt.split(""0"") +ans = 0 +for s in cnt: + ans = max(ans,len(s)) +print(""Yes"" if ans>=3 else ""No"")" +p02547,s240572925,Accepted,"n = int(input()) +cnt = 0 +f = False +for i in range(n): + a = list(map(int, input().split())) + if a[0] == a[1]: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + f = True +if f: + print(""Yes"") +else: + print(""No"")" +p02547,s385031640,Accepted,"ma = lambda :map(int,input().split()) +lma = lambda :list(map(int,input().split())) +tma = lambda :tuple(map(int,input().split())) +ni = lambda:int(input()) +yn = lambda fl:print(""Yes"") if fl else print(""No"") +ips = lambda:input().split() +import collections +import math +import itertools +import heapq as hq +n = ni() +cnt=0 +f=False +for i in range(n): + d1,d2 = ma() + if d1==d2: + cnt+=1 + else: + cnt=0 + if cnt==3: + f=True + break +yn(f) +" +p02547,s152238097,Accepted,"n = int(input()) +z = [] +cnt = 0 +for _ in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + else: + cnt = 0 + + if cnt == 3: + print('Yes') + exit() +print('No')" +p02547,s482115567,Accepted,"n = int(input()) +ds = [] +for i in range(n): + d_1, d_2 = map(int, input().split()) + ds.append((d_1, d_2)) +for j in range(n-2): + if ds[j][0] == ds[j][1] and ds[j+1][0] == ds[j+1][1] and ds[j+2][0] == ds[j+2][1]: + print(""Yes"") + exit() +print(""No"")" +p02547,s170893559,Accepted,"N = int(input()) +X = [] +Y = [] +answer = 'No' +for i in range(N): + x,y = map(int, input().split()) + X.append(x) + Y.append(y) +for j in range(N-2): + if ((X[j]==Y[j])and(X[j+1]==Y[j+1])and(X[j+2]==Y[j+2])): + answer = 'Yes' +print(answer) +" +p02547,s934934900,Accepted,"def main(): + n = int(input()) + D = [list(map(int, input().split())) for i in range(n)] + for i in range(2, n): + if D[i-2][0] == D[i-2][1]: + if D[i-1][0] == D[i-1][1]: + if D[i][0] == D[i][1]: + print('Yes') + exit() + print('No') +if __name__ == '__main__': + main()" +p02547,s666706370,Accepted,"n = int(input()) +d = [] +c = 0 +ans = 'No' +for i in range(n): + d1, d2 = [int(_) for _ in input().split()] + if d1 == d2: + c += 1 + else: + c = 0 + if c == 3: + ans = 'Yes' +print(ans)" +p02547,s090691815,Accepted,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] +x = 0 + +for i in range(n): + if d[i][0] == d[i][1]: + x += 1 + else: + x = 0 + if x == 3: + print(""Yes"") + exit() +print(""No"")" +p02547,s498336061,Accepted,"N = int(input()) + +P = [list(map(int,input().split())) for _ in range(N)] + +count = [0] +for p in P: + if p[0] == p[1]: + count.append(count[-1]+1) + else: + count.append(0) + +if max(count) >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s287943705,Accepted,"N = int(input()) +A = [] +B = [] +s = 0 +for x in range(N): + a, b = input().split() + a = int(a) + b = int(b) + A.append(a) + B.append(b) +for i in range(N): + if A[i] == B[i]: + s = s+1 + else: + if s >= 3: + s = s + 0 + else: + s = 0 +if s >= 3: + print('Yes') +else: + print('No')" +p02547,s885658408,Accepted,"N = int(input()) +D = [list(map(int,input().split())) for _ in range(N)] + +count = 0 +flag = 0 +for i in range(N): + if D[i][0] == D[i][1]: + count += 1 + else: + count = 0 + + if count >= 3: + flag = 1 + +print(""Yes"" if flag == 1 else ""No"")" +p02547,s680416710,Accepted,"n=int(input()) +c=0 +m=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c+=1 + else: + c=0 + m=max(c,m) +if m>=3: + print(""Yes"") +else: + print(""No"") +#print(c)" +p02547,s212950016,Accepted,"import sys +input=sys.stdin.readline + +n=int(input()) +l=[] +for i in range(n): + x,y=map(int,input().split()) + if x==y: + l.append(1) + else: + l.append(0) + +count=0 +for i in range(n): + if l[i]==1: + count+=1 + else: + count=0 + if count==3: + print('Yes') + sys.exit() +print('No')" +p02547,s776843330,Accepted,"if __name__==""__main__"": + N = int(input()) + same = 0 + for i in range(N): + D1, D2 = (int(x) for x in input().split()) + if D1==D2: + same += 1 + else: + if same>=3: + continue + else: + same = 0 + if same>=3: + print('Yes') + else: + print('No')" +p02547,s555807454,Accepted,"n = int(input()) +count = 0 +for i in range(n): + d1, d2 = input().split() + if d1 == d2: + count += 1 + else: + count = 0 + if count == 3: + print(""Yes"") + exit() +print(""No"")" +p02547,s610111876,Accepted," +n = int(input()) + +cnt = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + if cnt >= 3: + print(""Yes"") + exit() + else: + cnt = 0 + +print(""No"") +" +p02547,s253005753,Accepted,"n=int(input()) +l=[list(map(int,input().split())) for _ in range(n)] +f=[] +for x in l: + f.append(x[0]==x[1]) +l=f.copy() +i=0 +while i2: + print('Yes') + break + i+=j +else: + print('No') + " +p02547,s786760546,Accepted,"n = int(input()) +ans = 'No' +cnt = 0 +for _ in range(n): + a, b = map(int, input().split()) + if a == b: + cnt += 1 + if cnt >= 3: + ans = 'Yes' + continue + cnt = 0 +print(ans) " +p02547,s958355097,Accepted,"N = int(input()) +S = [] +judge = 0 +for i in range(N): + S += [input().split()] +for i in range(N): + if i <= N-3: + if S[i][0] == S[i][1]: + if S[i+1][0] == S[i+1][1]: + if S[i+2][0] == S[i+2][1]: + print(""Yes"") + judge = 1 + break +if judge == 0: + print(""No"")" +p02547,s350202014,Accepted,"N = int(input()) +cnt = 0 +for _ in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + print(""Yes"") + exit() +print(""No"") +" +p02547,s115334575,Accepted,"n = int(input()) +cnt = 0 +ans = False +for i in range(n): + a, b = map(int,input().split()) + if a==b: + if cnt == 2: + ans = True + break + cnt += 1 + else: + cnt = 0 + + +if ans: + print('Yes') +else: + print('No')" +p02547,s405024816,Accepted,"n=int(input()) +ans=""No"" +num=0 +for i in range(n): + d1,d2=list(map(int,input().split())) + if d1==d2: + num+=1 + if num==3: + ans='Yes' + break + else: + num=0 + continue +print(ans)" +p02547,s382133327,Accepted,"N = int(input()) +flag = 0 +ans = False +for _ in range(N): + d1,d2 = map(int,input().split()) + if d1==d2: + flag += 1 + if flag==3: + ans = True + break + else: + flag = 0 +print('Yes' if ans else 'No')" +p02547,s228047968,Accepted,"n = int(input()) +cnt = 0 +p = 0 +for i in range(n): + a,b = map(int,input().split()) + if(a == b): + cnt += 1 + else: + cnt *= 0 + if(cnt >= 3): + p = 1 +if(p == 1): + print('Yes') +else: + print('No')" +p02547,s442729634,Accepted,"roop_num = int(input()) + +xy = [map(int, input().split()) for _ in range(roop_num)] +x, y = [list(i) for i in zip(*xy)] + +z_counter = 0 +flg = False + +for i in range(roop_num): + if(x[i] == y[i]): + z_counter = z_counter +1 + else: + z_counter = 0 + if(z_counter == 3): + flg = True + break + +if(flg): + print(""Yes"") +else: + print(""No"") +" +p02547,s704864381,Wrong Answer,"def solve(): + n = int(input()) + rolls = [list(map(int,input().split())) for i in range(n)] + for i in range(n-3): + if rolls[i][0]==rolls[i][1] and rolls[i+1][0]==rolls[i+1][1] and rolls[i+2][0]==rolls[i+2][1]: + return True + + return False + +print(""Yes"" if solve() else ""No"")" +p02547,s955805966,Wrong Answer,"N = int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +count = 0 +for i in range(N-3): + if x[i] == y[i] and x[i+1] == y[i+1] and x[i+2] == y[i+2]: + count += 1 + print(""Yes"") + break + +if count == 0: + print(""No"")" +p02547,s082065787,Wrong Answer,"import numpy as np +n = int(input()) +d = np.array([list(map(int,input().split())) for i in range(n)]) +D = np.abs(d[:,0]-d[:,1]) +f = False +for i in range(n-3): + if D[i:i+3].sum() == 0: + f = True + break +print('Yes' if f else 'No')" +p02547,s344998964,Wrong Answer,"N = int(input()) +cnt = [] +for i in range(N): + a,b= map(int, input().split()) + if a == b: + cnt.append(1) + else: + cnt.append(0) + +from itertools import groupby +gr = groupby(cnt) +for key, group in gr: + if len(list(group)) >= 3: + print('Yes') + exit() +print('No') + +" +p02547,s341335731,Wrong Answer,"N=int(input()) +j=0 +for i in range(N): + D1,D2=map(int,input().split()) + if D1==D2: + j+=1 + else: + j=0 +if j>=3: + print('Yes') +else: + print('No')" +p02547,s710071671,Wrong Answer,"n = int(input()) +d1 = [0]*n +d2 = [0]*n +h = 'No' +for i in range(n): + d1[i], d2[i] = map(int, input().split()) + if i > 2: + if d1[i] == d2[i]: + if d1[i-1] == d2[i-1]: + if d1[i-2] == d2[i-2]: + h = 'Yes' + break +print(h)" +p02547,s748168164,Wrong Answer,"n = int(input()) +flg = False +tmp = 0 +ans = 0 +for i in range(n): + a, b = map(int, input().split()) + if not flg and a == b: + tmp = 1 + flg = True + elif flg and a == b: + tmp += 1 + ans = max(ans, tmp) +print(""Yes"" if ans >= 3 else ""No"") +" +p02547,s014439428,Wrong Answer,"n = int(input()) +x = [list(map(int,input().split())) for i in range(n)] + +count=0 +for i in x: + if count==3: + print(""Yes"") + break + elif i[0]==i[1]: + count+=1 + else: + count=0 +else: + print(""No"")" +p02547,s171961778,Wrong Answer,"def solution(): + N = int(input()) + xy = [map(int, input().split()) for _ in range(N)] + x, y = [list(i) for i in zip(*xy)] + + cnt = 0 + for i in range(N): + if cnt >= 3: + return 'Yes' + if x[i] == y[i]: + cnt += 1 + else: + cnt = 0 + return 'No' + +print (solution())" +p02547,s579278025,Wrong Answer,"N=input() +n=int(N) +x=0 +for s in range(n): + ds1,ds2=input().split() + Ds1=int(ds1) + Ds2=int(ds2) + if Ds1==Ds2: + x+=1 + else: + x+=0 +if x>3: + print(""Yes"") +else: + print(""No"")" +p02547,s785936661,Wrong Answer,"def main(): + n = int(input()) + + count = 0 + answer = 'No' + for i in range(n): + d = list(map(int, input().split())) + if d[0] == d[1]: + count += 1 + if count >= 3: + answer = 'Yes' + + print(answer) + + +if __name__ == '__main__': + main() +" +p02547,s453116492,Wrong Answer,"N = int(input()) +sub_yes = 0 +max_yes = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + sub_yes += 1 + if sub_yes > max_yes: + max_yes = sub_yes + else: + if sub_yes > max_yes: + max_yes = sub_yes + sub_yes = 0 +if max_yes >= 3: + print(""yes"") +else: + print(""no"")" +p02547,s646337185,Wrong Answer,"n=int(input()) +c=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c.append(1) + else: + c.append(0) +cnt=0 +for j in range(2,n): + if c[j-2]==c[j-1] and c[j-1]==c[j]: + print(""Yes"") + break + if j==n: + print(""No"")" +p02547,s888245676,Wrong Answer,"n = int(input()) +num_list = [] +for i in range(n): + num_list.append(list(map(int,input().split()))) + +ans = [] +for i in range(n): + a = num_list[i] + a1= a[0] + a2 = a[1] + if a1 == a2: + ans.append(1) + if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1: + print('Yes') + break + else: + ans.append(0) +if len(ans) == n and n != i+1 : + print('No')" +p02547,s350541825,Wrong Answer,"N=int(input()) +count=0 +for i in range(N): + a,b=map(int,input().split()) + + if a==b: + count+=1 + if count==3: + print(""Yes"") + exit() + else: + pass + if a!=b: + count==0" +p02547,s313568129,Wrong Answer,"import sys +n = int(input()) +x = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 != d2: + x = 0 + else: + x += 1 + if x == 3: + print(""Yes"") + sys.exit +if x != 3: + print(""No"")" +p02547,s683669140,Wrong Answer,"cnt = 0 +n = int(input()) +for i in range(0,n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3 : + print(""Yes"") + break + else: + cnt == 0 + + if cnt != 3 and i == n-1: + print(""No"")" +p02547,s088912078,Wrong Answer,"n=int(input()) +ans=0 +x=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b and i==x+1: + ans+=1 + x=i + if ans==3: + x=0 + break + elif a==b and i!=x+1: + x=i + ans=0 +if ans==3: + print('Yes') +else: + print('No') + " +p02547,s696658173,Wrong Answer,"N = int(input().strip()) + + + +a = [] +c = [] +f = 0 +s=""No"" +for i in range(N): + array = list(map(int, input().strip().split())) + a.append(array) + + +for i in range(N): + if(f == 0 or f == i-1): + if(a[i][0] == a[i][1]): + f+=1 + else: + if(f >=3): + s=""Yes"" + f=0 +if(f >=3): + s=""Yes"" + +if(s==""Yes""): + print(""Yes"") +else: + print(""No"")" +p02547,s643865144,Wrong Answer,"ii = lambda: int(input()) +mi = lambda: map(int, input().split()) +li = lambda: list(map(int, input().split())) + +n = ii() +b = [] +c = [0] +for i in range(n): + l = li() + b.append(1 if l[0] == l[1] else 0) + if i != 0: + c.append(c[i-1]+1 if b[i] == 1 else 0) + +print(""Yes"" if max(c) > 2 else ""No"")" +p02547,s226320469,Wrong Answer,"n = int(input()) +x = 0 + +for i in range(n): + a, b = map(int, input().split()) + if a == b: + x += 1 + +if x >= 3: + print('Yes') +else: + print('No') +" +p02547,s907464724,Wrong Answer,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] + +for i in range(n - 2): + if all([d[i + j][0] == d[i + j][1] for j in range(2)]): + print('Yes') + exit() + +print('No') +" +p02547,s687691234,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if count > 2: + break + else: + if d1 == d2: + count += 1 + else: + count == 0 +if count > 2: + print(""Yes"") +else: + print(""No"")" +p02547,s720477700,Wrong Answer,"n = int(input()) + +cnt = 0 + +for i in range(n): + a, b = map(int, input().split()) + + if cnt >= 3: + print('Yes') + exit() + if a == b: + cnt += 1 + + else: + cnt = 0 + +print('No')" +p02547,s633121859,Wrong Answer,"import sys + +N = int(input()) +ans = 0 + +for i in range(N): + if ans >= 3: + print(""Yes"") + sys.exit() + + a,b = map(int,input().split()) + if a == b: + ans +=1 + else: + ans =0 +print(""No"") + " +p02547,s893132084,Wrong Answer,"n = int(input()) +ans = 'No' + +a = [input().split() for i in range(n)] + +for i in range(0,n-3): + if a[i][0]== a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]: + ans = 'Yes' + break + +print(ans)" +p02547,s597950073,Wrong Answer,"n = int(input()) +ans = ""No"" +j = 0 +for i in range(n): + d,dd = map(str,input().split()) + if(d==dd): + if(j>0): + j += 1 + if(j==3): + ans = ""Yes"" + else: + j=0 +print(ans)" +p02547,s549570338,Wrong Answer,"n = int(input()) +D = [] * n + +for i in range(n): + D.append(list(map(int, input().split()))) + +ans = 0 +count = 0 + +for i in range(1, n): + if D[i][0] == D[i][1]: + count += 1 + else: + ans = max(count, ans) + count = 0 + +if count == n-1: + print('Yes' if count >= 3 else 'No') +else: + print('Yes' if ans >= 3 else 'No')" +p02547,s603249043,Wrong Answer,"N = int(input()) + +mulArr = [] +for _ in range(N): + arr = list(map(int, input().split("" ""))) + mulArr.append(arr) +print(mulArr) + +result = 0 +for i in range(0, len(mulArr) - 2): + print(i) + if mulArr[i][0] == mulArr[i][1] and mulArr[i + 1][0] == mulArr[i + 1][1] and mulArr[i + 2][0] == mulArr[i + 2][1]: + result += 1 + +print(result) +if result != 0: + print(""Yes"") +else: + print(""No"") +" +p02547,s302451202,Wrong Answer,"cnt = int(input()) +chain = 0 +first = 0 +second = 0 + +for i in range(cnt): + nList = list(map(int, input().split())) + first = nList.pop() + second = nList.pop() + if first == second: + chain = chain + 1 + else: + chain = 0 + +if chain >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s507763604,Wrong Answer,"import numpy as np + +n = int(input("""")) +a = np.zeros((n,2)) +cnt = 0 + +for i in range(n): + a[i] = input().split() + if a[i,0] == a[i,1]: + a[i] = [0] + +for i in range(n-1): + if a[i,0] == a[i+1,0]: + cnt += 1 + print(cnt , i) + elif cnt >= 2: + cnt = cnt + else: + cnt = 0 + + +if cnt >= 2: + print(""Yes"") +else: + print(""No"")" +p02547,s338207512,Wrong Answer,"a = [] +for i in range(int(input())): + a.append(input().split()) +triplets = 0 +for i in a: + if(i[0] == i[1]): + triplets += 1 + else: + triplets = 0 + +print('Yes' if triplets >= 3 else 'No') + +" +p02547,s393020889,Wrong Answer,"n = int(input().strip()) +count = 0 +for i in range(n): + a,b = map(int,input().strip().split()) + if a == b and count == 3: + print('YES') + elif a == b: + count += 1 + else: + count = 0 +print('NO')" +p02547,s291067211,Wrong Answer,"n = int(input()) +d = [tuple(map(int, input().split())) for _ in range(n)] + +ans=0 +for k in d: + if ans >= 3: + print(""Yes"") + raise SystemExit(0) + if k[0] == k[1]: + ans+=1 + else: + ans = 0 +print(""No"") +" +p02547,s649312214,Wrong Answer,"n = int(input().strip()) +count = 0 +for i in range(n): + a,b = map(int,input().strip().split()) + if a == b and count == 3: + print('Yes') + elif a == b: + count += 1 + else: + count = 0 +print('No') +" +p02547,s799449635,Wrong Answer,"n=int(input()) +k=0 +c=0 +for i in range(n): + a,b=map(int,input().split()) + if(a==b): + k+=1 + if(k>=3): + c=1 + else: + k=0 + +if(c==1): + print(""YES"") +else: + print(""NO"") +" +p02547,s881379057,Wrong Answer,"N = int(input()) + + +ans = 0 +stock = 0 +for i in range(N): + a,b = map(int, input().split()) + if a == b: + ans += 1 + +print('Yes' if (ans > 2) else ""No"") +" +p02547,s883567761,Wrong Answer,"import itertools +n = int(input()) +count = 0 +line = [input().split() for i in range(n)] +line = list(itertools.chain.from_iterable(line)) + +for j in range(len(line)-2): + if line[j] == line[j+1]: + if line[j+2] == line[j]: + count += 1 + print('Yes') + else: + continue +if count == 0: + print('No')" +p02547,s646496257,Wrong Answer,"n = int(input()) +i = 0 +for _ in range(n): + x, y = map(int, input().split()) + if x == y: + i += 1 +if(i < 3): + print(""No"") +else: + print(""Yes"") +" +p02547,s349923101,Wrong Answer,"n=int(input()) +g=0 +for i in range(n): + a,b=map(int,input().split("" "")) + if a==b: + g=g+1 + if g==3: + break + break + else: + g=0 +print(g) +if g==3: + print(""Yes"") +else: + print(""No"")" +p02547,s832209159,Wrong Answer,"N = int(input()) + +flag = 0 + +for i in range(N): + a,b = map(int,input().split()) + if a == b: + flag += 1 + else: + flag = 0 + +if flag >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s210558384,Wrong Answer,"print(""YNEOS""[""000"" not in """".join([str(eval(input().replace("" "",""-"")))for _ in ""_""*int(input())])::2])" +p02547,s133705075,Wrong Answer,"n = int(input()) +flag= True +count = 0 +for i in range(n): + a,b = list(map(int, input().split())) + if a==b: + count += 1 + else: + count= 0 + if count==3: + flag = True +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s366068502,Wrong Answer,"import sys + +n = int(input()) +cnt = 0 +for i in range(n): + a,b = map(int,input().split()) + if cnt == 3: + print('Yes') + sys.exit() + if a == b: + cnt += 1 + else: + cnt = 0 +print('No') +" +p02547,s590543027,Wrong Answer,"import sys +si=sys.stdin.readline + +n=int(si()) +t=0 +while n: + n-=1 + a,b=[int(e) for e in si().split()] + if a==b: + t+=1 + else: + t=0 +if t>=3: + print('Yes') +else: + print('No') + " +p02547,s405874437,Wrong Answer,"n=int(input()) +from itertools import groupby as gb +l=[eval(input().replace(' ','==')) for i in range(n)] + +var=[(a,len(list(b))) for a,b in gb(l)] +for a,b in var: + if b>=3:print(""Yes"");exit() +print(""No"")" +p02547,s722176074,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if count > 2: + break + elif d1 == d2: + count += 1 + else: + count == 0 +if count > 2: + print(""Yes"") +else: + print(""No"")" +p02547,s423237843,Wrong Answer,"n = int(input()) + +pv = [] +con = 0 + +while n > 0: + n -= 1 + s = str(input()) + d = s.split() + if d[0] == d[1]: + con += 1 + else: + pv += [con] + con = 0 + +pv += [con] +ans = max(pv) + +if ans >= 3: + print('Yes') +else: + print('NO')" +p02547,s034653123,Wrong Answer,"#!/usr/bin/env python3 +N = int(input()) + +count = 0 +result = 'No' +for i in range(1, N): + d1, d2 = map(int, input().split()) + if(d1 == d2): + count += 1 + else: + count = 0 + if(count == 3): + result = 'Yes' + +print(result) +" +p02547,s484995384,Wrong Answer,"a =int( input()) +_number=0;_kaerichi=""No"" +for i in range(a): + b, c = map(int, input().split()) + if(b==c): + _number+=1 + if(_number==3): + _kaerichi=""Yes"" +print(_kaerichi) +" +p02547,s425077640,Wrong Answer,"N = int(input()) +x = [0] * N +y = [0] * N +for i in range(N): + x[i], y[i] = map(int, input().split()) + + + +n = 0 +for i in range(N-1): + if x[i] == y[i]: + n = n+1 + elif n >=3: + break + else: + n = 0 + +if n >= 3: + print(""Yes"") +else: + print(""No"") + " +p02547,s903951839,Wrong Answer,"N = int(input("""")) +count = 0 +for i in range(N): + D = (input("""")) + l = D.split() + l_i = [int(s) for s in l] + if l_i[0] == l_i[1]: + count += 1 +if count > 2: + print(""Yes"") +else: + print(""No"")" +p02547,s763426394,Wrong Answer,"def main(): + n = int(input()) + cnt = 0 + for i in range(n): + a,b = map(int,input().split()) + if cnt == 3: + print('Yes') + return + if a == b: + cnt += 1 + else: + cnt = 0 + print('No') + +main() +" +p02547,s969919946,Wrong Answer,"n = int(input()) +count = 0 +flag = False +c = [0]*n +while count < n: + a, b = map(int, input().split()) + count += 1 + if a == b and count < n: + a, b = map(int, input().split()) + count += 1 + if a == b and count < n: + a, b = map(int, input().split()) + count += 1 + if a == b and count < n: + flag = True + print(""Yes"") + break + +if flag == False: + print(""No"") + + + + + " +p02547,s199308244,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for i in range(N)] +if 3 < N: + for i in range(N-3): + if D[i][0] == D[i][1]: + if D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print('Yes') + exit() +else: + print('No') + exit() +print('No')" +p02547,s593410278,Wrong Answer,"n=int(input()) +k=0 +for i in range(n): + a,b=map(int,input().split()) + if(a==b): + k+=1 +if(k>=3): + print(""YES"") +else: + print(""NO"")" +p02547,s185273622,Wrong Answer,"def solution(): + N = int(input()) + xy = [map(int, input().split()) for _ in range(N)] + x, y = [list(i) for i in zip(*xy)] + + cnt = 0 + flg = 0 + for i in range(N): + if x[i] == y[i]: + if flg+1 == i: + cnt += 1 + flg = i + else: + cnt = 0 + + if cnt >= 3: + return 'Yes' + return 'No' + +print (solution())" +p02547,s865813160,Wrong Answer,"n = int(input().strip()) +count = 0 +for i in range(n): + a,b = map(int,input().strip().split()) + if a == b and count == 3: + print('Yes') + exit(0) + elif a == b: + count += 1 + elif(a != b): + count = 0 +if count == 3: + print('Yes') +else: + print('No') +" +p02547,s934219732,Wrong Answer,"n = int(input()) +d = [tuple(map(int, input().split())) for _ in range(n)] + +ans=0 +for k in d: + if k[0] == k[1]: + ans+=1 +print(""YNeos""[ans<3::2]) +" +p02547,s350253972,Wrong Answer,"n = int(input()) + +c = 0 + +for _ in range(n): + d, e = map(int,input().split()) + if d == e: + c += 1 + +if c >= 3 : + print('Yes') +else: + print('No')" +p02547,s180271675,Wrong Answer,"n = int(input()) + +string = [input().split() for i in range(n)] + +li = [] +for i in string: + li.append(int(i[0]) - int(i[1])) + +i = 0 +c = 0 +nli = len(li) - 1 + +while i != nli: + if i == 0: + c += 1 + if c == 3: + print('Yes') + exit() + if i != 0: + c = 0 + +print('No')" +p02547,s192099873,Wrong Answer,"N = int(input()) +cnt = [] +for i in range(N): + a, b = map(int, input().split()) + if a == b: + cnt.append(1) + else: + cnt.append(0) + +from itertools import groupby +for key, group in groupby(cnt): + if len(list(group)) >= 3: + print('Yes') + exit() +print('No') + +" +p02547,s561659722,Wrong Answer,"n = int(input()) +lst = [] +for i in range(n): + lst.append(list(map(int,input().split()))) +print(lst) + +cnt = 0 + +for i in range(n): + if lst[i][0]==lst[i][1]: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + exit() +print('No')" +p02547,s958026105,Wrong Answer,"n = int(input()) +c, d = [], [] +for i in range(n): + a, b = [int(i) for i in input().split()] + c.append(a) + d.append(b) + +count = 1 + +for i in range(0, n): + if c[i] == d[i]: + count += 1 + else: + count = 1 + if count == 3: + break + +if count == 3: + print('Yes') + +else: + print('No') +" +p02547,s267706775,Wrong Answer,"n = int(input()) +for _ in range(n): + a, b = map(int, input().split()) + if a == b: + print(""Yes"") + exit() +print(""No"") +" +p02547,s586901002,Wrong Answer,"N=int(input()) +counter=0 +flag=0 +for i in range(N): + D1, D2=map(int,input().split()) + if D1==D2: + counter+=1 + else: + counter=0 + if counter>=3: + flag=1 + break +if flag==1: + print('Yes') +else: + print('No')" +p02547,s058964551,Wrong Answer,"N=int(input()) +D=[list(map(int, input().split())) for i in range(N)] +count=0 +for j in range(N-2): + if D[j][0]==D[j][1]: + if D[j+1][0]==D[j+1][1]: + if D[j+2][0]==D[j+2][1]: + count = 1 +if count==0: + print('NO') +else: + print('Yes')" +p02547,s196474642,Wrong Answer,"n = int(input()) +c, d = [], [] +for i in range(n): + a, b = [int(i) for i in input().split()] + c.append(a) + d.append(b) + +count = 1 + +for i in range(1, n): + if c[i-1] == c[i] and d[i-1] == d[i]: + count += 1 + else: + count = 1 + if count == 3: + break + +if count == 3: + print('Yes') + +else: + print('No') +" +p02547,s862995055,Wrong Answer,"# coding:utf-8 +n = int(input()) +count = 0 +ans = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + + if d1 == d2: + count += 1 + else: + ans = count + count = 0 + +ans = max(ans, count) + +if ans >= 3: + print('Yes') +else: + print('No') +" +p02547,s057999755,Wrong Answer,"N = int(input()) +flag = 0 +ans = ""No"" +for i in range(N): + A,B = input().split() + if flag == 3: + ans = ""Yes"" + if A == B: + flag += 1 + else: + flag = 0 + +print(ans)" +p02547,s032983445,Wrong Answer,"# https://atcoder.jp/contests/abc179/tasks/abc179_b +t = int(input()) +count = 0 +pre = 0 +test = '' +for i in range(t): + a, b = map(int, input().split()) + if (a == b): + test = 'Yes' + pre = 1 + else: + pre = 0 + test = 'No' + if test == 'Yes' and (pre == 1): + count += 1 + test = 'Yes' + pre = 1 +if (count == 3) or (count == 6): + print('Yes') +else: + print('No') +" +p02547,s239981218,Wrong Answer,""""""" +abc179_B +"""""" +n = int(input()) +ans = 'No' + +a = [input().split() for i in range(n)] + +for i in range(0,n-3): + if a[i][0]== a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]: + #if a[i,0] == a[i,1] and a[i+1,0] == a[i+1,1] and a[i+2,0] == a[i+2,0]: + ans = 'Yes' + break + +print(ans) +" +p02547,s661904637,Wrong Answer,"def solve(n, d): + n -= 2 + for i in range(n): + for j in range(i + 1, n): + if all(d[i + k][0] == d[i + k][1] for k in range(3)): + return True + return False + + +def main(): + n = int(input()) + d = [list(map(int, input().split())) for _ in range(n)] + print(""Yes"" if solve(n, d) else ""No"") + + +if __name__ == '__main__': + main() +" +p02547,s062860313,Wrong Answer,"x=int(input()) +l=[] +c=0 +for i in range(x): + a,b = map(int,input().split()) + l.append(a) + l.append(b) +for i in range(0,x*2,2): + if l[i]==l[i+1]: + c+=1 + print(l[i]) + if c>=3: + print(""YES"") + break + + else: + c=0 +if c<3: + print(""NO"") +print(c)" +p02547,s671760744,Wrong Answer,"num = int(input()) +count = 0 +tmp = 0 +for i in range(num): + d1, d2 = map(int,input().split()) + if d1 == d2 and tmp == 0: + count = 1 + tmp += 1 + elif d1 == d2 and tmp > 0: + count += 1 + tmp += 1 + else: + tmp = 0 + +print(""Yes"" if count >= 3 else ""No"")" +p02547,s720906325,Wrong Answer,"n = int(input()) +d = [] +z = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + z = z+1 if d1==d2 else 0 + d.append(z) + +print(max(d))" +p02547,s688689438,Wrong Answer,"N= int(input()) +a = [input().split() for i in range(N)] + +Is = [] +for i in range(N): + Ds = a[i] + if Ds[0] == Ds[1]: + Is.append(i) + +Boooo = False +for i in range(len(Is)-2): + if Is[i] == Is[i+1] and Is[i+1] == Is[i+2]: + Boooo = True + +if Boooo: + print(""Yes"") +else: + print(""No"") + +" +p02547,s224403528,Wrong Answer,"N = int(input()) + +count = 0 +flag = 0 + +for i in range(N): + N,M = map(int, input().split()) + if N == M: + count += 1 + else: + count = 0 + if count >= 3: + flag = 1 + +if flag == 1: + print(""yes"") +else: + print(""no"")" +p02547,s649102416,Wrong Answer,"N = int(input()) +D = [input().split() for _ in range(N)] +ans = ""no"" +for i in range(N - 2): + if D[i][0] == D[i][1]: + if D[i + 1][0] == D[i + 1][1]: + if D[i + 2][0] == D[i + 2][1]: + ans = ""yes"" + break +print(ans)" +p02547,s815750085,Wrong Answer,"l=[] +n=int(input()) +for _ in range(n): + a=list(map(int,input().split())) + l.append(a) + +flag=0 +for i in range(1,n-1): + if l[i-1][0]==l[i-1][1] and l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1]: + flag=1 + break + +if flag==1: + print(""YES"") +else: + print(""NO"")" +p02547,s517123861,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + a,b = map(int,input().split()) + if a==b: + count += 1 + else: + count = 0 +print('Yes' if count > 2 else 'No') +" +p02547,s604741737,Wrong Answer,"n = input() +x = 0 +for i in range(int(n)): + a,b = input().split("" "") + if a == b: + x+=1 + else: x = 0 + if x==3: + print(""Yes"") + break +if x==0: + print(""No"")" +p02547,s887409642,Wrong Answer,"n = int(input()) + +count = 0 +max_count = 0 +for i in range(n): + input_elements = input().split() + if input_elements[0] == input_elements[1]: + count += 1 + else: + max_count = count + count = 0 + +if max_count < count: + max_count = count + +if max_count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s841357202,Wrong Answer,"n = int(input()) + +cnt = 0 +flg = 0 + +for i in range(n): + a, b = map(int, input().split()) + + if a == b: + cnt += 1 + if cnt >= 3: + flg = 1 + else: + cnt = 0 + + print(cnt) + print(flg) + +if flg == 1: + print(""Yes"") +else: + print(""No"") +" +p02547,s388948794,Wrong Answer,"n = int(input().strip()) +count = 0 +for i in range(n): + a,b = map(int,input().strip().split()) + if a == b and count == 3: + print('Yes') + exit(0) + elif a == b: + count += 1 + elif(a != b): + count = 0 +print('No') +" +p02547,s745738457,Wrong Answer,"N = int(input()) + +D = [] +for i in range(N): + Da,Db = (map(int,input().split())) + if Da == Db: + D.append(1) + else: + D.append(0) + +for i in range(N-2): + if D[i]==1 and D[i+1] == 1 and D[i+2] == 1: + ans = ""Yes"" + else: + ans = ""No"" +print(ans)" +p02547,s177504394,Wrong Answer,"import sys +input = sys.stdin.readline +from collections import * + +N = int(input()) +D = [tuple(map(int, input().split())) for _ in range(N)] + +for i in range(N-3): + if D[i][0]==D[i][1] and D[i+1][0]==D[i+1][1] and D[i+2][0]==D[i+2][1]: + print('Yes') + exit() + +print('No')" +p02547,s465260008,Wrong Answer,"n=int(input()) +cnt=0 +ans=0 +for i in range(n): + d,e=map(int,input().split()) + if d!=e: + if cnt==3: + ans=0 + break + cnt=1 + else: + cnt+=1 + if cnt==3: + ans=1 + break +if cnt>=3: + ans=1 +if ans==1: + print(""Yes"") +else: + print(""No"") +" +p02547,s964561751,Wrong Answer,"n = int(input()) +l = [list(map(int, input().split())) for i in range(n)] +#print(l[0][0]) +#print(l[0][1]) +ans = n-3 +ans1 = 0 + +for m in range(ans): + if l[m][0] == l[m][1] and l[m+1][0] == l[m+1][1] and l[m+2][0] == l[m+2][1]: + ans1 += 1 + else: + ans1 = 0 + + +if ans1 >= 1: + print(""Yes"") +else: + print(""No"")" +p02547,s591088650,Wrong Answer,"n = int(input()) +l = [] +for _ in range(n): + d1,d2 = map(int,input().split()) + l.append(d1) + l.append(d2) + +for i in range(len(l)-2): + if l[i] == l[i+1] == l[i+2] == 3: + print ('Yes') + exit () +print ('No') +" +p02547,s364954612,Wrong Answer,"n = int(input()) +xy = [map(int, input().split()) for _ in range(n)] +x, y = [list(i) for i in zip(*xy)] +count = 0 +for k in range(n-2): + if x[k] == y[k] and x[k+1] == y[k+1] and x[k+2] == y[k+2]: + count += 1 +if count >= 1: + print('Yes') +else: + print('NO')" +p02547,s129018750,Wrong Answer,"n = int(input()) +arr= [] +for i in range(n): + z = [ int(i) for i in input().split()] + arr.append(z) + +count = 0 +for i in range(n): + + if arr[i][0] == arr[i][1]: + count+=1 +cu = 0 +for i in range(n): + for j in range(n): + if i == j: + continue + if arr[i][0]==arr[j][0]: + cu +=1 + if arr[i][1] == arr[j][1]: + cu +=1 + if cu>=1: + break + +if count>=3 and cu>=1: + print(""Yes"") +else: + print(""No"")" +p02547,s118300528,Wrong Answer,"# -*- coding: utf-8 -*- +a = int(input()) +xy = [map(int, input().split()) for _ in range(a)] +x, y = [list(i) for i in zip(*xy)] +flag = 0 +for i in range(a): + if (x[i] == y[i]): + flag = flag+1 + else: + flag = 0 +if flag >= 3: + print(""Yes"") +else: + print(""No"") + +" +p02547,s221781361,Wrong Answer,"Count = 0 +Array = [] +for i in range(int(input())): + Dice_1, Dice_2 = map(int, input().split()) + if Dice_1 == Dice_2: + Array.append(1) + else: + Array.append(0) + +ans = [] +j_1 = 0 +for j in range(len(Array)): + if j_1 == 1 and Array[j] == 1: + Count = Count + 1 + else: + Count = 0 + j_1 = Array[j] + print(Count) + ans.append(Count) +print(max(ans)) +if max(ans) >= 2: + print('Yes') +else: + print('No')" +p02547,s456296904,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N): + a, b = map(int, input().split()) + if a == b: + count += 1 +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s965797144,Wrong Answer,"N = int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +flag = 0 +count = 0 + +for i in range(N-1): + if x[i] == y[i]: + count += 1 + if count >= 3: + flag = 1 + else: + count = 0 + + +if flag == 1: + print('Yes') +else: + print('No')" +p02547,s326447767,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + count += 1 + if count == 3: + print('Yes') + break + if i == N-1: + print('No')" +p02547,s471394798,Wrong Answer,"n = int(input()) +cnt = 0 +flg = False + +for i in range(n): + d1, d2 = map(int, input().split()) + if cnt == 0 and d1 == d2: + cnt += 1 + if cnt > 0: + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + flg = True + +if flg: + print('Yes') +else: + print('No')" +p02547,s651502758,Wrong Answer,"n = int(input()) +cnt = [False]*n + +for i in range(n): + x,y = map(int, input().split()) + cnt[i] = x == y + +ans = 'No' + +for i in range(n-3): + if cnt[i] and cnt[i+1] and cnt[i+2]: + ans = 'Yes' + +print(ans)" +p02547,s653870599,Wrong Answer,"n=int(input()) +count=0 +for i in range(n): + d1,d2=list(map(int,input().split())) + if d1==d2: + count+=1 +if count>=3: + print('YES') +else: + print('NO')" +p02547,s836428931,Wrong Answer,"input=__import__('sys').stdin.readline +ans='NO' +cs=0 +for i in range(int(input())): + a,b=map(int,input().split()) + if a==b:cs+=1 + else:cs=0 + if cs>=3:ans='YES' +print(ans)" +p02547,s619867041,Wrong Answer,"n = int(input()) +c = 0 +for x in range(n): + a,b = map(int,input().split()) + if a==b: + c+=1 + if c==3: + print('Yes') + break + else: + c=0 + " +p02547,s107214100,Wrong Answer,"N=int(input()) +ans=0 +ke=0 +for i in range(N): + D,E=map(int,input().split()) + if D==E: + ans+=1 + if ans>=3: + ke=1 +if ke==1: + print(""Yes"") +else: + print(""No"")" +p02547,s797054301,Wrong Answer," +n=int(input()) +for i in range(0,n): + count=0 + m,p=input().split() + if(m==p): + count=count+1 +if(count%3==0): + print(""Yes"") +else: + print(""No"") +" +p02547,s955689260,Wrong Answer,"N=int(input()) +d1=[0]*N +d2=[0]*N +for i in range(N): + d1[i],d2[i]=list(map(int,input().split())) +counter=0 +for i in range(N-3): + if d1[i]==d2[i] and d1[i+1]==d2[i+1] and d1[i+2]==d2[i+2]: + counter=1 +if counter==1: + print('Yes') +else: + print('No') +" +p02547,s719265447,Wrong Answer,"# -*- coding: utf-8 -*- +# 入力 +N = int(input()) + +l = [] +for i in range(N): + d1, d2 = map(int, input().split()) + l.append([d1, d2]) + +num = 0 +cont = 0 +for i in l: + if(i[0]==i[1]): + num = num + 1 + cont = cont +1 + else: + num = 0 + cont = 0 + +if (cont >=3): + print(""yes"") +else: + print(""no"") +" +p02547,s971202228,Wrong Answer,"N = int(input()) +count = 0 +count_max = count +for i in range(N): + di_1, di_2 = [int(i) for i in input().split()] + if di_1 == di_2: + count += 1 + else: + count_max = max([count_max, count]) + count = 0 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s830814619,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] +i = 0 +count = 0 +while i < N: + if D[i][0] == D[i][1]: + count += 1 + else: + count = 0 + i += 1 + +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s773019975,Wrong Answer,"n = int(input()) +num_list = [] +for i in range(n): + num_list.append(list(map(int,input().split()))) + +ans = [] +for i in range(n): + a = num_list[i] + a1= a[0] + a2 = a[1] + if a1 == a2: + ans.append(1) + if i > 2 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1: + print('Yes') + break + else: + ans.append(0) +if len(ans) == n: + print('No') +" +p02547,s748973497,Wrong Answer,"N = int(input()) +D = 0 + +for i in range(N): + D1, D2 = map(int, input().split()) + if D < 0: + D = 0 + elif D == 3: + print('Yes') + break + + if D1 == D2: + D += 1 + + elif D1 != D2: + D -= 1 + +if D != 3: + print('No')" +p02547,s643068879,Wrong Answer,"count = 0 +for i in range(int(input())): + l = list(map(int, input().split())) + if l[0] == l[1]: + count += 1 + elif l[0] != l[1]: + count = 0 +if count >= 3: + print(""Yes"") +elif count < 3: + print(""No"") +" +p02547,s536839036,Wrong Answer,"n = int(input()) +df_de = [list(map(int, input().split())) for _ in range(n)] +ans = 0 +cand = [] +for d1, d2 in df_de: + if d1 == d2: + ans += 1 + else: + cand.append(ans) + ans = 0 +print(""Yes"" if len([i for i in cand if i >= 3]) else ""No"")" +p02547,s676894048,Wrong Answer,"# coding: utf-8 +# Your code here! + +dice = int(input()) + +s = [] +for i in range(1, dice+1): + a = input().split("" "") + s.append(a) + +count = 0 +for j in range(len(s)-1): + if s[j][0] == s[j][1]: + if s[j+1][0] == s[j+1][1]: + count += 1 + if count >= 2: + print(""Yes"") + break + else: + count -= 1 + + +if count < 2: + print(""No"") +" +p02547,s366764447,Wrong Answer,"n = int(input()) +data = [] +zoro = [] +yn = False +for i in range(n): + data = input().split() + if data[0] == data[1]: + zoro += [True] + else: + zoro += [False] + if i > 1 and (zoro[i] == True or zoro[i-1] == True or zoro[i-2] == True): + yn = True +print(zoro) +print(""Yes"") if yn == True else print(""No"")" +p02547,s568166170,Wrong Answer,"#!/usr/bin/env python3 +N = int(input()) + +count = 0 +result = 'No' +for i in range(1, N): + d1, d2 = map(int, input().split()) + if(d1 == d2): + count += 1 + else: + count = 0 + if(count == 3): + result = 'Yes' + exit + +print(result) + + + + + +" +p02547,s635322680,Wrong Answer,"N = int(input()) +lst = [] +for _ in range(N): + d1, d2 = map(int, input().split(' ')) + lst.append((d1, d2)) + +idx = 0 +flag = False +while idx < N-2: + cnt = 0 + for _ in range(3): + d1, d2 = lst[idx] + if d1 == d2: + cnt += 1 + if cnt == 3: + flag = True + break + else: + idx += 1 + +print('Yes' if flag else 'No')" +p02547,s694626330,Wrong Answer,"N = int(input()) +flag = 0 +ans = ""No"" +for i in range(N): + A,B = input().split() + if flag == 3: + ans = ""Yes"" + break + if A == B: + flag += 1 + else: + flag = 0 + +print(ans)" +p02547,s413746747,Wrong Answer,"n = int(input()) +a_lst = [] +b_lst = [] +clear = 0 +cnt = 0 +for i in range(n): + a, b = map(int, input().split()) + a_lst.append(a) + b_lst.append(b) + +for a, b in zip(a_lst, b_lst): + if cnt == 3: + clear = 1 + break + if a == b: + cnt += 1 + else: + cnt = 0 + +if clear == 1: + print('Yes') +else: + print('No')" +p02547,s105483027,Wrong Answer,"n =int(input()) +first =[] +second =[] +for i in range(n): + d1 , d2 = map(int , input().split()) + first.append(d1) + second.append(d2) + +for i in range(n-2): + count = 0 + for j in range(i ,i+3): + if first[j]==second[j]: + count +=1 + + if count ==3: + print(""YES"") + break +else: + print(""NO"")" +p02547,s522333220,Wrong Answer,"n=int(input()) +lst1=[] +lst2=[] +count=0 +for _ in range(n): + m,k=[int(x) for x in input().split()] + lst1.append(m) + lst2.append(k) +if(n<3): + print('NO') +else: + + for i in range(n-2): + if(lst1[i]==lst2[i] and lst1[i+1]==lst2[i+1] and lst1[i+2]==lst2[i+2]): + count=3 + break + if(count==3): + print('YES') + else: + print('NO') + " +p02547,s443241452,Wrong Answer,"N = int(input()) +occur = 0 +for i in range(0,N): + D1,D2 = map(int,input().split()) + if D1 == D2: + occur +=1 +if occur == N: + print(""Yes"") +elif occur > 3: + print(""No"") +else: + print(""Yes"")" +p02547,s102163870,Wrong Answer,"N = int(input()) + +flag = False + +d1 = [0]*N +d2 = [0]*N +for i in range(N-1): + d1[i], d2[i] = input().split() + +for k in range(N-3): + if ((d1[k])==(d2[k]))and((d1[k+1])==(d2[k+1]))and((d1[k+2])==(d2[k+2])): + flag = True + break + +if flag: + print('Yes') +else: + print('No')" +p02547,s851676075,Wrong Answer,"N = int(input()) +z = 0 +f = False +for i in range(N): + r = list(map(int, input().split())) + if r[0] == r[1]: + z += 1 + if z == 2: + f = True + elif not f: + f = False + z = 0 +if f: + print(""Yes"") +else: + print(""No"")" +p02547,s054789856,Wrong Answer,"num=int(input()) +re=0 +res=0 +for i in range(num): + a=input().split("" "") + if a[0]==a[1]: + re +=1 + if re>=3: + res=1 + else: + re=0 + +if(re<3): + print(""No"") +else: + print(""Yes"")" +p02547,s903585411,Wrong Answer,"N = int(input()) +flag = 0 +ans = ""No"" +for i in range(N): + A,B = input().split() + if A == B: + flag += 1 + if flag == 3: + ans = ""Yes"" + break + else: + flag = 0 + + +print(ans)" +p02547,s520821862,Wrong Answer,"n = int(input()) +num_of_double = 0 + +for i in range(n): + d1, d2 = map(int,input().split()) + + if d1 == d2: + num_of_double += 1 + +if num_of_double >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s871444290,Wrong Answer,"n=int(input()) +c=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c.append(1) + else: + c.append(0) +for j in range(2,n): + if c[j-2]==c[j-1] and c[j-1]==c[j]: + print(""Yes"") + break + if j==n-1: + print(""No"")" +p02547,s249223306,Wrong Answer,print('NYoe s'['111'in''.join(str(len({*t.split()}))for t in open(0))::2]) +p02547,s766920839,Wrong Answer,"import sys + +n = int(input()) + +zoro = 0 +res = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + if zoro == 3: + res = 1 + elif d1 == d2: + zoro = zoro + 1 + else: + zoro = 0 + +if res == 1: + print(""Yes"") +else: + print(""No"") +" +p02547,s451575346,Wrong Answer,"n=int(input()) +l=[] +m=[] +for i in range(0,n): + a,b=map(int,input().split()) + l.append(a) + m.append(b) +c=0 +for i in range(0,n): + if l[i]==m[i]: + c=c+1 + else: + c=0 +if c==3: + print('Yes') +else: + print('No')" +p02547,s236731622,Wrong Answer,"class Main: + n = int(input()) + num_list =[] + count = 0 + for i in range(n): + num_list.append(list(map(int,input().split()))) + + for i in range(n-2): + if num_list[i][0]==num_list[i][1] and num_list[i+1][0]==num_list[i+1][1] and num_list[i+2][0]==num_list[i+2][1]: + count +=1 + + if count == 1: + print('Yes') + else : + print('No')" +p02547,s145601555,Wrong Answer,"i = int(input()) +d = [list(map(int, input().split())) for i in range(i)] + +c = 0 +for i in range(len(d)): + if (d[i][0] == d[i][1]): + c += 1 +print(""Yes"" if c >= 3 else ""No"") +" +p02547,s945764161,Wrong Answer,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] + +exist = False +for i in range(n-3): + for j in range(3): + if not d[i+j][0] == d[i+j][1]: + break + else: + exist = True +if exist: + print('Yes') +else: + print('No')" +p02547,s132720934,Wrong Answer,"def solution(arr): + count = 0 + for i, j in arr: + if i == j: + count += 1 + else: + count = 0 + if count == 2: + return 'Yes' + return 'No' +n = int(input()) +arr = [] +for _ in range(n): + arr.append([ int(i) for i in input().split()]) +print(solution(arr))" +p02547,s145529966,Wrong Answer,"def func(): + count = 0 + for _ in range(N): + if count == 3: + return ""Yes"" + a, b = map(int, input().split()) + if a == b: + count += 1 + else: + count = 0 + return ""No"" + + +N = int(input()) + +print(func()) +" +p02547,s493093808,Wrong Answer,"b = [] +a = int(input()) +for i in range(a): + b.append(list(map(int,input().split()))) +c = [] +for i in range(a): + if b[i][0] == b[i][1]: + c.append(1) + elif b[i][0] != b[i][1]: + c.append(0) +for i in range(2, a-2): + if c[i] == 1 & c[i-1] == 1 & c[i+1] == 1: + print('Yes') +" +p02547,s252703436,Wrong Answer,"n=int(input()) +ans=0 +D=[] +for i in range(n): + a,b=map(int, input().split()) + D.append([a,b]) + + +for i in range(len(D)): + if D[i][0]==D[i][1]: + ans +=1 + +if ans>=3: + print(""Yes"") + +else: + print(""No"")" +p02547,s409173287,Wrong Answer,"N = int(input()) +S = [] +judge = 0 +for i in range(N): + S += [input().split()] +for i in range(N): + if i <= N-i: + if S[i][0] == S[i][1]: + if S[i+1][0] == S[i+1][1]: + if S[i+2][0] == S[i+2][1]: + print(""Yes"") + judge = 1 + break +if judge == 0: + print(""No"")" +p02547,s886464047,Wrong Answer,"n=int(input()) +a=[] +for i in range(n): + x,y=map(int,input().split()) + a.append((x,y)) +ok=False +for i in range(n-3): + if a[i][0]==a[i][1] and a[i+1][0]==a[i+1][1] and a[i+2][0]==a[i+2][1]: + ok=True +if ok==True: + print(""Yes"") +else: + print(""No"")" +p02547,s830632765,Wrong Answer,"n = int(input()) +cnt = 0 +is_ok = False +for _ in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 1 + if cnt >= 3: + is_ok = True + else: + pass +if is_ok: + print('Yes') +else: + print('No') +" +p02547,s332553249,Wrong Answer,"n = int(input()) +d = [list(map(int,input().split())) for i in range(n)] +ans = ""No"" +for i in range(n-3): + if d[i][0]==d[i][1] and d[i+1][0]==d[i+1][1] and d[i+2][0]==d[i+2][1]: + ans = ""Yes"" +print(ans)" +p02547,s631975723,Wrong Answer,"n=int(input()) +d=list() +for i in range(n): + d.append(list(map(int,input().split()))) + +an=1 +for i in range(n): + if n > i+3: + if d[i][0]==d[i][1] and d[i+1][0]==d[i+1][1] and d[i+2][0]==d[i+2][1]: + an=0 + break +if an==0: + print('Yes') +else: + print('No')" +p02547,s900119717,Wrong Answer,"N = int(input()) +l = [list(map(int, input().split())) for l in range(N)] + +last = 0 +for item in l: + if last == 0 and l[0] == l[1]: + last = 1 + elif last == 1 and l[0] == l[1]: + last = 2 + elif last == 2 and l[0] == l[1]: + last = 3 + break + last == 0 + +if last == 3: + print('Yes') +else: + print('No')" +p02547,s514438424,Wrong Answer,"def main(): + n = int(input()) + cnt = 0 + for i in range(n): + a,b = map(int,input().split()) + if cnt == 3: + print('Yes') + return + if a == b: + cnt += 1 + else: + cnt = 0 + print('No') + return + +main() +" +p02547,s515870361,Wrong Answer,"N=int(input()) +D1 = [0] * N +D2 = [0] * N +for i in range(N): + D1[i], D2[i]= map(int, input().split()) +for i in range(N-2): + if D1[i]==D2[i]: + if D1[i+1]==D2[i+1]: + if D1[i+2]==D2[i+2]: + print(""Yes"") + break + else: + print(""No"")" +p02547,s009268780,Wrong Answer,"n = int(input()) + +num_list=[] +count=0 + +for i in range(n): + a,b = map(int, input().split()) + if a==b: + count+=1 + if a!=b: + if count<3: + count=0 +if count>2: + print('YES') +else: + print('NO')" +p02547,s126802501,Wrong Answer,"n = int(input()) + +count = 0 +ans = 0 +for i in range(n): + s = input().split() + + if s[0]==s[1]: + count += 1 + + if count >= 3: + ans = 1 +if ans == 1: + print('Yes') +else: + print('No')" +p02547,s973530501,Wrong Answer,"n = int(input()) +i = 0 +for _ in range(n): + x, y = map(int, input().split()) + i += int(x == y) + if i == 3: + print(""Yes"") + break +if(i < 3): + print(""No"")" +p02547,s417918454,Wrong Answer,"N = int(input()) + +count = 0 + +for i in range(N): + k, t = map(int, input().split()) + if count == 3: + print ( ""yes"" ) + + break + + if not k == t: + count *= 0 + if k == t: + count += 1 +if not count == 3: + print (""no"") + +" +p02547,s937911155,Wrong Answer,"def solution(arr): + count = 0 + for i, val in enumerate(arr): + if arr[i - 1] == val: + count += 1 + else: + count = 0 + if count == 2: + return 'Yes' + return 'No' +n = int(input()) +arr = [] +for _ in range(n): + arr.append(input()) +print(solution(arr))" +p02547,s405989729,Wrong Answer,"N = int(input()) +count = 0 +list1 = [] +list2 = [] +for i in range(N-1): + a, b = list(map(int, input().split())) + list1.append(a) + list2.append(b) + +for i in range(N-1): + if list1[i] == list2[i]: + count += 1 + if count >= 3: + break + else: + count = 0 +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s910435250,Wrong Answer,"n = int(input()) +flag = 0 +for i in range(n): + n1, n2 = map(int, input().split()) + if n1 == n2: + flag += 1 + if flag == 3: + print(""Yse"") + break + else: + flag = 0 +print(""No"")" +p02547,s286241313,Wrong Answer,"import random + +exit = False + +count = 0 + +countNum = 0 + +randomArray1 = random.randint(1,6) +randomArray2 = random.randint(1,6) + +while count < 4: + + randomArray1 = random.randint(1,6) + randomArray2 = random.randint(1,6) + + print(randomArray1,randomArray2) + + countNum += 1 + + if randomArray1 == randomArray2: + count += 1 + + +print(countNum) +print(""END"") + " +p02547,s804470606,Wrong Answer,"N = int(input()) +j = 0 +if N >= 3: + for i in range(0, N): + D = str(input()) + D = D[0::2] + if D[0] == D[1]: + j += 1 + if j == 3: + print(""Yes"") + elif j == 6: + print(""Yes"") + elif j != 3: + print(""No"") + else: + print(""No"") + +" +p02547,s411086515,Wrong Answer,"n=int(input()) +c=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c+=1 +if c>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s107389050,Wrong Answer,"n=int(input()) +count=0 +for i in range(n): + me1,me2=list(map(int,input().split())) + if me1==me2: + count+=1 +if count==n: + print('Yes') +else: + print('No')" +p02547,s675630500,Wrong Answer,"N = int(input()) +D1 = [0]*N +D2 = [0]*N +for i in range(N): + D1[i],D2[i] = input().split() +flg = False +for i in range(N-3): + if D1[i]==D2[i] and D1[i+1] == D2[i+1] and D1[i+2] == D2[i+2]: + flg = True +if flg: + print(""Yes"") +else: + print(""No"")" +p02547,s374973866,Wrong Answer,"n = int(input()) +s = 0 +for i in range(n): + a, b = map(int, input().split()) + if a == b: + s += 1 + else: + s = 0 +print(""Yes"" if s >= 3 else ""No"")" +p02547,s719266122,Wrong Answer,"N = int(input("""")) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +for a in range(N): + if x[a] == y[a]: + print(""Yes"") + e = 1 + break + else: + e = 0 +if e == 0: + print(""No"")" +p02547,s439744880,Wrong Answer,"n = int(input()) +li = [list(map(int,input().split())) for _ in range(n)] +c = 0 +ans = 0 +for a,b in li: + if a==b: + c+=1 + ans = max(c,ans) + else: + ans = max(c,ans) + print(ans) + c=0 +if ans >= 3:print('Yes') +else:print('No')" +p02547,s737041841,Wrong Answer,"num = int(input()) +ll = [] +lll = [] +for i in range(num): + d1,d2 = list(map(int,input().split())) + if d1 == d2: + ll.append([i,d1,d2]) + else: + pass +count = 0 +for k in range(len(ll)): + lll.append(ll[k][0]) +for l in lll: + for m in range(len(lll)+1): + if l==m: + count +=1 + break +if count>1: + print('Yes') +else: + print('No')" +p02547,s968903413,Wrong Answer,"N = int(input()) +flug = False +cnt = 0 +for _ in range(N): + D1, D2 = list(map(int, input().split())) + if D1 == D2: + cnt += 1 + else: + cnt = 0 + if cnt >= 3: + flug = True +if flug: + print(""YES"") +else: + print(""NO"")" +p02547,s230120545,Wrong Answer,"n=int(input()) +c=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c+=1 + else: + c=0 +if c>2: + print(""Yes"") +else: + print(""No"") +#print(c)" +p02547,s937798834,Wrong Answer,"n = int(input()) +ans = ""No"" +j = 0 +for i in range(n): + d,dd = map(str,input().split()) + if(d==dd): + if(j>0): + j += 1 + else: + j=0 + if(j>=3): + ans = ""Yes"" +print(ans) +" +p02547,s231473098,Wrong Answer,"import itertools +n = int(input()) +count = 0 + +line = [input().split() for i in range(n)] +line = list(itertools.chain.from_iterable(line)) + +for j in range(len(line)-3): + if line[j] == line[j+1]: + if line[j+2] == line[j]: + count += 1 + print('Yes') + else: + continue + +if count == 0: + print('No')" +p02547,s383447239,Wrong Answer,"def judge(): + count = 0 + for _ in range(x): + d1, d2 = map(int, input().split()) + print(d1, d2) + if d1 == d2: + count += 1 + else: + count = 0 + + if count == 3: + return True + + return False + +x = int(input()) + +if judge(): + print(""yes"") +else: + print(""no"") +" +p02547,s382778045,Wrong Answer,print('NYoe s'[[*'000']in[str(eval(t.replace(*' -')))for t in open(0)]::2]) +p02547,s208210467,Wrong Answer,"n = int(input()) +d = [input().split("" "") for _ in range(n)] + +f = False +for i in range(n-2): + if d[i][0] == d[i][1] and not f : + print(d[i+1], d[i+2]) + if d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]: + f = True +if f: + print(""Yes"") +else: + print(""No"")" +p02547,s115211967,Wrong Answer,"N = int(input()) + +count = 0 + +for i in range(N): + k, t = map(int, input().split()) + if count == 3: + print ( ""Yes"" ) + + break + + if not k == t: + count *= 0 + if k == t: + count += 1 +if count == 3: + print (""Yes"") +else: + print (""No"") + +" +p02547,s951002241,Wrong Answer,"N=int(input()) +count=0 +lst=[] +for i in range(N): + x,y=map(int,input().split()) + # l=[] + # l.append(x) + # l.append(y) + # lst.append(l) + if x==y: + count+=1 + if x!=y: + continue + count=0 +if count>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s076076716,Wrong Answer,"def main(): + N = int(input()) + z = 0 + for i in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + z += 1 + else: + z = 0 + if z >= 3: + return True + + return False + +# print(""Yes"" if main() else ""No"") +print(main()) +" +p02547,s622745336,Wrong Answer,"n = int(input()) +d = [] +for _ in range(n): + d.append(list(map(int, input().split()))) + +cnt = 0 +for i in d: + if cnt >= 3: + print('Yes') + exit() + if i[0] == i[1]: + cnt += 1 + else: + cnt = 0 + +print('No') +" +p02547,s295302580,Wrong Answer,"N=int(input()) +p=False +s=0 +for i in range(N): + a,b=map(int,input().split()) + if a==b: + s+=1 + if s==3: + break + else: + s=0 +print(""Yes"" if p else ""No"")" +p02547,s581159886,Wrong Answer,"a=int(input()) +b=0 +xy = [map(int, input().split()) for _ in range(a)] +x, y = [list(i) for i in zip(*xy)] +for i in range(a-2): + if y[i]==y[i+1]==y[i+2]: + b=b+1 +if b==0: + print(""No"") +else: + print(""Yes"")" +p02547,s635596730,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N-1): + a, b = list(map(int, input().split())) + if a == b: + count += 1 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s878298469,Wrong Answer,"n = int(input()) +a = [] +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + a.append(True) + else: + a.append(False) +for i in a[:-2]: + if i == True: + if a[a.index(i)+1] and a[a.index(i)+2]: + print(""Yes"") + exit() +print(""No"")" +p02547,s019416497,Wrong Answer,"N = int(input()) +sub_yes = 0 +max_yes = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + sub_yes += 1 + else: + max_yes = sub_yes + sub_yes = 0 +if max_yes >= 3: + print(""yes"") +else: + print(""no"")" +p02547,s909762928,Wrong Answer,"N=int(input()) +T=False +k=0 +for i in range(N): + D1,D2=map(int,input().split()) + if D1==D2: + k+=1 + if k>=3: + T=True + else: + k=0 + print(k) +if T: + print(""Yes"") +else: + print(""No"")" +p02547,s283200054,Wrong Answer,"def readInt(): + return int(input()) +def readList(): + return list(map(int,input().split())) +def readMap(): + return map(int,input().split()) +def readStr(): + return input() +inf=float('inf') +mod = 10**9+7 +import math +def solve(n,A): + count=0 + for x,y in A: + if x==y: + count+=1 + else: + count=0 + if count==3: + return True + return False + +n=readInt() +A=[] +for _ in range(n): + A.append(readList()) +if solve(n,A): + print(""YES"") +else: + print(""NO"")" +p02547,s764819228,Wrong Answer,"N=input() +n=int(N) +x=0 +for s in range(n): + ds1,ds2=input().split() + if ds1==ds2: + x+=1 + else: + x==0 + if x==3: + print(""Yes"") + break +else: + print(""No"") +" +p02547,s901391195,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +c = 0 + +for d in D: + if d[0] == d[1]: + c += 1 +if c>=3: + print('Yes') +else: + print('No')" +p02547,s907361223,Wrong Answer,"N=int(input()) +d1=[0]*N +d2=[0]*N +for i in range(N): + d1[i],d2[i]=list(map(int,input().split())) +counter=0 +for i in range(N-3): + if d1[i]==d2[i] and d1[i+1]==d2[i+1] and d1[i+1]==d2[i+1]: + counter=1 +if counter==1: + print('Yes') +else: + print('No')" +p02547,s655357512,Wrong Answer,"s = int(input()) +ok = 0 +c = 1 +for _ in range(s): + x,y = list(map(int,input().split())) + + if x==y: + c+=1 + + else: + c=0 + + if c==3: + ok = 1 + +if ok==1: + print('Yes') +else: + print('No')" +p02547,s427163683,Wrong Answer,"n = int(input()) +num_list = [] +for i in range(n): + num_list.append(list(map(int,input().split()))) + +ans = [] +for i in range(n): + a = num_list[i] + a1= a[0] + a2 = a[1] + if a1 == a2: + ans.append(1) + if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1: + print('Yes') + break + else: + ans.append(0) +if len(ans) == n: + print('No') +" +p02547,s619031112,Wrong Answer,"t=0 +for _ in range(int(input())): + d1,d2=input().split() + d1=int(d1) + d2=int(d2) + if d1==d2: + t+=1 +if t>=3: + print('Yes') +else: + print('No')" +p02547,s087836266,Wrong Answer,"import numpy as np +n=int(input()) +lst=[] +for _ in range(n): + lst.append(list(map(int,input().split()))) +lst=np.array(lst).reshape(n,2) +for i in range(n-3): + if all([lst[i][0]==lst[i][1],lst[i+1][0]==lst[i+1][1],lst[i+2][0]==lst[i+2][1]]): + print(""Yes"") + break +else: + print(""No"")" +p02547,s011632571,Wrong Answer,"N = int(input()) +j = 0 +if N >= 3: + for i in range(0, N): + D = str(input()) + D = D[0::2] + if D[0] == D[1]: + j += 1 + + if j == 3: + print(""Yes"") + elif j == 6: + print(""Yes"") + elif j != 3: + print(""No"") + else: + print(""No"") + + " +p02547,s669594380,Wrong Answer,"def main(): + N = int(input()) + zoro = [] + + for i in range(N): + a, b = map(int, input().split()) + if a == b: + zoro.append(1) + if i >= 3: + if zoro[i-2] == zoro[i-1] and zoro[i-1] == zoro[i]: + print('Yes') + return + else: + zoro.append(0) + + print('No') + + +main()" +p02547,s572678117,Wrong Answer,"n = int(input()) + +d12 = [map(int, input().split()) for _ in range(n)] +d1, d2 = [list(i) for i in zip(*d12)] + +for i in range(n-2): + if d1[i] == d2[i]: + if d1[i+1] == d2[i+1]: + if d1[i+2] == d2[i+2]: + print(""YES"") + break +else: + print(""NO"")" +p02547,s374154113,Wrong Answer,"N = int(input()) +sub_yes = 0 +max_yes = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + sub_yes += 1 + else: + if sub_yes > max_yes: + max_yes = sub_yes + sub_yes = 0 + +if sub_yes > max_yes: + max_yes = sub_yes +if max_yes >= 3: + print(""yes"") +else: + print(""no"")" +p02547,s141893624,Wrong Answer,"n = int(input()) +flag= True +count = 0 +for i in range(n): + a,b = list(map(int, input().split())) + if a==b: + count += 1 + else: + count= 0 + if count==3: + flag = True +if flag: + print(""yes"") +else: + print(""No"") + " +p02547,s211456938,Wrong Answer,"N = int(input()) +l = [] +m = [] +for i in range(N): + a,b = map(int,input().split()) + l.append(a) + m.append(b) +flg = 0 +c = 0 +for i in range(len(l)): + + if l[i] == m[i]: + c += 1 + if c==2: + flg += 1 + + else: + c = 0 +if flg == 0: + print(""No"") +else: + print(""Yes"")" +p02547,s546469817,Wrong Answer,"N = int(input()) +flg = False +count = 0 +for i in range(N): + D1,D2 = map(int, input().split()) + + if D1 == D2: + count += 1 + if count >= 3: + flg = True + break + else: + count = 0 + +if flg: + print('Yes') +else: + print('No')" +p02547,s612020691,Wrong Answer,"N = int(input()) +x=[0]*N +y=[0]*N +L=[0]*N + +flag = ""No"" + +if N <3: + flag = ""No"" + +else: + + for i in range(N): + x[i],y[i] = map(int, input().split()) + + for i in range(N): + if x[i]==y[i]: + L[i]=1 + + #print(L) + + for i in range (N-2): + #print(i) + if L[i] == L[i+1] == L[i+2]: + flag = ""Yes"" + + + +print(flag) + " +p02547,s910739454,Wrong Answer,"from sys import exit +N = int(input()) + +cnt = 0 +for i in range(N): + x,y = map(int,input().split()) + if cnt == 3: + print(""Yes"") + exit(0) + if x == y: + cnt += 1 + else: + cnt = 0 + +if cnt == 3: + print(""Yes"") + +print(""No"")" +p02547,s268086511,Wrong Answer,"n = int(input()) + +affilé = 0 + +for i in range(n): + d1, d2 = [int(k) for k in input().split()] + if d1 == d2: + affilé += 1 + elif d1 != d2: + affilé == 0 + + + if affilé == 3: + print('YES') + exit() + + print('NO') +" +p02547,s049209981,Wrong Answer,"n=int(input()) +count = 0 +last = 0 +for a in range(n): + z = list(input().split()) + if int(z[0]) == int(z[1]): + count+=1 + if count >= 3: + last = 1 + if int(z[0]) != int(z[1]): + if count > 0: + count = 0 + else: + continue +if last == 1: + print(""yes"") +if last == 0: + print(""no"")" +p02547,s064604743,Wrong Answer,"n = int(input()) +ans = 0 +tmp = 0 +for _ in range(n): + a,b = map(int,input().split()) + if a==b: + tmp += 1 + else: + ans = max(ans,tmp) + tmp = 0 +print('Yes' if ans>=3 else 'No')" +p02547,s658950978,Wrong Answer,"n = int(input()) +d = [input().split("" "") for _ in range(n)] + +for i in range(n-2): + if d[i][0] == d[i][1]: + if d[i+1][0] == d[i][1] and d[i+2][0] == d[i+2][1]: + print(""Yes"") +print(""No"")" +p02547,s399922674,Wrong Answer,"n = int(input()) +str_list = [list(input().split()) for _ in range(n)] +print(str_list) +ans = 0 +for i in range(n-2): + if str_list[i][0] == str_list[i][1]: + if str_list[i+1][0] == str_list[i+1][1]: + if str_list[i+2][0] == str_list[i+2][1]: + ans += 1 + +if ans: + print('Yes') +else: + print('No')" +p02547,s186224866,Wrong Answer,"num = int(input()) +ll = [] +lll = [] +for i in range(num): + d1,d2 = list(map(int,input().split())) + if d1 == d2: + ll.append([i,d1,d2]) + else: + pass +count = 0 +for k in range(len(ll)): + lll.append(ll[k][0]) +for l in lll: + for m in range(len(lll)+1): + if l==m: + count +=1 + break +if count>1: + print('Yes') +else: + print('No') +print(lll)" +p02547,s146492436,Wrong Answer,"n = int(input()) +cnt = 0 +for i in range(n): + x,y =map(int,input().split()) + if cnt == 3: + print('Yes') + exit() + if x == y: + cnt +=1 + else: + cnt = 0 +print('No')" +p02547,s084107490,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if count == 3: + break + elif d1 == d2: + count += 1 + else: + count == 0 +if count == 3: + print(""Yes"") +else: + print(""No"")" +p02547,s520507430,Wrong Answer,"n = int(input()) +count = 0 +okay = False +for i in range(n): + temp1, temp2 = map(int,input().split()) + if count >= 3: + okay = True + break + if temp1 == temp2: + count += 1 + else: + count = 0 + +if okay == True: + print(""Yes"") +else: + print(""No"")" +p02547,s228411789,Wrong Answer,"import random + +exit = False + +count = 0 + +randomArray1 = random.randint(1,6) +randomArray2 = random.randint(1,6) + +while exit == False: + + randomArray1 = random.randint(1,6) + randomArray2 = random.randint(1,6) + + print(randomArray1,randomArray2) + + count += 1 + + if randomArray1 == randomArray2: + print(count) + exit = True + +print(""END"") + " +p02547,s532378151,Wrong Answer,"n = int(input()) +num_list = [] +for i in range(n): + num_list.append(list(map(int,input().split()))) + +ans = [] +for i in range(n): + a = num_list[i] + a1= a[0] + a2 = a[1] + if a1 == a2: + ans.append(1) + if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1: + print('Yes') + break + else: + ans.append(0) +if 0 in ans : + print('No')" +p02547,s537040401,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N-1): + s = list(map(int, input().split())) + if s[0] == s[1]: + count += 1 +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s790066108,Wrong Answer,"n = int(input()) +ans = ""No"" +j = 0 +for i in range(n): + d,dd = map(str,input().split()) + if(d==dd): + if(j>0): + j += 1 + else: + j = 0 + if(j==3): + ans = ""Yes"" +print(ans)" +p02547,s644457787,Wrong Answer,"n = int(input()) + +affilé = 0 + +for i in range(n): + d1, d2 = [int(k) for k in input().split()] + if d1 == d2: + affilé += 1 + elif d1 != d2: + affilé == 0 + + + if affilé == 3: + print('YES') + exit() + +print('NO') +" +p02547,s981227561,Wrong Answer,"# -*- coding: utf-8 -*- +# 入力 +N = int(input()) + +l = [] +for i in range(N): + d1, d2 = map(int, input().split()) + l.append([d1, d2]) + +flag = 0 +cont = 0 +for i in l: + if(i[0]==i[1]): + flag = 1 + cont = cont + 1 + if (cont>=3): + break + else: + cont = 0 + flag =0 + + + +if (cont >=3): + print(""yes"") +else: + print(""no"") +" +p02547,s209883370,Wrong Answer,"n=int(input()) +c=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c+=1 +if c>3: + print(""Yes"") +else: + print(""No"")" +p02547,s703719243,Wrong Answer,"N=int(input()) +D={} +for i in range(N): + D[i]=input().split() + +cou=0 +for i in range(N): + if D[i][0]==D[i][1]: + cou+=1 + else: + cou=0 + + if cou == 3: + print('Yes') + break + +if cou == 0: + print('No') +" +p02547,s992002086,Wrong Answer,"def dice(N): + for i in range(len(N)-2): + if N[i][0]==N[i][1] and N[i+1][0]==N[i+1][1] and N[i+2][0]==N[i+2][1]: + return ""Yes"" + return ""No"" + +Number=int(input(""N="")) +N=[] +for i in range(Number): + x,y=input().split() + N.append([int(x), int(y)]) +print(dice(N)) +" +p02547,s694482230,Wrong Answer,"n = int(input()) +def judge(): + count = 0 + flag = True + for _ in range(n): + d1, d2 = map(int, input().split("" "")) + if d1 == d2: + count += 1 + else: + count = 0 + + + if count == 3: + return True + + return False + +if judge() == True: + print(""yes"") +else: + print(""no"") +" +p02547,s704828546,Wrong Answer,"loop = int(input()) +streak = 0 +verify = False +for i in range(loop): + diceArr = input().split() + if streak==3: + verify = True + else: + if diceArr[0] == diceArr[1]: + streak+=1 + else: + streak=0 +if verify: + print('Yes') +else: + print('No')" +p02547,s763068817,Wrong Answer,"N = int(input()) +D = [] +count = 0 + +for n in range(N): + input_line = input().split() + if (int(input_line[0]) == int(input_line[1]) & (count>0)): + count += 1 + else: + count = 0 + +if count >= 3: + print('Yes') + +else: + print('No')" +p02547,s661095629,Wrong Answer,"a2=int(input()) +a=0 +b3=0 +for i in range(a2): + b2,c2=map(str,input().split()) + b=int(b2) + c=int(c2) + if b==c: + a+=1 + elif a==3: + print('Yes') + b3+=1 + break + else: + a=0 + +if b3>0: + pass +else: + print('No')" +p02547,s400120670,Wrong Answer,"n = int(input()) +arr= [] +for i in range(n): + z = [ int(i) for i in input().split()] + arr.append(z) + +count = 0 +for i in range(n): + + if arr[i][0] == arr[i][1]: + count+=1 + +if count>=3: + print(""Yes"") +else: + print(""No"") + + " +p02547,s700132002,Wrong Answer,"n = int(input()) + +num_list=[] + +for i in range(n): + a,b = map(str, input().split()) + num_list.append(a) + num_list.append(b) + s = ''.join(num_list) +if ('111' in s) or ('222' in s) or ('333' in s) or ('444' in s) or ('555' in s) or ('666' in s): + print('YES') +else: + print('NO')" +p02547,s799463627,Wrong Answer,"import sys + +def main(): + N = int(input()) + zoro = 0 + for i in range(N): + Ds = [int(s) for s in sys.stdin.readline().split()] + if(Ds[0] == Ds[1]): + zoro += 1 + if(zoro > 2): + print(""Yes"") + return(0) + print(""No"") + +main()" +p02547,s872392105,Wrong Answer,"x=int(input()) +List=[] +counter=0 +for i in range(x): + List.append(list(map(int,input().split()))) +for i in range(len(List)): + if List[i][0]==List[i][1]: + counter+=1 + else: + counter=0 + if counter ==3: + print(""Yes"") +if counter<3: + print(""No"")" +p02547,s165644920,Wrong Answer,"n = int(input()) + +affilé = 0 +ok = 0 + + +for i in range(n): + d1, d2 = [int(k) for k in input().split()] + if d1 == d2: + affilé += 1 + elif d1 != d2: + affilé = 0 + + + if affilé == 3: + ok = 1 + +if ok == 0: + print('NO') +else: + print('YES') +" +p02547,s624539576,Wrong Answer,"N = int(input()) + +i = 0 +res = False + +for _ in range(N): + a, b = map(int,input().split()) + + if a == b: + print(""matched"") + i += 1 + else: + i = 0 + + if i >= 3: + res = True + +print(""Yes"" if res else ""No"")" +p02547,s375194538,Wrong Answer,"n = int(input()) + +count = 0 +for i in range(n): + a,b = list(map(int, input().split())) + print(a,b)" +p02547,s612381310,Wrong Answer,"n = int(input()) +count = 0 +ans = 'No' +for i in range(n): + a, b = map(int, input().split()) + if count == 3: + ans = 'Yes' + break + if a == b: + count += 1 + else : + count = 0 + pass + +print(ans)" +p02547,s780293412,Wrong Answer,"N = int(input()) +i=0 +cnt = 0 +flg = 1 + +while i < N: + i += 1 + a, b = map(int, input().split()) + if a==b: + cnt += 1 + else: + cnt = 0 + +if cnt >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s413413908,Wrong Answer,"N = int(input()) + +count = 0 + +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + count += 1 + +if count >= 3: + print('Yes') +else: + print('No')" +p02547,s839523260,Wrong Answer,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] + +c = 0 +ans = False +for i in d: + if d[0] == d[1]: + c += 1 + if c >=3: + ans = True + break + else: + c = 0 +if ans: + print('Yes') +else: + print(""No"")" +p02547,s933366773,Wrong Answer,"i = int(input()) +d = [list(map(int, input().split())) for i in range(i)] + +c = 0 +for i in range(len(d)): + if (d[i][0] == d[i][1]): + c += 1 +print(c) +" +p02547,s453324386,Wrong Answer,"n = int(input()) + +pv = [] +con = 0 + +while n > 0: + n -= 1 + s = str(input()) + d = s.split() + if d[0] == d[1]: + con += 1 + else: + if con >= 3: + break + pv += [con] + con = 0 + +pv += [con] +ans = max(pv) + +if ans >= 3: + print('Yes') +else: + print('NO')" +p02547,s180719846,Wrong Answer,"n = int(input()) +xy = [map(int, input().split()) for _ in range(n)] +x, y = [list(i) for i in zip(*xy)] + +ans = 0 +for i in range(n - 1): + if x[i] == y[i]: + ans += 1 + if ans == 3: + print(""Yes"") + break + + else: + ans = 0 + + +if ans == 0 or ans == 1 or ans == 2: + print(""No"") + + +" +p02547,s679211138,Wrong Answer,"N = int(input()) +D1 = [] +for i in range(N): + D = list(map(int, input().split())) + D1.append(int(D[0])) + D1.append(int(D[1])) + +count = 0 +for j in range(len(D1)-2): + if D1[j] == D1[j+1] == D1[j+2]: + count = count + 1 + break +if count == 1: + print(""Yes"") +else: + print(""No"") +" +p02547,s251753846,Wrong Answer,"n=int(input()) +q=[] +for _ in range(n): + d_1,d_2=map(int,input().split()) + if d_1==d_2: + q.append(1) + else: + q.append(0) +for i in range(n-3): + if q[i]==q[i+1]==q[i+2]==1: + print(""Yes"") + exit() +print(""No"") " +p02547,s869564967,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +for i in range(N-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print('Yes') + break + +print('No')" +p02547,s614567800,Wrong Answer,"ans = 0 +s = [] +for i in range(int(input())): + a,b = map(int,input().split()) + if a==b: + ans += 1 + s.append(ans) + else: + ans = 0 +if ans>=3: + print('Yes') +else: + print('No')" +p02547,s905157691,Wrong Answer,"n=int(input()) +count=0 +for i in range(0,n): + m,p=input().split() + if(m==p): + count=count+1 +if(count%3==0): + print(""Yes"") +else: + print(""No"") +" +p02547,s162840002,Wrong Answer,"N = int(input()) +sub_yes = 0 +max_yes = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + sub_yes += 1 + else: + max_yes = sub_yes + sub_yes = 0 +if sub_yes > max_yes: + max_yes = sub_yes +if max_yes >= 3: + print(""yes"") +else: + print(""no"")" +p02547,s787635005,Wrong Answer,"n = int(input()) + +num_list=[] +count=0 + +for i in range(n): + a,b = map(int, input().split()) + if a==b: + count+=1 + if count>2: + break + if a!=b: + count=0 +if count>2: + print('YES') +else: + print('NO')" +p02547,s675996431,Wrong Answer,"n=int(input()) +m=0 +for i in range(n): + A,B=map(int,input().split()) + if (A==B): + m=m+1 + else: + m=0 + if (m==3): + print(""Yes"") + break +print(""No"")" +p02547,s884211800,Wrong Answer,"num = int(input()) +count = 0 +for i in range(num): + d1, d2 = map(int,input().split()) + count += 1 if d1 == d2 else 0 +print(""Yes"" if count >= 3 else ""No"")" +p02547,s953974294,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N-1): + a, b = list(map(int, input().split())) + if a == b: + count += 1 + else: + count == 0 + if count == 3: + print(""Yes"") + break +print(""No"") + + + + + +" +p02547,s082336167,Wrong Answer,"N = int(input()) +count = 0 +temp = 0 + +for _ in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + if temp < count: + temp = count + +if temp >= 3: + print('Yes') +else: + print('No') +" +p02547,s166745804,Wrong Answer,"ans = 0 +for i in range(int(input())): + a,b = map(int,input().split()) + if a==b: + ans += 1 +if ans>=3: + print('Yes') +else: + print('No')" +p02547,s295333072,Wrong Answer,"cnt = int(input()) + +doublets = 0 +while cnt > 0: + if doublets == 3: + print(""YES"") + break + x, y = tuple(map(int, input().split())) + if x == y: + doublets += 1 + else: + doublets = 0 + cnt -= 1 +else: + print(""NO"")" +p02547,s096594933,Wrong Answer,"from sys import stdin +def ip(): return [int(i) for i in stdin.readline().split()] +def sp(): return [str(i) for i in stdin.readline().split()] + + +n = int(input()) +row = False +cnt = 0 +for _ in range(n): + x,y = ip() + if cnt == 3: row = True + if x == y: cnt += 1 + else: + cnt = 0 + +if row: print(""Yes"") +else: print(""No"")" +p02547,s867962467,Wrong Answer,"n = int(input()) +ds1 = [] +ds2 = [] +for _ in range(n): + d1,d2 = list(map(int, input().split())) + ds1.append(d1) + ds2.append(d2) + +matched = [d1 == d2 for d1,d2 in zip(ds1,ds2)] +cnt = 0 +for m in matched: + cnt = cnt+1 if m else 0 + if m == 3: + break + +if cnt == 3: + print('Yes') +else: + print('No')" +p02547,s723935616,Wrong Answer," +def input_int(): + return(int(input())) + +def input_int_list(): + return(list(map(int,input().split()))) + +def input_int_map(): + return(map(int,input().split())) + +def run(): + q_num = input_int() + + count_num = 0 + + for _ in range(q_num): + + a, b = input_int_map() + + if a == b: + count_num += 1 + + if count_num == 3: + print('YES') + return + else: + count_num = 0 + + print('NO') + +run() + +" +p02547,s937560214,Wrong Answer,"t = int(input()) + +best = 0 +cur = 0 + +for i in range(t): + a,b = map(int,input().split()) + if a == b: + cur += 1 + else: + best = max(best,cur) + cur = 0 +print(""Yes"" if best >= 3 else ""No"")" +p02547,s854269439,Wrong Answer,"n=int(input()) +l=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + l+=1 + else: + if l>=3: + print(""Yes"") + exit() + l=0 +print(""Yes"" if l>3 else ""No"")" +p02547,s039915004,Wrong Answer,"n=int(input()) +for i in range(0,n): + count=0 + m,n=input().split() + if(m==0): + count=count+1 +if(count%3==0): + print(""Yes"") +else: + print(""No"") +" +p02547,s733188556,Wrong Answer,"N = int(input()) +count = 0 +list1 = [] +list2 = [] +for i in range(N-1): + a, b = list(map(int, input().split())) + list1.append(a) + list2.append(b) + +for i in range(N-1): + if list1[i] == list2[i]: + count += 1 + if count == 3: + break + else: + count = 0 +if count == 3: + print(""Yes"") +else: + print(""No"") " +p02547,s203856209,Wrong Answer,"s = int(input()) +d = [[int(v) for v in input().split()] for i in range(s)] +ans = False +cnt = 0 +for j in range(len(d)): + if cnt == 3: + ans = True + break + if all(elem == d[j][0] for elem in d[j]): + cnt += 1 + else: + cnt = 0 +if ans: + print (""Yes"") +else: + print(""No"")" +p02547,s913184751,Wrong Answer,"N = int(input()) + +c = 0 +L=[] +flag=False +for _ in range(N): + d1, d2 = map(int, input().split()) + L.append(d1/d2) + +for i in range(N-3): + if sum(L[i:i+3]) == 3: + flag=True + +if flag: + print('Yes') +else: + print('No') +" +p02547,s593779730,Wrong Answer,"a=int(input()) +b=[list(map(int,input().split())) for i in range(a)] + +n=[] +for i in b: + if i[0]==i[1]: + n.append(1) + continue + n.append(0) +for i in range(a-3): + if n[i]==1 and n[i+1]==1 and n[i+2]==1: + print('Yes') + exit() +print('No')" +p02547,s346614928,Wrong Answer,"ctr = 0 +for _ in range(int(input())): + a, b = list(map(int, input().strip().split())) + if a == b: + ctr += 1 + else: + ctr = 0 + +print((""No"", ""Yes"")[ctr >= 3])" +p02547,s032130310,Wrong Answer,print('NYoe s'[[0]*3in[eval(t.replace(*' -'))for t in open(0)]::2]) +p02547,s987998731,Wrong Answer,"n = int(input()) + +eq = 1 +prev = False +for i in range(n): + d = [int(s) for s in input().split(' ')] + if d[0] == d[1]: + if prev: + eq += 1 + prev = True + else: + prev = False + eq = 1 + +if eq >= 3: + print('Yes') +else: + print('No') +" +p02547,s455007630,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + count += 1 + elif D1 != D2: + break +if (count >= 3): + print('Yes') +else: + print('No')" +p02547,s118921655,Wrong Answer,"N=int(input()) +count=0 +for i in range(N): + a,b=map(int,input().split()) + + if a==b: + count+=1 + if count==3: + print(""Yes"") + + else: + pass + + else : + count=0 + +if count !=3: + print('No') +" +p02547,s806002251,Wrong Answer,"N=int(input()) +count=0 +for i in range(N): + a,b=map(int,input().split()) + + if a==b: + count+=1 + if count==3: + print(""Yes"") + exit() + else: + pass + if a!=b: + count==0 + +if count!=3: + print('No') + " +p02547,s599860926,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if count > 2: + break + elif d1 == d2: + count += 1 + else: + count == 0 +if count > 2: + print(""Yes"") +else: + print(""No"")" +p02547,s229232563,Wrong Answer,"N=int(input()) + +div = [0] * (N+1) +for d in range(1, N+1): + for n in range(d, N, d): + div[n] += 1 + +ans = sum(div[:N]) +print(ans)" +p02547,s619413390,Wrong Answer,"N = int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +for i in range(N): + if x[i]==y[i]: + continue + else: + print(""No"") + exit(0) +print(""Yes"")" +p02547,s052308414,Wrong Answer,"n = int(input()) +d = [] +for i in range(n): + d.append(list(map(int,input().split()))) +row = [] +for i in range(n): + if d[i][0]==d[i][1]: + row.append(True) + else: + row.append(False) +res = False +for i in range(n-3): + if all(row[i:i+3]): + res = True + +if res: + print('Yes') +else: + print('No')" +p02547,s942427261,Wrong Answer,"i = int(input()) +count = 0 +for i in range(i): + a, b = input().split(' ') + if a == b: + count += 1 +print('Yes' if count >= 3 else 'No') +" +p02547,s325593041,Wrong Answer,"n = int(input()) +f = 0 +for i in range(n): + a,b = map(int, input().split()) + if(a == b): + f = 1 +if(f): + print('Yes') +else: + print('No')" +p02547,s400630199,Wrong Answer,"n = int(input()) +def judge(): + count = 0 + for _ in range(n): + d1, d2 = map(int, input().split("" "")) + if d1 == d2: + count += 1 + else: + count = 0 + + if count == 3: + return True + + return False + +if judge(): + print(""yes"") +else: + print(""no"")" +p02547,s261236185,Wrong Answer,"n = int(input()) +l = [] +for i in range(n): + x,y = map(int,input().split()) + l.append((x,y)) +for i in range(n-3): + if l[i][0] == l[i][1] and l[i+1][0] == l[i+1][1] and l[i+2][0] == l[i+2][1]: + print('Yes') + exit() +print('No')" +p02547,s307429578,Wrong Answer,"n = int(input()) +cnt = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if cnt >= 3: + print(""Yes"") + exit() + if d1 == d2: + cnt += 1 + if d1 != d2: + cnt = 0 +print(""No"")" +p02547,s632978832,Wrong Answer,"n = int(input()) +a = [[int(i) for i in input().split()] for j in range(n)] +good = False +for i in range(n-3): + ok = True + for j in range(i, i+3): + ok &= a[j][0] == a[j][1] + good |= ok +print(""Yes"" if good else ""No"")" +p02547,s369042724,Wrong Answer,"# -*- coding: utf-8 -*- +# 入力 +N = int(input()) + +l = [] +for i in range(N): + d1, d2 = map(int, input().split()) + l.append([d1, d2]) + +flag = 0 +cont = 0 +for i in l: + if(i[0]==i[1]): + flag = 1 + cont = cont + 1 + if (cont>=3): + break + else: + cont = 0 + flag =0 + + + +if (cont >=3): + print(""yes"") +else: + print(""no"") +" +p02547,s258038757,Wrong Answer,"N=int(input()) +D=[list(map(int,input().split())) for i in range(N)] +tf=0 +for j in range(0,N-3):#Di1=Di2&Di+1_1=Di+1_2&Di1=Di2 3回連続ぞろ目 + if D[j][0]==D[j][1] and D[j+1][0]==D[j+1][1] and D[j+2][0]==D[j+2][1]: + tf=1 + break + +if tf==1: + print(""Yes"") +else: + print(""No"") +" +p02547,s532763241,Wrong Answer,"N = int(input()) + +d1=[] +d2=[] + +cont=0 +for i in range(N): + D1,D2=map(int,input().split()) + + d1.append(D1) + d2.append(D2) + +for i in range(len(d1)): + if d1[i]==d2[i]: + cont+=1 + else: + cont=0 +if cont>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s569402955,Wrong Answer,"N = int(input()) +D = [] +count = 0 + +for n in range(N): + input_line = input().split() + if (int(input_line[0]) == int(input_line[1])): + count += 1 + else: + pass + +if count >= 3: + print('Yes') + +else: + print('No')" +p02547,s277305779,Wrong Answer,"N=int(input()) +D={} +for i in range(N): + D[i]=input().split() + +cou=0 +for i in range(N): + if D[i][0]==D[i][1]: + cou+=1 + else: + cou=0 + + +if cou >= 3: + print('Yes') +elif cou == 0: + print('No')" +p02547,s692846754,Wrong Answer,"n = int(input()) +def judge(): + count = 0 + flag = True + for _ in range(n): + d1, d2 = map(int, input().split("" "")) + if d1 == d2: + count += 1 + else: + count = 0 + + + if count == 3: + flag = True + break + + flag = False + + return flag + +if judge() == True: + print(""yes"") +else: + print(""no"")" +p02547,s957415445,Wrong Answer,"N = int(input()) +count=0 +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +for i in range(N): + if x[i]==y[i]: + count+=1 + continue + + else: + print(""No"") + exit(0) +if 3<=count: + print(""Yes"") +else: + print(""No"")" +p02547,s077435854,Wrong Answer,"# coding:utf-8 +n = int(input()) +count = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + + if d1 == d2: + count += 1 + + if count == 3: + print('Yes') + exit() + else: + count = 0 + +print('No') +" +p02547,s073240496,Wrong Answer,"n = int(input()) +data = [] +zoro = [] +yn = False +for i in range(n): + data = input().split() + if data[0] == data[1]: + zoro += [True] + else: + zoro += [False] + if i > 1 and (zoro[i] == True or zoro[i-1] == True or zoro[i-2] == True): + yn = True +print(""Yes"") if yn == True else print(""No"")" +p02547,s537076607,Wrong Answer,"n = int(input()) +zoro = 0 + +for i in range(n): + d1, d2 = input().split() + if d1 == d2: + zoro += 1 + else: + zoro = 0 + +if zoro >= 3: + print('Yes') +else: + print('No')" +p02547,s727336595,Wrong Answer,"N = int(input()) +D = [] +for _ in range(N): + d1, d2 = map(int, input().split()) + D.append(d1) + D.append(d2) + +flg = False +for i in range(N*2-2): + if D[i] == D[i+1] == D[i+2]: + flg = True + break + +if flg: + print('Yes') +else: + print('No') +" +p02547,s999597445,Wrong Answer,"N = int(input()) +List = list() +for i in range(N): + List.append(list(map(int, input().split()))) +List = sum(List, []) +for i in range(1,N-2): + if List[2*i-2] == List[2*i-1]: + if List[2*i] == List[2*i+1]: + if List[2*i+2] == List[2*i+3]: + print(""Yes"") + exit() + else: + pass + else: + pass + else: + pass +print(""No"") + +" +p02547,s893941692,Wrong Answer,"N = int(input()) + +c = 0 +for _ in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + c += 1 + +if c>=3: + print('Yes') +else: + print('No') +" +p02547,s095989583,Wrong Answer,"import numpy as np +n = int(input()) +x = [list(map(int,input().split())) for i in range(n)] + +x=np.array(x).flatten() +count=0 +tmp=0 +for i in x: + if count==2: + print(""Yes"") + break + + elif tmp==i: + count+=1 + else: + tmp=i + count=0 +else: + print(""No"")" +p02547,s043474021,Wrong Answer,"import numpy as np + +n = int(input("""")) +a = np.zeros((n,2)) +cnt = 0 + +for i in range(n): + a[i] = input().split() + +for i in range(n): + if a[i][0] == a[i][1]: + cnt +=1 + +if cnt >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s648753466,Wrong Answer,"def main(): + N = int(input()) + zoro = 0 + for _ in range(N): + d1 , d2 = map(int,input().split()) + if d1 == d2: + zoro += 1 + else: + zoro = 0 + if zoro > 2: + print(""yes"") + return + print(""No"") + +if __name__ == '__main__': + main() +" +p02547,s294568391,Wrong Answer,"from sys import exit +N = int(input()) + +cnt = 0 +for i in range(N): + x,y = map(int,input().split()) + if cnt == 3: + print(""Yes"") + exit(0) + if x == y: + cnt += 1 + else: + cnt = 0 + +print(""No"")" +p02547,s092390500,Wrong Answer,"n=int(input()) +l=[] +m=[] +for i in range(0,n): + a,b=map(int,input().split()) + l.append(a) + m.append(b) +c=0 +i=0 +while i<=n-3: + if l[i]==m[i] and l[i+1]==m[i+1] and l[i+2]==m[i+2]: + c=3 + i=i+2 +if c==3: + print('Yes') +else: + print('No') +" +p02547,s190044770,Wrong Answer,"n = int(input()) +count = 0 +a = [] + +for i in range(n): + al, be = map(int, input().split()) + if al == be: + count += 1 + if count >= 3: + print(""Yes"") + else: + count = 0 +else: + print(""No"") +" +p02547,s766869563,Wrong Answer,"n = int(input()) +a,b = map(int,input().split()) +c,d = map(int,input().split()) +flag = 0 +for i in range(n-2): + e,f = map(int,input().split()) + if a == b and c == d and e == f: + flag = 1 + break + a,b = c,d + c,d = e,f +if flag == 0: + print(""NO"") +else: + print(""YES"")" +p02547,s803043380,Wrong Answer,"n = int(input()) + +cnt = 0 +for i in range(n): + d1, d2 = input().split() + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 3: + print('Yes') + break +print('No')" +p02547,s732247308,Wrong Answer,"s = """" +for _ in "" ""*int(input()): + a,b = map(int,input().split()) + if a == b: + s +=""0"" +if ""000"" in s: + print(""Yes"") +else: + print(""No"")" +p02547,s796623626,Wrong Answer,"N = int(input()) + +counter = 0 +for i in range(N): + A, B = map(int, input().split()) + if A == B: + counter += 1 + +if counter >= 3: + print('Yes') +else: + print('No')" +p02547,s480563897,Wrong Answer,"N=int(input()) + +X=[] +Y=[] +for _ in range(N): + x, y = map(int, input().split()) + X.append(x) + Y.append(y) +A=""NO"" +for n in range(N-2): + if X[n]==Y[n] and X[n+1]==Y[n+1] and X[n+2]==Y[n+2]: + A=""YES"" + break +print(A)" +p02547,s845619742,Wrong Answer,"n = int(input()) + +zoro = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + if zoro == 3: + print(""Yes"") + quit() + elif d1 == d2: + zoro = zoro + 1 + else: + zoro = 0 + +print(""No"") +" +p02547,s481206698,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + count += 1 + elif count == 3: + break +if count == 3: + print('Yes') +else: + print('No')" +p02547,s032248235,Wrong Answer,"n=int(input()) +c=1 +count=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + count+=1 + else: + count=0 + if count==3: + c=1 +if c==1: + print(""Yes"") +else: + print(""No"") + + + " +p02547,s668809103,Wrong Answer,"N = int(input()) +i = 0 +for count in range(1, N+1): + a, b = map(int, input().split()) + if a == b: + i += 1 +if i == 3: + print('Yes') +else: + print('No')" +p02547,s851164700,Wrong Answer,"n = int(input()) +x = 0 +for i in range(n - 2): + d1, d2 = map(int, input().split()) + if x != 3: + if d1 != d2: + x = 0 + else: + x += 1 +print(""Yes"" if x == 3 else ""No"")" +p02547,s589609087,Wrong Answer,"import sys + +n = int(input()) +deme = [input().split() for i in range(n)] + +#print(deme) + +toki = 0 + +for i in range(n): + if deme[i][0] == deme[i][1]: + toki += 1 + if toki >= 3: + print(""YES"") + sys.exit(0) + + else:toki = 0 + +print(""NO"") + + " +p02547,s633149938,Wrong Answer,"n = int(input()) +p = [list(map(int,input().split())) for i in range(n)] + + +a = p[0] +b = 0 +ans = 0 +tf = 1 + +for j in range(n): + if sum(p[j]) // 2 ** 2 == sum(p[j]): + ans += 1 + else: + ans = 0 + if ans == 3: + tf = 0 + print(""Yes"") + break + +if tf == 1: + print(""No"")" +p02547,s866533723,Wrong Answer,"import sys + +n = int(input()) +d1 = [] +d2 = [] +for i in range(n): + t,u = map(int,input().split()) + d1.append(t) + d2.append(u) +c = 0 +for i in range(n): + if d1[i] == d2[i]: + c += 1 + else: + c == 0 + if c == 3: + print(""Yes"") + sys.exit() +print(""No"")" +p02547,s077560569,Wrong Answer,"# coding: utf-8 +n = int(input()) +L=[] +for i in range(n): + a, b = map(int,input().split()) + if a==b: + L.append(1) + else: + L.append(0) +flg=False +for i in range(n-3): + if L[i] and L[i+1] and L[i+2]: + flg=True + break + +if flg: + print(""Yes"") +else: + print(""No"")" +p02547,s597124901,Wrong Answer,"N=int(input()) +ans = 0 +X = map(int,[input() for i in range(N)]) + +for i in range(N): + if ans <= 3: + print(""Yes"") + break + if i == (""1 1"" or ""2 2"" or ""3 3"" or ""4 4"" or ""5 5"" or""6 6""): + ans = ans + 1 + else: + if ans == 1: + ans = ans - 1 + if ans == 2: + ans = ans - 2 + +else: + print(""No"")" +p02547,s727616602,Wrong Answer,"n=int(input()) +a=[] +for i in range(n): + a.append(list(map(int,input().split()))) +ans=""No"" +for i in range(n-3): + if a[i][0]==a[i][1] and a[i+1][0]==a[i+1][1] and a[i+2][0]==a[i+2][1]: + ans=""Yes"" + break +print(ans)" +p02547,s440466394,Wrong Answer,"# -*- coding: utf-8 -*- +"""""" +Created on Sat Sep 19 13:06:46 2020 + +@author: Admin +"""""" + +n=int(input()) +l=[] +flag=0 +for i in range(n): + a,b=input().split() + w=[int(a),int(b)] + l.append(w) +for i in range(len(l)-2): + if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]: + print('yes') + flag=1 + break +if flag==0: + print('no')" +p02547,s787369200,Wrong Answer,"n=int(input()) +ans=0 +x=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b and i==x+1: + ans+=1 + x=i + if ans==3: + x=0 + break + elif a==b and i!=x+1: + x=i +if ans==3: + print('Yes') +else: + print('No')" +p02547,s072354283,Wrong Answer,"n = int(input()) +str_list = [list(input().split()) for _ in range(n)] +for i in range(n-2): + if str_list[i][0] == str_list[i][1] and str_list[i+1][0] == str_list[i+1][1] and str_list[i+2][0] == str_list[i+2][1]: + break + print('Yes') +else: + print('NO')" +p02547,s437146366,Wrong Answer,"N = int(input()) +count = 0 +for _ in range(N): + a,b = map(int, input().split()) + if a == b: + count += 1 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s628586852,Wrong Answer,"n=int(input()) +xy = [map(int, input().split()) for _ in range(n)] +x, y = [list(i) for i in zip(*xy)] +a=0 +for i in range(n): + if x[i]==y[i]: + a+=1 +if a>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s860399545,Wrong Answer,"n=int(input()) +count=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + count+=1 +if count>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s162068581,Wrong Answer,"n=int(input()) +count=0 +ren=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b and count<3: + count+=1 + ren=1 + else: + count=0 +if count>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s697890366,Wrong Answer,"N = int(input()) +t = 0 +for i in range(N): + a, b = [int(x) for x in input().split()] + if a != b: + t = 0 + else: + t += 1 + if t == 2: + break +if t == 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s826765666,Wrong Answer,"N = int(input()) +l = [list(map(int, input().split())) for l in range(N)] + +last = 0 +for item in l: + if last == 0 and l[0] == l[1]: + last = 1 + if last == 1 and l[0] == l[1]: + last == 2 + if last == 2 and l[0] == l[1]: + last == 3 + break + last == 0 + +if last == 3: + print('Yes') +else: + print('No')" +p02547,s741065593,Wrong Answer,"n = int(input()) +l1 = [] +l2 = [] +for l in range(n): + a,b = map(int,input().split()) + l1.append(a) + l2.append(b) +for i in range(n-3): + if l1[i] == l2[i] and l1[i+1] == l2[i+1] and l1[i+2] == l2[i+2]: + print(""Yes"") + break + else: + print(""No"") + break" +p02547,s688222679,Wrong Answer,"N = int(input().strip()) + +a = [] +c =0 +f = 0 +for i in range(N): + array = list(map(int, input().strip().split())) + a.append(array) +#print(a[4][1]) +for i in range(N): + if(f == 0 or f == i-1): + if(a[i][0] == a[i][1]): + f=i + c+=1 + else: + f=0 + c=0 +if(c >= 3): + print(""Yes"") +else: + print(""No"")" +p02547,s638389414,Wrong Answer,"N = int(input()) + +count = 0 +for i in range(N): + x, y = map(int, input().split()) + if x == y: + count += 1 + +if count < 3: + print(""No"") +else: + print(""Yes"")" +p02547,s602531580,Wrong Answer,"N = int(input()) + +list = [input() for i in range(N)] + +ans = ""No"" + +for i in range(1, N): + if i < N-1: + a,b = map(int, list[i].split()) + x = int(list[i-1].split()[1]) + y = int(list[i+1].split()[0]) + if a == b == x: + ans = ""Yes"" + elif a==b==y: + ans = ""Yes"" + else: + if a == b== x: + ans = ""Yes"" + +print(ans) +" +p02547,s563705487,Wrong Answer,"n = int(input()) +a = [] +found = False +count = 0 +for i in range(n): + al, b = map(int, input().split()) + a.append((a, b)) + if found: + print(""Yes"") + break + if a[i][0] == a[i][1]: + count += 1 + if count >= 3: # that means that the i is in last 3 numbers + print(""Yes"") + break + else: + count = 0 +else: + print(""No"") +" +p02547,s705901692,Wrong Answer,"n=int(input()) +cnt=0 +flag=True +for i in range(n): + a,b=map(int,input().split()) + if a==b and flag==True: + cnt+=1 + else: + cnt=0 + flag=False +if cnt>=3: + print(""Yes"") +else: + print(""No"") +" +p02547,s723347227,Wrong Answer,"N = int(input()) + +count = 0 + +for i in range(N): + k, t = map(int, input().split()) + if count == 3: + print ( ""Yes"" ) + + break + + if not k == t: + count *= 0 + if k == t: + count += 1 +if not count == 3: + print (""No"") + +" +p02547,s591590718,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +cnt = 0 +for i in range(N): + if D[i][0] == D[i][1]: + cnt += 1 + +if cnt >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s868683379,Wrong Answer,"n = int(input()) +d = [0] * n +x = [0] * n +for i in range(n): + d[i], x[i] = map(int, input().split()) +m = 0 +for i in range(n-3): + if d[i]==x[i] and d[i+1]==x[i+1] and d[i+2]==x[i+2]: + break + else: + m = m+1 +if m==n-3: + print(""No"") +else: + print(""Yes"")" +p02547,s582866643,Wrong Answer,"N = int(input()) + +xy = [map(int,input().split()) for _ in range(N)] +x,y = [list(i) for i in zip(*xy)] + +ans = 0 + +for i in range(N): + if x[i] == y[i]: + ans +=1 + else: + ans -=1 + +if ans >= 3: + print(""Yes"") + +else: + print(""No"")" +p02547,s187318307,Wrong Answer,"n=int(input()) +l1=[] +l2=[] +for i in range(n): + x,y=(int(i) for i in input().split()) + l1.append(x) + l2.append(y) +c=0 +for i in range(n-2): + if(l1[i]==l2[i] and l1[i+1]==l2[i+1] and l1[i+2]==l2[i+1]): + c=1 + break +if(c==0): + print(""No"") +else: + print(""Yes"")" +p02547,s540302279,Wrong Answer,"n = int(input()) +count=0 +flag=0 +for num in range(n-1): + i = list(map(int, input().split())) + if i[0]==i[1]: + count +=1 + else: + count=0 + if count == 3: + flag=1 +if flag==0: + print('No') +elif flag==1: + print('Yes')" +p02547,s541811710,Wrong Answer,"N=int(input()) + +X=[] +Y=[] +for _ in range(N): + x, y = map(int, input().split()) + X.append(x) + Y.append(y) + +A=""NO"" +for n in range(N-2): + if X[n]==Y[n]: + if X[n+1]==Y[n+1]: + if X[n+2]==Y[n+2]: + A=""YES"" + break + else: + continue + else: + continue + else: + continue +print(A)" +p02547,s904373373,Wrong Answer,"n = int(input()) +d1d2 = [map(int, input().split()) for _ in range(n)] +d1, d2 = [list(i) for i in zip(*d1d2)] +h = 'No' +for i in range(n): + if i > 2: + if d1[i] == d2[i]: + if d1[i-1] == d2[i-1]: + if d1[i-2] == d2[i-2]: + h = 'Yes' + break +print(h)" +p02547,s310624867,Wrong Answer,"N = int(input()) +D = [input().split() for _ in range(N)] +zoro = [d1 == d2 for d1, d2 in D] +for i in range(N-3): + if zoro[i] and zoro[i+1] and zoro[i+2]: + print(""Yes"") + exit() +print(""No"")" +p02547,s858491465,Wrong Answer,"# coding:utf-8 +n = int(input()) +count = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + + if d1 == d2: + count += 1 + + if count >= 3: + print('Yes') + exit() + +print('No') +" +p02547,s931535343,Wrong Answer,"N = int(input()) + +d = [] +for i in range(N): + D1, D2 = map(int, input().split()) + if D1 == D2: + ans = ""same"" + else: + ans = ""no"" + d.append(ans) +flag = ""No"" +for i in range(N-2): + if d[i] == d[i+1] and d[i+1] == d[i+2]: + flag = ""Yes"" +print(flag)" +p02547,s941806310,Wrong Answer,"n = int(input()) +count=0 +flag=0 +for num in range(n-1): + i = list(map(int, input().split())) + if i[0]==i[1]: + count +=1 + else: + count=0 + if count == 3: + flag=1 + break +if flag==0: + print('No') +elif flag==1: + print('Yes')" +p02547,s819941804,Wrong Answer,"cnt = 0 +n = int(input()) +for i in range(0,n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3 : + print(""Yes"") + break + elif cnt != 3 and i == n-1: + print(""No"") + else: + cnt == 0 " +p02547,s700793765,Wrong Answer,"N = int(input()) + +L=[] +flag=False +for _ in range(N): + d1, d2 = map(int, input().split()) + L.append(d1/d2) + +for i in range(N-2): + if sum(L[i:i+3]) == 3: + flag=True + +if flag: + print('Yes') +else: + print('No') +" +p02547,s984179940,Wrong Answer,"N = int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] + +count = 0 + +for i in range(N): + if x[i] == y[i]: + count += 1 + if count == 3: + print(""Yes"") + + else: + count = 0 + + +print(""No"")" +p02547,s703877588,Wrong Answer,"n=int(input()) +ans=0 +x=-1 +for i in range(n): + a,b=map(int,input().split()) + if a==b and i==x+1: + ans+=1 + x=i + if ans==3: + x=0 + break +if ans==3: + print('Yes') +else: + print('No')" +p02547,s722187222,Wrong Answer,"import random + +x = input() +x = int(x) + +result = [] # 結果を入れるリストを用意 + +for n in range(x): + z=[random.randint(1, 6),random.randint(1, 6)] + if z[0]==z[1]: + r=1 + else: + r=0 + result.append(r) + +y=sum(result) + +if y>2: + print(""Yes"") +else: + print(""No"")" +p02547,s902652848,Wrong Answer,"i = int(input()) +d = [list(map(int, input().split())) for i in range(i)] + +c = 0 +for i in range(len(d)): + if (d[i][0] == d[i][1]): + c += 1 +print(""Yes"" if c <= 3 else ""No"") +" +p02547,s384388355,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for i in range(N)] +cnt_cons=0 + +for i in range(1, N-2, 1): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print(""Yes"") + cnt_cons += 1 + exit() +if cnt_cons == 0: + print(""No"")" +p02547,s109579018,Wrong Answer,"import sys +ls = [] +N = int(input()) +for l in sys.stdin: + ls.append(l.split()) + +c = 0 +p = 0 +ans = 'No' +while len(ls) > (c+1): + if ls[c][0] != ls[c][1]: + c += 1 + p = 0 + continue + else: + c += 1 + p += 1 + if p == 3: + ans = 'Yes' + break + +print(ans)" +p02547,s541749762,Wrong Answer,"def run(n, _in_list): + ''' + ''' + is_doublet_count = 0 + for x in _in_list: + _in = list(x) + if _in[0] ==_in[1]: + is_doublet_count += 1 + else: + is_doublet_count = 0 + + print('Yes' if is_doublet_count >= 3 else 'No') + + + + + +if __name__ == '__main__': + n = int(input()) + _in_list = [map(int, input().split()) for _ in range(n)] + run(n, _in_list)" +p02547,s191241185,Wrong Answer,"import sys + +N=int(input()) +cnt=0 + +for i in range(N): + D_1,D_2=map(int,input().split()) + if cnt==3: + print('Yes') + sys.exit() + if D_1==D_2: + cnt+=1 + else: + cnt=0 + +print('No')" +p02547,s161752738,Wrong Answer,"n = int(input()) + +ans = 'No' +count = 0 +for i in range(n): + a,b = map(int,input().split()) + if a==b: + count += 1 + if count == 3: + ans = 'Yes' + +print(ans) + + + " +p02547,s719109350,Wrong Answer,"import numpy as np + +n = int(input("""")) +a = np.zeros((n,2)) +cnt = 0 + +for i in range(n): + a[i] = input().split() + if a[i,0] == a[i,1]: + a[i] = [0] + +for i in range(n-1): + if a[i,0] == a[i+1,0]: + cnt += 1 + elif cnt >= 2: + cnt = cnt + else: + cnt = 0 + + +if cnt >= 2: + print(""Yes"") +else: + print(""No"")" +p02547,s105260368,Wrong Answer,"N=int(input()) +x = [list(map(int, input().split())) for i in range(N)] +A=""NO"" +for n in range(N-2): + if x[n][0]==x[n][1] and x[n+1][0]==x[n+1][1] and x[n+2][0]==x[n+2][1]: + A=""YES"" + break +print(A)" +p02547,s955137661,Wrong Answer,"# coding: utf-8 +# Your code here! + +dice = int(input()) + +s = [] +for i in range(1, dice+1): + a = input().split("" "") + s.append(a) + +count = 0 +for j in range(len(s)-1): + if s[j][0] == s[j][1]: + if s[j+1][0] == s[j+1][1]: + count += 1 + if count >= 2: + print(""Yes"") + break + else: + count -= 1 + + +if count < 2: + print(""No"") +" +p02547,s895409570,Wrong Answer,"n = int(input()) +cnt = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + else: + cnt = 0 +if cnt >= 3: + print('Yes') +else: + print('No')" +p02547,s434352675,Wrong Answer,"n = int(input()) +d = [] +for i in range(n): + d.append(list(map(int,input().split()))) +row = [] +for i in range(n): + if d[i][0]==d[i][1]: + row.append(True) + else: + row.append(False) +res = False +for i in range(n-2): + print(row[i:i+3]) + if all(row[i:i+3]): + res = True +if res: + print('Yes') +else: + print('No')" +p02547,s007944734,Wrong Answer,"#!/usr/bin/env python + +n = int(input()) +d = [[0 for _ in range(2)] for _ in range(n)] +for i in range(n): + d[i][0], d[i][1] = map(int, input().split()) + +for i in range(n-3): + if d[i][0] == d[i][1] and d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]: + print('Yes') + exit() +print('No') +" +p02547,s264588056,Wrong Answer,"N = int(input()) +l = [list(map(int, input().split())) for l in range(N)] + +last = 0 +for item in l: + if last == 0 and item[0] == item[1]: + last = 1 + continue + elif last == 1 and item[0] == item[1]: + last = 2 + continue + elif last == 2 and item[0] == item[1]: + last = 3 + break + last == 0 + +if last == 3: + print('Yes') +else: + print('No')" +p02547,s814760795,Wrong Answer,"i = int(input()) +count = 0 +for i in range(i): + a, b = input().split(' ') + if a == b: + count += 1 + else: + count = 0 +print('Yes' if count >= 3 else 'No') +" +p02547,s050407833,Wrong Answer,"import random + +x = input() +x = int(x) + +result = [] # 結果を入れるリストを用意 + +for n in range(x): + z=[random.randint(1, 6),random.randint(1, 6)] + if z[0]==z[1]: + r=1 + else: + r=0 + result.append(r) + +y=sum(result) +maped_list = map(str, result) +txt = ''.join(maped_list) + +ans3=txt.count('111') + +if ans3>1: + print(""Yes"") +else: + print(""No"")" +p02547,s355587394,Wrong Answer,"N=int(input()) +xy = [map(int, input().split()) for _ in range(N)] +x, y = [list(i) for i in zip(*xy)] +cnt=0 +result=""No"" +# 出力して確認 +#for n in range(N-1): +for i in range(N): + cnt+=1 if x[i]==y[i] else 0 + if cnt>2: + result=""Yes"" +print(result)" +p02547,s578554418,Wrong Answer,"from collections import defaultdict +import sys +import math +import random +def get_array(): return list(map(int , sys.stdin.readline().strip().split())) +def get_ints(): return map(int, sys.stdin.readline().strip().split()) +def input(): return sys.stdin.readline().strip() + +cnt = 0 +n = int(input()) +for i in range(n): + (x,y) = get_ints() + if x==y: + cnt+=1 +if cnt>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s432533460,Wrong Answer,"n = int(input()) +z = [] +y = 0 +for i in range(n): + line = input().split("" "") + if int(line[0])==int(line[1]): + z.append(i) + +for i in range(len(z)-3): + if z[i]==z[i+1]-1: + if z[i+1]==z[i+2]-1: + y += 1 +if y > 0: + print(""Yes"") +else: + print(""No"")" +p02547,s431155077,Wrong Answer,"import sys + +n = int(input()) + +zoro = 0 +res = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + + if zoro == 3: + res = 1 + if d1 != d2: + zoro = 0 + else: + zoro = zoro + 1 + +if res == 1: + print(""Yes"") +else: + print(""No"") +" +p02547,s164144073,Wrong Answer,"c = int(input()) +count = 0 + +d = [list(map(int,input().split())) for i in range(c)] +for i in range(c): + a,b = d[i][0],d[i][1] + + if (a==b): + count += 1 + else : + count = 0 + +if (count >= 3): + + print(""Yes"") +else : + print(""No"") +" +p02547,s260010602,Wrong Answer,"N = int(input()) +result = '0' +for i in range(N): + d1,d2 = map(int, input().split()) + if d1 == d2: + result += '1' + else: + result += '0' +if '111' in result: + print('Yes')" +p02547,s799370651,Wrong Answer,"n=int(input()) +ans=0 +for i in range(n): + a,b=map(int,input().split()) + if a==b: + ans+=1 + else: + ans=0 +if ans>=3: + print('Yes') +else: + print('No')" +p02547,s411503457,Wrong Answer,"n=int(input()) +lst1=[] +lst2=[] +count=0 +for _ in range(n): + m,k=[int(x) for x in input().split()] + lst1.append(m) + lst2.append(k) +if(n<3): + print('NO') +else: + + for i in range(n-2): + if(lst1[i]==lst2[i] and lst1[i+1]==lst2[i+1] and lst1[i+2]==lst2[i+2]): + count=3 + break + if(count>=3): + print('YES') + else: + print('NO') + " +p02547,s427671600,Wrong Answer,"n = int(input()) +A = [[int(i) for i in input().split()] for j in range(n)] +for i in range(n-3): + if A[i][0] == A[i][1] and A[i+1][0] == A[i+1][1] and A[i+2][0] == A[i+2][1]: + print(""Yes"") + break +else: + print(""No"")" +p02547,s858619773,Wrong Answer,"n=int(input()) +count = 0 +last = 0 +for a in range(n): + z = list(input().split()) + if int(z[0]) == int(z[1]): + count+=1 + if count >= 3: + last = 1 + if int(z[0]) != int(z[1]): + if count > 0: + count = 0 + else: + continue +if last == 1: + print(""yes"") +if last == 0: + print(""no"")" +p02547,s253554267,Wrong Answer,"import random + +x = input() +x = int(x) + +result = [] # 結果を入れるリストを用意 + +for n in range(x): + z=[random.randint(1, 6),random.randint(1, 6)] + if z[0]==z[1]: + r=1 + else: + r=0 + result.append(r) + +y=sum(result) +print(result) +maped_list = map(str, result) +txt = ''.join(maped_list) + +ans3=txt.count('111') +print(txt) + +if ans3>1: + print(""yes"") +else: + print(""no"")" +p02547,s706544597,Wrong Answer,"N = int(input()) +K = 0 +for i in range(N): + x,y = map(int,input().split()) + if x == y: + K += 1 +if K >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s288569199,Wrong Answer,"N = int(input()) +j = 0 +for i in range(0, N): + D = str(input()) + D = D[0::2] + if D[0] == D[1]: + j += 1 + +if j == 3: + print(""Yes"") +elif j == 6: + print(""Yes"") +elif j != 3: + print(""No"") +else: + print(""No"") + +" +p02547,s117262839,Wrong Answer,"n = int(input()) +d = [input().split("" "") for _ in range(n)] + +f = False +for i in range(n-2): + if d[i][0] == d[i][1] or not f : + if d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]: + f = True +if f: + print(""Yes"") +else: + print(""No"")" +p02547,s319107835,Wrong Answer,"times = int(input()) +zorome = 1 +for i in range(times): + a = input().rstrip().split("" "") + b = int(a[0]) + c = int(a[1]) + if b == c: + zorome = zorome + 1 + else: + zorome = 0 +if zorome > 3: + print(""Yes"") +else: + print(""No"")" +p02547,s288668876,Wrong Answer,"n = int(input()) + +count=0 + +for i in range(n): + a,b = map(int, input().split()) + if a==b: + count+=1 + if a!=b: + if count<3: + count=0 +if count>2: + print('YES') +elif count<3: + print('NO')" +p02547,s204246470,Wrong Answer,"n = int(input()) +l = [list(map(int, input().split())) for i in range(n)] +#print(l[0][0]) +#print(l[0][1]) +ans = n-2 +ans1 = 0 + +for m in range(ans): + if l[m][0] == l[m][1] and l[m+1][0] == l[m+1][1] and l[m+2][0] == l[m+2][1]: + ans1 += 1 + else: + ans1 = 0 + + +if ans1 >= 1: + print(""Yes"") +else: + print(""No"")" +p02547,s823893299,Wrong Answer,"N = int(input()) +D = [list(map(int,input().split())) for _ in range(N)] + +cnt,cnt_max = 0,0 +for i in range(N): + if D[i][0] == D[i][1]: + cnt += 1 + else: + cnt_max = cnt + cnt = 0 + +cnt_max = max(cnt_max,cnt) + +if cnt_max >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s276028109,Wrong Answer,"N, *D = map(int, open(0).read().split()) + +D = [(d1, d2) for d1, d2 in zip(*[iter(D)] * 2)] + +for i in range(N - 3): + if all(D[i + j][0] == D[i + j][1] for j in range(3)): + print(""Yes"") + break +else: + print(""No"") +" +p02547,s561512569,Wrong Answer,"def main(): + N = int(input()) + cnt = 0 + maxcnt = 0 + for n in range(N): + D = list(map(int,input().split())) + if D[0] == D[1]: + cnt += 1 + else: + maxcnt = cnt + cnt = 0 + if maxcnt >= 3 or cnt >= 3: + print(""Yes"") + else: + print(""No"") + +if __name__ == '__main__': + main()" +p02547,s215887382,Wrong Answer,"N = int(input()) + +flag = 0 + +for i in range(N): + a,b = map(int,input().split()) + if a == b: + flag += 1 + +if flag >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s603615189,Wrong Answer,"#179-B + +N = int(input()) +A = [] + +for i in range(N): + D,H = map(int,input().split()) + + if D == H: + A.append(i) + +#print(A) + +if len(A) <= 2: + print(""No"") + +else: + for j in range(len(A)-2): + if A[j]+1 == A[j+1] and A[j+1]+1 == A[j+2]: + print(""Yes"") + break +" +p02547,s708467164,Wrong Answer,"def main(): + n = int(input()) + + count = 0 + answer = 'No' + for i in range(n): + d = list(map(int, input().split())) + if d[0] == d[1]: + count += 1 + if count >= 3: + answer = 'Yes' + break + + print(answer) + + +if __name__ == '__main__': + main() +" +p02547,s661547497,Wrong Answer,"x=int(input()) +l=[] +c=0 +for i in range(x): + a,b = map(int,input().split()) + l.append(a) + l.append(b) +for i in range(0,x*2,2): + if l[i]==l[i+1]: + c+=1 + if c>=3: + print(""YES"") + break + + else: + c=0 +if c<3: + print(""NO"") + " +p02547,s889328932,Wrong Answer,"n=int(input()) +ans=0 +c=True +for i in range(n): + a,b=map(int,input().split()) + if a==b: + ans+=1 + if ans==3: + print(""Yes"") + c=False + break +if c==True: + print(""No"")" +p02547,s387946237,Wrong Answer,"n = int(input()) +cnt = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if cnt == 3: + print(""Yes"") + exit() + if d1 == d2: + cnt += 1 + else: + cnt = 0 +print(""No"")" +p02547,s559974229,Wrong Answer,"N=int(input()) +L=0 +for i in range(N): + K=set(map(int,input().split())) + if len(K)==1: + L+=1 + else: + L=0 +if L>=3: + print('Yes') +else: + print('No') +" +p02547,s707386112,Wrong Answer,"n=int(input()) +ans=0 +D=[] +for i in range(n): + a,b=map(int, input().split()) + D.append(a) + D.append(b) + + +for i in range(len(D)-1): + if D[i]==D[i+1]: + ans +=1 + +if ans>=3: + print(""Yes"") + +else: + print(""No"")" +p02547,s855293528,Wrong Answer,"count = 0 +for i in range(int(input())): + l = list(map(int, input().split())) + if l[0] == l[1]: + count += 1 + elif l[0] != l[1]: + count = 0 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s167691351,Wrong Answer,"temp = list() +for _ in range(int(input())): + temp.append(tuple(map(int, input().split()))) +i = 0 +con = 0 +bool = True +while i < len(temp): + if con == 3: + bool = False + print('Yes') + break + elif temp[i][0] == temp[i][1]: + con += 1 + i += 1 + else: + con = 0 + i += 1 +if bool: + print('No') +" +p02547,s386451324,Wrong Answer,"n = int(input()) +dlist = [list(map(int,input().split())) for _ in range(n)] + +cnt = 0 +renzoku = 0 +for d in dlist: + if d[0] == d[1]: + cnt+=1 + renzoku += 1 + else: + renzoku = 0 + if cnt == 3 and renzoku == 3: + print('Yes') + break +else: + print('No')" +p02547,s310229834,Wrong Answer,"N = int(input()) + +for _ in range(N): + D = map(int, input().split()) + D = list(D) + if D[0] == D[1]: + print('Yes') + break +else: + print('No')" +p02547,s597204134,Wrong Answer,"n=int(input()) +ans=0 +D=[] +for i in range(n): + a,b=map(int, input().split()) + D.append(a) + D.append(b) + + +for i in range(len(D)-2): + if D[i]==D[i+1] and D[i+1]==D[i+2]: + ans +=1 + +if ans>0: + print(""Yes"") + +else: + print(""No"")" +p02547,s766872231,Wrong Answer,"import itertools + +N = int(input()) +D = [list(map(int, input().split())) for _ in range(N)] + +D_1 = list(itertools.chain.from_iterable(D)) +flag = False +for i in range(len(D_1)-2): + if D_1[i] == D_1[i+1] == D_1[i+2]: + flag = True + + +if flag: + print('Yes') +else: + print('No') +" +p02547,s922465613,Wrong Answer,"n = int(input()) +a = [] +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + a.append(True) + else: + a.append(False) +a.append(False) +a.append(False) +for i in a: + if i == True: + if a[a.index(i)+1] and a[a.index(i)+2]: + print(""Yes"") + exit() +print(""No"")" +p02547,s022990105,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + if count > 0: + count -= 1 + else: + pass +print('Yes' if count >= 3 else 'No') +" +p02547,s520733143,Wrong Answer,"n = int(input()) +x = [list(map(int,input().split())) for i in range(n)] + +count=0 +for i in x: + if count==3: + print(""Yes"") + break + + elif i[0]==i[1]: + count+=1 + else: + count=0 +else: + print(""No"")" +p02547,s198039293,Wrong Answer,"n = int(input()) +flag= True +count = 0 +for i in range(n): + a,b = list(map(int, input().split())) + if a==b: + count += 1 + else: + count= 0 + if count==3: + flag = True +if flag: + print(""yes"") +else: + print(""no"")" +p02547,s593752268,Wrong Answer,"n = int(input()) +d1d2 = [map(int, input().split()) for _ in range(n)] +d1, d2 = [list(i) for i in zip(*d1d2)] +count = 0 +for i in range(n-3): + if d1[i] == d2[i] and d1[i+1] == d2[i+1] and d1[i+2] == d2[i+2]: + count += 1 +if count > 0: + print(""Yes"") +else: + print(""No"")" +p02547,s144301759,Wrong Answer,"t = int(input()) +con = [] +for i in range(t): + a, b = map(int, input().split()) + if a==b: + con.append(1) + else: + con.append(0) + ans =0 +for i in con: + if i ==1: + ans += 1 + else: + ans = 0 +if ans >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s158321586,Wrong Answer,"N = int(input()) +D = [list(map(int, input().split())) for i in range(N)] +for i in range(N-3): + if D[i][0] == D[i][1]: + if D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + print('Yes') + exit() +print('No')" +p02547,s070730484,Wrong Answer,"s = int(input()) +d = [[int(v) for v in input().split()] for i in range(s)] +ans = False +cnt = 0 +for j in range(len(d)): + if cnt == 3: + ans = True + break + if d[j].count(d[j][0]) == len(d[j]): + cnt += 1 + else: + cnt = 0 +if ans: + print (""Yes"") +else: + print(""No"")" +p02547,s971460407,Wrong Answer,"n = int(input()) +ary = [map(int, input().split()) for _ in range(n)] +pair1, pair2 = [list(i) for i in zip(*ary)] +ans = [] +count = 0 +for j in range(n): + if(pair1[j] == pair2[j]): + ans.append(1) + else: ans.append(0) +# [0,1,1,1,0] +for idx in ans: + if(ans[idx] == 1): + count += 1 + if(count == 3): + print('Yes') + break + else: continue + else: + count = 0 + continue + +if(count != 3): + print('No')" +p02547,s039290446,Wrong Answer,"N = int(input()) +x = list(map(int, input().split())) +y = list(map(int, input().split())) +l=list(map(lambda x,y:x-y,x,y)) +ans=0 +for i in range(N-2): + if sum(l[i:i+3])==0: + ans=1 + break +if ans==1: + print(""Yes"") +else: + print(""No"")" +p02547,s520741442,Wrong Answer,"N = int(input()) +D = [] + +ans =0 +for _ in range(N): + N,M=(map(int, input().split())) + if N==M: + ans +=1 + +if ans == N: + print(""Yes"") +else: + print(""No"") +" +p02547,s806357496,Wrong Answer,"n=int(input()) +ans=0 +c=True +d=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + d.append(i) +if len(d)<3: + print(""No"") +else: + for i in range(1,len(d)): + if d[i]-d[i-1]==1: + ans+=1 + if ans>=2: + print(""Yes"") + else: + print(""No"")" +p02547,s824073404,Wrong Answer,"N = int(input()) + +lst=[] +for i in range(N): + lst.append(list(map(int,input().split()))) + +cnt = 0 +for a, b in lst: + if a == b: + cnt += 1 + else: + continue + +if cnt >= 3: + print('Yes') +else: + print('No')" +p02547,s017126258,Wrong Answer,"n=int(input()) +c=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c.append(1) + else: + c.append(0) +for j in range(2,n): + if c[j-2]==c[j-1] and c[j-1]==c[j]: + print(""Yes"") + exit() +print(""No"")" +p02547,s832791350,Wrong Answer,"import random + +x = input() +x = int(x) + +result = [] # 結果を入れるリストを用意 + +for n in range(x): + z=[random.randint(1, 6),random.randint(1, 6)] + if z[0]==z[1]: + r=1 + else: + r=0 + result.append(r) + +y=sum(result) +maped_list = map(str, result) +txt = ''.join(maped_list) + +ans3=txt.count('111') + +if ans3>1: + print(""Yes"") +else: + print(""No"")" +p02547,s684659762,Wrong Answer,"n = int(input()) +flg = False + +res = [] +for i in range(n): + d1, d2 = map(int, input().split()) + res.append(int(d1 == d2)) + +for i in range(n-3): + if (res[i] + res[i+1] + res[i+2]) == 3: + flg = True + break +if flg: + print('Yes') +else: + print('No')" +p02547,s816641549,Wrong Answer,"n=int(input()) + +a = 0 +for i in range(n): + li = input().split() + if(li[0]==li[1]): + print(li[0]) + a+=1 + elif(a<3): + a=0 + else: + print(""Yes"") + exit() +if(a>2): + print(""Yes"") + exit() + +print(""No"")" +p02547,s670002790,Wrong Answer,"loop = int(input()) +streak = 0 +for i in range(loop): + diceArr = input().split() + if streak==3: + print('Yes') + break + else: + if diceArr[0] == diceArr[1]: + streak+=1 + else: + streak=0 +if streak != 3: + print('No') +" +p02547,s094589625,Wrong Answer,"N=int(input()) +z=0 +ans=0 +for i in range(N): + a,b=map(int,input().split()) + if a==b:z+=1 + else:ans=max(ans,z);z=0 +print('Yes'if 2= 3: + print(""Yes"") + exit() + if a == b: + flag += 1 + else: + flag *= 0 +print(""No"")" +p02547,s229413785,Wrong Answer,"N = int(input()) +D = [] +for _ in range(N): + D.extend(input().split()) + +prev_val = '' +count = 0 +for i in D: + if prev_val == i: + count += 1 + if count == 2: + break + else: + prev_val = i + count = 0 + +if count >= 2: + print('Yes') +else: + print('No') +" +p02547,s175347269,Wrong Answer,"n = int(input()) +d1 = [0]*n +d2 = [0]*n +h = 'No' +for i in range(n): + d1[i], d2[i] = map(int, input().split()) + if i > 2: + if d1[i] == d2[i]: + if d1[i-1] == d2[i-1]: + if d1[i-2] == d2[i-2]: + h = 'Yes' +print(h)" +p02547,s350410592,Wrong Answer,"n=int(input()) +c=[] +for i in range(n): + a,b=map(int,input().split()) + if a==b: + c.append(1) + else: + c.append(0) +cnt=0 +for j in range(2,n): + if c[j-2]==c[j-1] and c[j-1]==c[j]: + print(""Yes"") + break + if j==n-1: + print(""No"")" +p02547,s824729558,Wrong Answer,"s=0 +for i in range(int(input())): + a,b=input().split() + if a==b:s+=1 + else:s=0 +if s==3:print('Yes') +else:print('No')" +p02547,s535569318,Wrong Answer,"N = int(input()) + +D = [] +for i in range(N): + D.append(list(map(int,input().split()))) + +for i in range(N-2): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + ans = ""Yes"" + else: + ans = ""No"" +print(ans)" +p02547,s944119054,Wrong Answer,"N=int(input()) +count=0 +lst=[] +for i in range(N): + x,y=map(int,input().split()) + # l=[] + # l.append(x) + # l.append(y) + # lst.append(l) + if x==y: + count+=1 + if x!=y: + break +if count==3: + print(""Yes"") +else: + print(""No"")" +p02547,s677230151,Wrong Answer,"s=int(input()) +d = [list(map(int,input().split())) for _ in range(s)] + +def p(val): + print(val) + +def calc(s,d): + for i in range(s-2): + if d[i][0] == d[i][1] and d[i+1][0]==d[i+1][1] and d[i+2][0] == d[i+1][1]: + + return 'Yes' + + return 'No' + + +p(calc(s,d))" +p02547,s815471435,Wrong Answer,"N = int(input()) + +count = 0 + +for i in range(N): + k, t = map(int, input().split()) + if count == 3: + print ( ""Yes"" ) + + break + + if not k == t: + count *= 0 + if k == t: + count += 1 +if count <= 3: + print (""Yes"") +else: + print (""No"") + +" +p02547,s335689034,Wrong Answer,"n=int(input()) +l=[list(map(int,input().split())) for _ in range(n)] +f=[] +for x in l: + f.append(x[0]==x[1]) +l=f.copy() +i=0 +while i2: + print('Yes') + break + i+=j +else: + print('No') + " +p02547,s657469557,Wrong Answer,"N = int(input()) + +row = 0 +ans = 'No' + +for n in range(N): + D1, D2 = map(int, input().split()) + if D1==D2 and row<3: + row+=1 + elif row==3: + ans='Yes' + else: + row=0 +print(ans) + " +p02547,s115380088,Wrong Answer,"N = int(input()) + +count = 0 + +for i in range(N): + k, t = map(int, input().split()) + if count == 3: + print ( ""yes"" ) + count += 5 + break + + if not k == t: + count *= 0 + if k == t: + count += 1 + + +if not count >= 3: + print (""no"") + +" +p02547,s065595207,Wrong Answer,"N = int(input()) +prev = [False, False, False] +for n in range(N): + if all(prev): + print('Yes') + import sys + sys.exit() + D1, D2 = list(map(int, input().split(' '))) + prev = prev[1:] + [D1 == D2] + +print('No')" +p02547,s150877554,Wrong Answer,"n = int(input()) +ans = ""No"" +count = 0 +for i in range(n): + D1,D2 = map(int,input().split()) + count+=1 if D1==D2 else 0 + ans=""Yes"" if D1 >= 3 else ans + +print(ans)" +p02547,s463190877,Wrong Answer,"n=int(input()) +for i in range(0,n): + count=0 + m,p=input().split() + if(m==p): + count=count+1 +if(count%3==0): + print(""Yes"") +else: + print(""No"") +" +p02547,s841724381,Wrong Answer,"n = int(input()) +c = 0 +for _ in range(n): + r = [int(e) for e in input().split("" "")] + if(c == 3): + print(""Yes"") + break + elif(r[0] == r[1]): + c += 1 + else: + c = 0 +else: + print(""No"") + +" +p02547,s547064154,Wrong Answer,"N = int(input()) +sub_yes = 0 +max_yes = 0 +for i in range(N): + d1,d2 = map(int,input().split()) + if d1 == d2: + sub_yes += 1 + else: + max_yes = sub_yes + sub_yes = 0 + +if sub_yes > max_yes: + max_yes = sub_yes +# print(max_yes) +# print(sub_yes) +if max_yes >= 3: + print(""yes"") +else: + print(""no"")" +p02547,s925986826,Wrong Answer,"N = int(input()) +cnt = 0 +flg = False +for _ in range(N): + a, b = map(int, input().split()) + if a != b: + cnt = 0 + else: + cnt += 1 + flg = True + +if flg: + print('Yes') +else: + print('No')" +p02547,s281349742,Wrong Answer,"n=int(input(""enter n"")) +for i in range(0,n): + count=0 + m,n=input(""Enter a three value: "").split() + if(m==0): + count=count+1 +if(count%3==0): + print(""Yes"") +else: + print(""No"") +" +p02547,s900153233,Wrong Answer,"def divisor(n): + i = 1 + count = 0 + while i * i < n: + if n%i == 0: + count += 2 + i += 1 + if i * i == n: + count =+ 1 + return count + +n = int(input()) + +count = 0 +for num in range(n): + count += divisor(num) +print(count)" +p02547,s156259377,Wrong Answer,"num = int(input()) +ans = 0 +cnt = 0 +for x in range(num): + d1, d2 = map(int, input().split()) + if d1 == d2: cnt += 1 + else: + ans = max(cnt, 2) + cnt = 0 +ans = max(cnt, 2) +if ans >= 3: print(""Yes"") +else: print(""No"")" +p02547,s582941120,Wrong Answer,"import numpy as np +N=int(input()) +div = np.zeros(N+1, np.int64) +for n in range(1, N+1): + for m in range(n, N+1, n): + div[m] += 1 +print(sum(div))" +p02547,s309965969,Wrong Answer,"n = int(input()) +count = 0 +for i in range(n): + a,b = map(int,input().split()) + if a==b: + count += 1 + +print('Yes' if count > 2 else 'No') +" +p02547,s506426991,Wrong Answer,"n = int(input()) +l1 = [] +l2 = [] +for l in range(n): + a,b = map(int,input().split()) + l1.append(a) + l2.append(b) +for i in range(n-3): + if l1[i] == l2[i] and l1[i+1] == l2[i+1] and l1[i+2] == l2[i+2]: + print(""Yes"") + break +else: + print(""No"")" +p02547,s935660353,Wrong Answer,"n = int(input()) +num_list = [] +for i in range(n): + a,b = map(int,input().split()) + num_list.append((a,b)) + +counter = 0 +d = 0 +for x,y in num_list: + if counter == 3: + d += 1 + break + if x == y: + counter += 1 + else: + counter = 0 + +if d == 1: + print(""Yes"") +else: + print(""No"") " +p02547,s600430137,Wrong Answer,"import os,sys +c=0 + +n=input() +for i in range(int(n)): + m=input() + one=m[0] + two=m[2] + if(one==two): + c+=1 + else: + c=0 + +if(c>=3): + print('Yes') +else: + print('No') +" +p02547,s198967681,Wrong Answer,"N = int(input().strip()) + +a = [] +c =0 +f = 0 +for i in range(N): + array = list(map(int, input().strip().split())) + a.append(array) +#print(a[4][1]) +for i in range(N): + if(f == 0 or f == i-1): + if(a[i][0] == a[i][1]): + f=i + c+=1 +if(c >= 3): + print(""Yes"") +else: + print(""No"")" +p02547,s506368876,Wrong Answer,"N = int(input()) +z,w = [],[] +K = 0 +for i in range(N): + x,y = map(int,input().split()) + z.append(x) + w.append(y) +for j in range(1,N-2): + if z[j] == w[j] and z[j+1] == w[j+1] and z[j+2] == w[j+2]: + K += 1 + +if K >= 1: + print(""Yes"") +else: + print(""No"")" +p02547,s513837791,Wrong Answer,"n = int(input()) +D = [list(map(int, input().split())) for _ in range(n)] +ct = 0 +CT = [] +for i in range(n): + if D[i][0] == D[i][1]: + ct += 1 + else: + CT.append(ct) + ct = 0 +for k in CT: + if k >= 3: + print('Yes') + exit() +print(""No"") +" +p02547,s994253873,Wrong Answer,"N = int(input()) +count = 0 +temp = 0 + +for _ in range(N): + d1, d2 = map(int, input().split()) + if d1 == d2: + count += 1 + else: + if temp < count: + temp = count + + count = 0 + +if temp >= 3: + print('Yes') +else: + print('No') +" +p02547,s651857949,Wrong Answer,"N = int(input()) +x = [0] * N +y = [0] * N +for i in range(N): + x[i], y[i] = map(int, input().split()) + + + +n = 0 +for i in range(N-1): + if x[i] == y[i]: + n = n+1 + elif n >=3: + break + elif x[i] != y[i]: + n = 0 + +if n >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s409614156,Wrong Answer,"N = int(input()) +ct = 0 +for i in range(N): + s,g = map(int,input().split()) + if s == g: + ct += 1 + else: + ct = 0 + if ct == 3: + print(""yes"") + break +else: + print(""No"")" +p02547,s643308285,Wrong Answer,print('NYoe s'[[*'000']in[eval(t.replace(*' -'))for t in open(0)]::2]) +p02547,s834351922,Wrong Answer,"n = int(input()) + +def judge(): + count = 0 + flag = True + for _ in range(n): + d1, d2 = map(int, input().split("" "")) + if d1 == d2: + count += 1 + else: + count = 0 + + + if count == 3: + flag = True + break + else: + flag = False + return flag + +if judge() == True: + print(""yes"") +else: + print(""no"") +" +p02547,s457733098,Wrong Answer,"ctr = 0 +for _ in range(int(input())): + a, b = list(map(int, input().strip().split())) + if a == b: + ctr += 1 + else: + ctr = 0 + +print((""No"", ""Yes"")[ctr >= 3])" +p02547,s627080432,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N): + D1,D2 = map(int,input().split()) + if count == 3: + print('Yes') + exit() + elif D1 == D2: + count += 1 + else: + count = 0 + +print('No')" +p02547,s860139973,Wrong Answer,"N = int(input()) +D = [] +for i in range(N): + a = list(map(int,input().split())) + D.append(a[0]) + D.append(a[1]) +tf = 0 +for i in range(2*N - 2): + if D[i] == D[i+1] == D[i+2]: + tf = 1 +if tf == 1: + print(""Yes"") +else: + print(""No"") + " +p02547,s910679336,Wrong Answer,"t = int(input()) +ans = 0 +con = 0 +for i in range(t): + a, b = map(int, input().split()) + if a==b: + ans += 1 + con += 1 + if con >= 3: + a = ""Yes"" + break + else: + a = ""No"" + else: + con = 0 +print(a)" +p02547,s364985485,Wrong Answer,"import os,sys +c=0 + +n=input() +for i in range(int(n)): + m=input() + one=m[0] + two=m[2] + if(one==two): + c+=1 + +if(c>=3): + print('Yes') +else: + print('No') +" +p02547,s457670733,Wrong Answer,"iterate = int(input()) +cnt = 0 +for i in range(iterate): + dice = list(map(lambda x: int(x), input().split())) + if dice[0]==dice[1]: + cnt += 1 + if dice[0]!=dice[1]: cnt=0 + if cnt==3: break + +if cnt!=0: print(""Yes"") +else: print(""No"")" +p02547,s318315226,Wrong Answer,"N =int(input()) +D = [] +for i in range(N): + d_1,d_2 = map(int,input().split()) + D.append([d_1,d_2]) +for x in range(N-2): + if D[x][0]==D[x][1] and D[x+1][1]==D[x+1][0] and D[x+2][1]==D[x+2][0]: + print(""Yes"") + break + else: + print(""No"") +" +p02547,s370518243,Wrong Answer,"N = int(input()) + +cnt = 0 +judge = False + +for _ in range(N): + if cnt == 3: + judge = True + + D1, D2 = map(int, input().split()) + if D1 == D2: + cnt += 1 + else: + cnt = 0 + + +if judge: + print('Yes') +else: + print('No')" +p02547,s993735277,Wrong Answer,"N=int(input()) +count=0 +lst=[] +for i in range(N): + x,y=map(int,input().split()) + # l=[] + # l.append(x) + # l.append(y) + # lst.append(l) + if x==y: + count+=1 + if x!=y: + continue + count=0 +if count==3: + print(""Yes"") +else: + print(""No"")" +p02547,s003233384,Wrong Answer,"n = int(input()) +str_list = [list(input().split()) for _ in range(n)] +for i in range(n-2): + if str_list[i][0] == str_list[i][1] and str_list[i+1][0] == str_list[i+1][1] and str_list[i+2][0] == str_list[i+2][1]: + break + print('Yes') +else: + print('No')" +p02547,s812922404,Wrong Answer,"N = int(input()) +S = [] +judge = 0 +for i in range(N): + S += [input().split()] +for i in range(N): + if i < N-i: + if S[i][0] == S[i][1]: + if S[i+1][0] == S[i+1][1]: + if S[i+2][0] == S[i+2][1]: + print(""Yes"") + judge = 1 + break +if judge == 0: + print(""No"")" +p02547,s617312332,Wrong Answer,"data=[] +for _ in range(int(input())): + d1,d2=input().split() + d1=int(d1) + d2=int(d2) + if d1==d2: + data.append(1) +longest = 0 +current = 0 +for num in data: + if num == 1: + current += 1 + else: + longest = max(longest, current) + current = 0 + +if max(longest, current)>=3: + print('Yes') +else: + print('No')" +p02547,s197451464,Wrong Answer,"N = int(input()) + +d1=[] +d2=[] + +cont=0 +for i in range(N): + D1,D2=map(int,input().split()) + + d1.append(D1) + d2.append(D2) + +for i in range(len(d1)): + if d1[i]==d2[i]: + cont+=1 + +if cont>=3: + print(""Yes"") +else: + print(""No"") + + " +p02547,s735704441,Wrong Answer,"loop = int(input()) +streak = 0 +for i in range(loop): + diceArr = input().split() + if streak==3: + print('Yes') + SystemExit + else: + if diceArr[0] == diceArr[1]: + streak+=1 + else: + streak=0 +if streak != 3: + print('No') +" +p02547,s023677207,Wrong Answer,"N=int(input()) +D={} +for i in range(N): + D[i]=input().split() + +cou=0 +for i in range(N): + if D[i][0]==D[i][1]: + cou+=1 + +if cou >= 3: + print('Yes') +else: + print('No')" +p02547,s854764525,Wrong Answer,"n = int(input()) +zoro = 0 + +for i in range(n): + d1, d2 = map(int, input().split()) + if d1 == d2: + zoro += 1 + else: + zoro = 0 + +if zoro >= 3: + print('Yes') +else: + print('No')" +p02547,s179096335,Wrong Answer,"n = int(input()) +a = [[int(i) for i in input().split()] for j in range(n)] +good = False +for i in range(n-3): + ok = True + for j in range(i, i+3): + ok &= a[i][0] == a[i][1] + good |= ok +print(""Yes"" if good else ""No"")" +p02547,s018955232,Wrong Answer,"N = int(input()) + +xy = [map(int,input().split()) for _ in range(N)] +x,y = [list(i) for i in zip(*xy)] + +ans = 0 + +for i in range(N): + if x[i] == y[i]: + ans +=1 + else: + ans = 0 + +if ans >= 3: + print(""Yes"") + +else: + print(""No"")" +p02547,s793762102,Wrong Answer,"import io,sys +def main(): + n = int(input()) + D = [] + for _ in range(n): + a,b = map(int,input().split()) + D.append(a-b) + + for i in range(n-3): + if D[i]==0 and D[i+1]==0 and D[i+2]==0: + print(""Yes"") + sys.exit() + + print(""No"") +main()" +p02547,s722929923,Wrong Answer,"N = int(input()) +count = 0 +count_max = count +for i in range(N): + di_1, di_2 = [int(i) for i in input().split()] + if di_1 == di_2: + count += 1 + else: + count_max = max([count_max, count]) + count = 0 +if count_max >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s290055711,Wrong Answer,"n = int(input()) +d = [list(map(int, input().split())) for _ in range(n)] + +for i in range(n - 3): + if all([d[i + j][0] == d[i + j][1] for j in range(3)]): + print('Yes') + exit() + +print('No') +" +p02547,s852897122,Wrong Answer,"n = int(input()) +ans = 0 +f1, f2, f3 = 0, 0, 0 +for i in range(n): + f3 = f2 + f2 = f1 + d1, d2 = map(int, input().split()) + f1 = d1 == d2 + if f1 == f2 == f3: + ans = 1 +print('Yes' if ans else 'No')" +p02547,s859834072,Wrong Answer,"n = int(input()) + +pv = [] +con = 0 + +while n > 0: + n -= 1 + s = str(input()) + d = s.split() + if d[0] == d[1]: + con += 1 + else: + pv += [con] + con = 0 + +pv += [con] +ans = max(pv) + +if int(ans) >= 3: + print('Yes') +else: + print('NO')" +p02547,s021950159,Wrong Answer,"n = int(input()) +cnt = 0 +for i in range(n): + if cnt == 3: + print('Yes') + exit() + x,y =map(int,input().split()) + if x == y: + cnt +=1 + else: + cnt = 0 +print('No')" +p02547,s562676173,Wrong Answer,"cnt = 0 +n = int(input()) +for i in range(0,n): + d1, d2 = map(int, input().split()) + if d1 == d2: + cnt += 1 + if cnt == 3 : + print(""Yes"") + break + else: + cnt == 0 + + if i == n-1: + print(""No"")" +p02547,s180535263,Wrong Answer,"N = int(input()) +num = 0 +for i in range(N): + D = list(map(int, input().split(' '))) + if D[0] == D[1]: + num += 1 + else: + num = 0 + +if num >= 3: + print('Yes') +else: + print('No') +" +p02547,s029926450,Wrong Answer,"def solution(): + N = int(input()) + xy = [map(int, input().split()) for _ in range(N)] + x, y = [list(i) for i in zip(*xy)] + + cnt = 0 + for i in range(N): + print (x[i], y[i]) + if cnt >= 3: + return 'Yes' + if x[i] == y[i]: + cnt += 1 + else: + cnt = 0 + return 'No' + +print (solution())" +p02547,s548593113,Wrong Answer,"N = int(input().strip()) + + + +a = [] +c = [] +f = 0 + +for i in range(N): + array = list(map(int, input().strip().split())) + a.append(array) + + +for i in range(N): + if(f == 0 or f == i-1): + if(a[i][0] == a[i][1]): + f=i + c.append(1) + else: + f=0 + + +if(len(c) >= 3): + print(""Yes"") +else: + print(""No"")" +p02547,s018640870,Wrong Answer,"# -*- coding: utf-8 -*- +# 入力 +N = int(input()) + +l = [] +for i in range(N): + d1, d2 = map(int, input().split()) + l.append([d1, d2]) +print(l) + +flag = 0 +cont = 0 +for i in l: + if(i[0]==i[1]): + flag = 1 + cont = cont + 1 + print(cont) + if (cont>=3): + break + else: + cont = 0 + flag =0 + + + +if (cont >=3): + print(""Yes"") +else: + print(""No"") +" +p02547,s417281885,Wrong Answer,"n = int(input()) +if n>=3: + count = 0 + for i in range(n): + d = list(map(int, input().split("" ""))) + if d[0]== d[1]: count+=1 + if count >= 3: print(""yes"") + else: print(""no"") +else: pass + " +p02547,s389184358,Wrong Answer,"n = int(input()) +D = [] * n + +for i in range(n): + D.append(list(map(int, input().split()))) + +ans = 'No' + +for i in range(0, n-3): + if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]: + ans = 'Yes' + break + +print(ans)" +p02547,s067570652,Wrong Answer,"N=int(input()) +x = [list(map(int, input().split())) for i in range(N)] +A=""NO"" +for n in range(N-2): + if x[n][0]==x[n][1] and x[n+1][0]==x[n+1][1] and x[n+2][0]==x[n+2][1]: + A=""YES"" + break +print(A)" +p02547,s538974585,Wrong Answer,"def judge(): + count = 0 + for _ in range(n): + d1, d2 = map(int, input().split("" "")) + if d1 == d2: + count += 1 + else: + count = 0 + + if count == 3: + return True + + return False + +n = int(input()) + +if judge(): + print(""yes"") +else: + print(""no"")" +p02547,s246786115,Wrong Answer,"x=int(input()) +l=[] +c=0 +for i in range(x): + a,b = map(int,input().split()) + l.append(a) + l.append(b) +for i in range(0,x*2,2): + if l[i]==l[i+1]: + c+=1 + + if c>=3: + print(""YES"") + break + + else: + c=0 +if c<3: + print(""NO"")" +p02547,s044642806,Wrong Answer,"N=int(input()) #縦2列 +XY=[map(int, input().split()) for _ in range(N)] +X,Y=[list(i) for i in zip(*XY)] +ans=""no"" + +for j in range(0,N-2): + if X[j]==Y[j] and X[j+1]==Y[j+1] and X[j+2]==Y[j+2]: + ans=""Yes"" + break + +print(ans)" +p02547,s731936402,Wrong Answer,"N = int(input()) +x=[0]*N +y=[0]*N +L=[0]*N + +flag = ""No"" + +for i in range(N): + x[i],y[i] = map(int, input().split()) + +for i in range(N): + if x[i]==y[i]: + L[i]=1 + +#print(L) + +for i in range (N-2): + #print(i) + if L[i] == L[i+1] == L[i+2]: + flag = ""Yes"" + +print(flag) + " +p02547,s566279152,Wrong Answer,"N = int(input()) +cnt = [] +for i in range(N): + a, b = map(int, input().split()) + if a == b: + cnt.append(1) + else: + cnt.append(0) +from itertools import groupby +for key, group in groupby(cnt): + if len(list(group)) >= 3: + print('Yes') + exit() +print('No') +" +p02547,s722701210,Wrong Answer,"n = int(input()) +count=0 +flg=0 + +for num in range(n): + d1,d2 = map(int,input().split()) + if d1 == d2: + count += 1 + if count>= 3: + flg = 1 + + else: + count=0 +else: + if count > 3 | flg >0: + print(""Yes"") + else: + print(""No"") + " +p02547,s647104031,Wrong Answer,"n=int(input()) +s=0 +for i in range(n): + lis=input().split() + if lis[0]==lis[1]: + s+=1 + else: + s=0 +if s>=3: + print(""Yes"") +else: + print(""No"")" +p02547,s024535736,Wrong Answer,"n = int(input()) +num_list = [] +for i in range(n): + a,b = map(int,input().split()) + num_list.append((a,b)) + +counter = 0 +d = 0 +for x,y in num_list: + if counter == 3: + d += 1 + break + elif x == y: + counter += 1 + else: + counter = 0 + +if d == 1: + print(""Yes"") +else: + print(""No"") " +p02547,s200786558,Wrong Answer,"x=int(input()) +count=0 +for a in range(x): + b=input().split(' ') + if int(b[0])==int(b[1]): + count+=1 + else: + count=0 + if count==3: + break +if count==3: + print('yes') +else: + print('no')" +p02547,s801741392,Wrong Answer,"N = int(input()) + + +max = 0 +stock = 0 +for i in range(N): + a,b = map(int, input().split()) + if a == b: + stock += 1 + max = stock + else: + max = stock + stock = 0 + +print('Yes' if (max > 2) else ""No"") +" +p02547,s127962318,Wrong Answer,"N = int(input("""")) +count = 0 +for i in range(N): + D = (input("""")) + l = D.split() + l_i = [int(s) for s in l] + if l_i[0] == l_i[1]: + count += 1 + else: + pass +if count >= 3: + print(""Yes"") +else: + print(""No"") +" +p02547,s243285171,Wrong Answer,"n=int(input()) +ans=0 +for _ in range(n): + a,b=map(int,input().split()) + if a==b: + ans+=1 + if ans==3: + break + else: + n=0 +if ans==3: + print(""Yes"") +else: + print(""No"")" +p02547,s514103790,Wrong Answer,"N = int(input()) +D = [input() for i in range(N)] +count = 0 +OK = 0 +for ite in D: + + + a,b = map(int,ite.split()) + + if a == b: + count += 1 + if count >=3: + OK = 1 + print('Yes') + + else: + pass + + else: + count = 0 +if OK == 0: + print('No') + +" +p02547,s163173417,Wrong Answer,"N = int(input()) + +Ds = [list(map(int, input().split())) for i in range(N)] +count = 0 + +for D in Ds: + if D[0] == D[1]: + count += 1 + +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s981987005,Wrong Answer,"N = int(input()) +num_list = [] +for i in range(N): + num_list.append(list(map(int,input().split()))) + +for j in range(N-2): + if num_list[j][0] == num_list[j][1] and num_list[j+1][0] == num_list[j+1][1] and num_list[j+2][0] == num_list[j+2][1]: + print (""Yes"") + break + elif j != N-3 and num_list[j][0] != num_list[j][1] or num_list[j+1][0] != num_list[j+1][1] or num_list[j+2][0] != num_list[j+2][1]: + continue + else: + print(""No"") + +" +p02547,s518846827,Wrong Answer,"n = int(input()) +d = [] +for i in range(n): + x = list(map(int, input().split())) + d.append(x) + +d2 = [] +ans = ""No"" + +for i in range(n): + for j in range(2): + d2.append(d[i][j]) + +print(d2) + +for i in range(0, len(d2)-2): + if d2[i] == d2[i+1] and d2[i] == d2[i+2]: + ans = ""Yes"" + break + +print(ans)" +p02547,s637238639,Wrong Answer,"n = int(input()) +cnt = 0 +flg = False +for i in range(n): + d1, d2 = map(int, input().split()) + if cnt == 3: + flg = True + if cnt > 0: + if d1 == d2: + cnt += 1 + else: + cnt = 0 + if cnt == 0: + if d1 == d2: + cnt += 1 + else: + pass + +if flg: + print('Yes') +else: + print('No')" +p02547,s236070123,Wrong Answer,"n=int(input()) +count=0 +for i in range(n): + me1,me2=list(map(int,input().split())) + if me1==me2: + count+=1 + if count==3: + break + else: + count=0 +if count>=n: + print('Yes') +else: + print('No')" +p02547,s815250925,Wrong Answer,"N = int(input()) +D = [input() for i in range(N)] + +for i in range(3,N): + if (D[i][0] == D[i][-1]) \ + and (D[i-1][0] == D[i-1][-1]) \ + and (D[i-2][0] == D[i-2][-1]): + print('Yes') + break + if i == N-1: + print('No')" +p02547,s832852891,Wrong Answer,"N = int(input()) +count = 0 +for i in range(N): + di_1, di_2 = [int(i) for i in input().split()] + if di_1 == di_2: + count += 1 + else: + count = 0 +if count >= 3: + print(""Yes"") +else: + print(""No"")" +p02547,s977832485,Wrong Answer,"n = int(input()) +l = [list(map(int, input().split())) for i in range(n)] +#print(l[0][0]) +#print(l[0][1]) +ans = n-2 +ans1 = 0 + +for m in range(ans): + if l[m][0] == l[m][1] and l[m+1][0] == l[m+1][1] and l[m+2][0] == l[m+2][1]: + ans1 += 1 + else: + ans1 = 0 + + +if ans1 >= 1: + print(""Yes"") +else: + print(""No"")" +p02547,s174615765,Wrong Answer,"N=int(input()) +D=list() +for i in range(N): + tmp=list(map(int,input().split())) + D.append(tmp[0]==tmp[1]) +for i in range(N-3): + if D[i]==D[i+1]==D[i+2]==True: + print(""Yes"") + break +else: + print(""No"")" +p02547,s764807824,Wrong Answer,"N = int(input("""")) +count = 0 +for i in range(N): + D = (input("""")) + l = D.split() + a = int(l[0]) + b = int(l[1]) + if a == b: + count += 1 +if count > 2: + print(""Yes"") +else: + print(""No"")" +p02547,s283943904,Wrong Answer,"N=int(input()) +cnt=0 + +for i in range(N): + if cnt==3: + print('Yes') + break + D_1,D_2=map(int,input().split()) + if D_1==D_2: + cnt+=1 + else: + cnt=0 +else: + print('No')" +p02547,s318387336,Wrong Answer,"n=int(input()) +l=[] +for _ in range(n): + s=input().split() + l.append([int(s[0]),int(s[1])]) +flag=0 +for i in range(3,n): + if l[i][0]==l[i][1] and l[i-1][0]==l[i-1][1] and l[i-2][0]==l[i-2][1]: + flag=1 + break +if flag: + print(""Yes"") +else: + print(""No"")" +p02547,s725091707,Wrong Answer,"n = int(input()) +d = [] + +for i in range(n) : + input_line = list(map(int, input().split("" ""))) + d.append(input_line) + +count = 0 +answer = ""no"" +for i in range(n) : + if d[i][0] == d[i][1] : + count += 1 + if count > 1 : + answer = ""yes"" + else : + count = 0 + +if answer == ""yes"" : + print(""Yes"") +else : + print(""No"") +" +p02547,s279094261,Wrong Answer,"n=int(input()) +xy = [map(int, input().split()) for _ in range(n)] +x, y = [list(i) for i in zip(*xy)] +ans='' +for i in range(n-2): + if x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]: + ans='Yes' + else: + ans='No' +print(ans)" +p02547,s487058707,Wrong Answer,"import random + +x = int(input()) + +result = [] +for n in range(x): + z=[random.randint(1, 6),random.randint(1, 6)] + if z[0]==z[1]: + r=""1"" + else: + r=""0"" + result.append(r) + +if ""111"" in """".join(result):print('Yes') +else:print('No')" +p02547,s242696408,Wrong Answer,"n = int(input()) +numList = [] +for x in range(n): + num = [int(x) for x in input().split()] + if num[0] == num[1]: + numList.append('True') + else: + numList.append('False') + + +judge = 'No' +for x in range(len(numList)-3): + if numList[x] == 'True': + if numList[x+1] == 'True': + if numList[x+2] == 'True': + judge = 'Yes' +print(judge) + +" +p02553,s978858426,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*c,a*d,b*d))" +p02553,s702443072,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s661480038,Accepted,"#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import sys + + +def get_ints(): + return map(int, sys.stdin.readline().strip().split()) + + +def main(): + a, b, c, d = get_ints() + + print(max(a*c, a*d, b*c, b*d)) + + +if __name__ == ""__main__"": + main() +" +p02553,s709642550,Accepted,"a, b, c, d = map(int, input().split()) + +ans = b*d +ans = max(ans, a*d) +ans = max(ans, b*c) +ans = max(ans, a*c) + +print(ans)" +p02553,s783446282,Accepted,"a, b, c, d = map(int, input().split()) + +A = a*c +B = a*d +C = b*c +D = b*d + + +print(max([A, B, C, D]))" +p02553,s891436167,Accepted,"a, b, c, d = list(map(int,input().split())) +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s792347336,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s256935079,Accepted,"a, b, c, d = map(int, input().split()) + +ans = max(a*c, a*d, b*c, b*d) +print(ans)" +p02553,s508554771,Accepted,"a, b, c, d = map(int, input().split()) +rst = max(a*c, b*d, b*c, a*d) +print(rst)" +p02553,s846759016,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s457732849,Accepted,"a, b, c, d = map(int, input().split()) + +ans = [a*c, a*d, b*c, b*d] +print(max(ans)) +" +p02553,s955933662,Accepted,"a, b, c, d = (int(i) for i in input().split()) +if a > 0: + if d > 0: + print(max(a*c, a*d, b*c, b*d)) + else: + print(max(a*c, a*d, b*c, b*d)) +else: + if d > 0: + print(max(a*c, a*d, b*c, b*d)) + else: + print(max(a*c, a*d, b*c, b*d)) +" +p02553,s208204025,Accepted,"a,b,c,d = [int(x) for x in input().split()] + + +print(max(a*c,a*d,b*c,b*d))" +p02553,s928300994,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s298590096,Accepted,"A, B, C, D = map(int, input().split()) +if A <= 0 <= B or C <= 0 <= D: + x = 0 +else: + x = -float('inf') + +print(max(A * C, B * D, A * D, B * C, x)) +" +p02553,s480271009,Accepted,"a, b, c, d = map(int, input().split()) + +if b < 0: + if c <= 0: + print(a * c) + else: + print(b * c) + +elif a <= 0: + if d < 0: + print(a*c) + elif a <= 0: + print(max(a*c, b*d)) + else: + print(b*d) + +else: + if d < 0: + print(a * d) + else: + print(b * d)" +p02553,s416932653,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s464276137,Accepted,"a,b,c,d=map(int,input().split()) +ans = -10000000000000000000 +ans = max( ans, a*c) +ans = max( ans, a*d) +ans = max( ans, b*c) +ans = max( ans, b*d) +print(ans) +" +p02553,s641257795,Accepted,"a,b,c,d = map(int,input().split()) +A = set() +B = set() +A.add(a) +A.add(b) +B.add(c) +B.add(d) +for i in {-1,0,1}: + A.add(i) + B.add(i) + +o = set() +for j in A: + for k in B: + if a <= j <= b and c <= k <= d: + o.add(j*k) +print(max(o))" +p02553,s586838944,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s234960147,Accepted,"a,b,c,d=list(map(int,input().split())) + +m = max(a*c, b*d) +m = max(m, a*d) +m = max(m, b*c) + +print(m) +" +p02553,s595206875,Accepted,"#!/usr/bin/env python3 + +from typing import * + + + +# def solve(a: int, b: int, c: int, d: int) -> int: +def solve(a, b, c, d): + ans=[a*c, a*d, b*c, b*d] + return max(ans) + +def main(): + a, b, c, d = map(int, input().split()) + a1 = solve(a, b, c, d) + print(a1) + +if __name__ == '__main__': + main() +" +p02553,s960154563,Accepted,"def main(): + a, b, c, d = list(map(int, input().split())) + return max(a * c, b * d, a * d, b * c) + + +# print('Yes' if main() else 'No') +print(main()) +" +p02553,s003669401,Accepted,"a, b, c, d = map(int, input().split()) + +x = max(a * c, a * d) +y = max(b * c, b * d) +z = max(x, y) + +print(z) +" +p02553,s272930664,Accepted,"a,b,c,d=map(int,input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s982814976,Accepted,"# -*- coding: utf-8 -*- + +a,b,c,d = map(int, input().split()) + +res1 = a * c +res2 = a * d +res3 = b * c +res4 = b * d +ans = max(res1, res2, res3, res4) +print(ans)" +p02553,s306537816,Accepted,"a, b, c, d = [int(_) for _ in input().split()] +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s007844442,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s064652520,Accepted,"input_arr = input().split("" "") +a = int(input_arr[0]) +b = int(input_arr[1]) +c = int(input_arr[2]) +d = int(input_arr[3]) + +AC = a * c +AD = a * d +BC = b * c +BD = b * d + +l = [AC, AD, BC, BD] +print(max(l))" +p02553,s851725957,Accepted,"#!/usr/bin/env python3 +def main(): + a, b, c, d = map(int, input().split()) + + ans = -10 ** 20 + for x in [a, b]: + for y in [c, d]: + ans = max(ans, x * y) + print(ans) + + +if __name__ == '__main__': + main() +" +p02553,s928582291,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s067684646,Accepted,"a, b, c, d = map(int, input(). split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s600666560,Accepted,"a, b, c, d = map(int, input().split()) +answer = max(a*c, a*d, b*c, b*d) +print(answer)" +p02553,s912248565,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s445833418,Accepted,"a,b,c,d = map(int, input().split()) + +print(max( + a*c, + a*d, + b*c, + b*d +))" +p02553,s360428371,Accepted,"a,b,c,d = map(int, input().split()) + +ans = max(a*c,a*d, b*c,b*d) +print(ans)" +p02553,s809481210,Accepted,"a,b,c,d = map(int, input().split()) +l = [a*c, a*d, b*c, b*d] +print(max(l))" +p02553,s715434272,Accepted,"a, b, c, d = [int(i) for i in input().split()] +nums = [a, b, c, d] + +if a < 0 and b < 0 and 0 < c and 0 < d: + print(b * c) + exit(0) +if c < 0 and d < 0 and 0 < a and 0 < b: + print(d * a) + exit(0) + + +minus_num = len([i for i in nums if i < 0]) +if minus_num == 4: + print(a * c) + exit(0) +if minus_num == 1 or minus_num == 0: + print(b * d) + exit(0) + +if a * c < b * d: + print(b * d) +else: + print(a * c)" +p02553,s666954902,Accepted,"n = list(map(int, input().split())) +n_max = n[0] * n[2] +for i in range(0, 2): + for j in range(2, 4): + if n_max < n[i] * n[j]: + n_max = n[i] * n[j] +print(n_max)" +p02553,s950836978,Accepted,"a, b, c, d = map(int, input().split()) +print(max([a*c, a*d, b*c, b*d]))" +p02553,s396751582,Accepted,"def li(): + return [int(x) for x in input().split()] + + +a, b, c, d = li() + +ans = max(a * c, a * d, b * c, b * d) +print(ans)" +p02553,s726726682,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s652300125,Accepted,"a,b,c,d = tuple(map(int, input().split("" ""))) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s932562796,Accepted,"a, b, c, d = map(int, input().split()) + +result = -10**18 +for x in [a, b]: + for y in [c, d]: + result = max(x * y, result) +print(result) +" +p02553,s378900185,Accepted,"import numpy as np + +a, b, c, d = map(int, input().split()) +x = np.array([a, b]) +y = np.array([c, d]) +z = np.outer(x, y) +print(z.max())" +p02553,s193831956,Accepted,"#B +a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s033237885,Accepted,"a,b,c,d = list(map(int,input().split())) +max = a*c +if a*d>max: + max = a*d +if b*c>max: + max = b*c +if b*d>max: + max = b*d + +print(max)" +p02553,s497760789,Accepted,"a,b,c,d=[int(x) for x in input().split()] +ans=max(a*c,b*d) +if a<0 and b<0: + cc=a + a=b + b=cc + +if c<0 and d<0: + cc=c + c=d + d=cc + +print(max(a*c,b*d,ans))" +p02553,s793824168,Accepted,"#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +def main(): + A, B, C, D = map(int, input().split()) + ans = -10**9**2 + + for ab in (A, B): + for cd in (C, D): + if ab * cd > ans: + ans = ab * cd + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p02553,s422947521,Accepted,"a,b,c,d = (int(x) for x in input().split()) + +ac = a * c +ad = a * d +bc = b * c +bd = b * d + +print(max([ac,ad,bc,bd]))" +p02553,s364490924,Accepted,"a, b, c, d = [int(s) for s in input().split("" "")] +ans1 = a * c +ans2 = b * d +ans3 = a * d +ans4 = b * c +print(""%d"" % max([ans1, ans2, ans3, ans4]))" +p02553,s823031675,Accepted,"a,b,c,d=map(int,input().split()) +x=max(a*c,a*d,b*c,b*d) +if (b<0 and 00) or (a>0 and d<0): + ans=max(list1) +else: + list1.append(0) + ans=max(list1) +print(ans)" +p02553,s419605770,Accepted,"a, b, c, d = map(int, input().split()) +lst = [a * c, a * d, b * c, b * d] +print(max(lst))" +p02553,s306771694,Accepted,"def main(): + a, b, c, d = map(int, input().split()) + if b * d > 0 or a * c > 0: + x = max(b * d, a * c) + else: + x = max(a * d, b * c) + print(x) + return + +if __name__ == '__main__': + main()" +p02553,s638295318,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s461462214,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*d, b*c, b*d, a*c)) +" +p02553,s663161820,Accepted,"s = input() +nums = s.split() +a = int(nums[0]) +b = int(nums[1]) +c = int(nums[2]) +d = int(nums[3]) +print(max(a*c,a*d,b*c,b*d))" +p02553,s903874612,Accepted,"def resolve(): + a, b, c, d = map(int, input().split()) + w = a*c + x = a*d + y = b*c + z = b*d + ans = max(w, x, y, z) + print(ans) + +resolve()" +p02553,s559206509,Accepted,"a, b, c, d = map(int, input().split()) + +ans = [a * c, a * d, b * c, b * d] +print(max(ans)) +" +p02553,s652156660,Accepted,"a,b,c,d = list(map(lambda x: int(x), input().split())) +ac, bc, bd, ad = a*c, b*c, b*d, a*d + +e1 = ac if ac >= bc else bc +e2 = bd if bd >= ad else ad +ans = e1 if e1 >= e2 else e2 +print(ans)" +p02553,s608276860,Accepted,"#Python Template + +from sys import stdin, stdout + +def main(): + a, b, c, d = [int(i) for i in stdin.readline().split()] + ans = max(a*c, a*d, b*c, b*d) + print(ans) + +main()" +p02553,s693255823,Accepted,"import math + +def a(): + x = int(input()) + if x == 0: + print(1) + else: + print(0) + + +def b(): + a,b,c,d = map(int,input().split()) + m=[a*c,a*d,b*c,b*d] + print(max(m)) + + + +def c(): + pass + + + +def d(): + pass + + +# a() +b() +# c() +# d()" +p02553,s431301157,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s468411672,Accepted,"N = input() +num = N.split(' ') +a = int(num[0]) +b = int(num[1]) +c = int(num[2]) +d = int(num[3]) + +e = a * c +f = a * d +g = b * c +h = b * d +num_max = max([e, f, g, h]) +print(num_max)" +p02553,s202438320,Accepted,"a,b,c,d = map(int, input().split("" "")) +maxi = max([a*c, a*d, b*c, b*d]) +print(maxi)" +p02553,s181757836,Accepted,"import numpy as np +a, b, c, d = map(int, input().split()) + +hoge = [] +hoge.append(a*c) +hoge.append(a*d) +hoge.append(b*c) +hoge.append(b*d) + +print(max(hoge))" +p02553,s025968424,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s782628839,Accepted,"str = input().split() +a,b,c,d = [int(i) for i in str] + +ans_list = [a * c, a * d, b * c, b * d] + +print(max(ans_list))" +p02553,s482915102,Accepted,"import sys + +def solve(): + A, B, C, D = [int(i) for i in input().split()] + ans = sys.maxsize * -1 + X = [0, A, B] if A <= 0 <= B else [A, B] + Y = [0, C, D] if A <= 0 <= B else [C, D] + for x in X: + for y in Y: + ans = max(ans, x * y) + print(ans) + +if __name__ == ""__main__"": + solve() +" +p02553,s011887632,Accepted,"a, b, c, d = map(int, input().split()) +e = a * c +f = a * d +g = b * c +h = b * d +print(max(e, f, g, h))" +p02553,s604355250,Accepted,"import sys +def input(): return sys.stdin.readline().rstrip() +def main(): + a, b, c, d = map(int,input().split()) + print(max(a*c,a*d,b*c,b*d)) + +if __name__=='__main__': + main()" +p02553,s131992001,Accepted,"a, b, c, d = list(map(int, input().split())) +print(max(a*c, b*c, a*d, b*d))" +p02553,s738028306,Accepted,"a,b,c,d = map(int,input().split()) +ac = a*c +bc = b*c +ad = a*d +bd = b*d +print(max([ac,bc,ad,bd]))" +p02553,s914922084,Accepted,"a, b, c, d = map(int, input().split()) +ans = max(a*c , a*d, b*c, b*d) +print(ans)" +p02553,s498753789,Accepted,"a, b, c, d = map(int, input().split()) +x = [a, min(a+1, b), max(a, b-1), b] +y = [c, min(c+1, d), max(c, d-1), d] + +ans = -int(1e19) +for i in x: + for j in y: + ans = max(ans, i*j) +print(ans)" +p02553,s116723788,Accepted,"a,b,c,d=map(int,input().split()) +A=a*c +B=a*d +C=b*c +D=b*d +N=[A,B,C,D] +print(max(N))" +p02553,s333694809,Accepted,"a,b,c,d=map(int,input().split()) +x=max(a*c,b*d) +y=max(a*d,b*c) +print(max(x,y))" +p02553,s498472033,Accepted,"a, b, c, d =map(int, input().split()) + +print(max(a*c,a*d,b*c,b*d)) +" +p02553,s199424813,Accepted,"a,b,c,d = map(int,input().split()) +x = [a , b] +y = [c , d] +m = a*c +for i in x: + for j in y: + if i*j > m: + m = i*j +print(m) " +p02553,s157366145,Accepted,"import sys +import itertools +# import numpy as np +import time +import math +from heapq import heappop, heappush +from collections import defaultdict +from collections import Counter +from collections import deque +from itertools import permutations +sys.setrecursionlimit(10 ** 7) + +INF = 10 ** 18 +MOD = 10 ** 9 + 7 +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +# map(int, input().split()) +a, b, c, d = map(int, input().split()) + +ans = -INF +for x in [a, b]: + for y in [c,d]: + ans = max(ans, x * y) +print(ans) +" +p02553,s045073665,Accepted,"# 2020/09/13 +# AtCoder Beginner Contest 178 - B + +# Input +a, b, c, d = map(int,input().split()) + +# Calc +ans = max(a*c, a*d, b*c, b*d) + +# Output +print(ans) +" +p02553,s136943962,Accepted,"import math + +a,b,c,d=map(int,input().split()) + + +print(max(max(a,b)*max(c,d),min(a,b)*max(c,d),max(a,b)*min(c,d),min(a,b)*min(c,d)))" +p02553,s282343426,Accepted,"a, b, c, d = list(map(int, input().split())) + +print(max([a*c, a*d, b*c, b*d])) +" +p02553,s606357111,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s457141649,Accepted,"a,b,c,d = map(int,input().split()) +x = [a,b] +y = [c,d] + +if a * b < 0: + x.append(-1) + x.append(1) + +if c * d < 0: + y.append(-1) + y.append(1) + +ans = - (10 ** 20) + +for i in x: + for j in y: + ans = max((i*j),ans) + +print(ans)" +p02553,s293611819,Accepted,"n = list(map(int,input().split())) + +a =n[0]*n[2] +b =n[0]*n[3] +c =n[1]*n[2] +d =n[1]*n[3] + +x = max(a,b,c,d) + +print(x) +" +p02553,s889177548,Accepted,"a, b, c, d = map(int, input().split()) + +ac = a * c +ad = a * d +bc = b * c +bd = b * d + +ans = max(ac, ad, bc, bd) + +print(ans)" +p02553,s098558729,Accepted,"l = list(map(int,input().split())) +mx = float('-inf') + +for i in range(2): + for j in range(2,4): + mx = max(mx,l[i]*l[j]) +print(mx)" +p02553,s407732311,Accepted,"a,b,c,d = map(int, input().split()) +array = [] +array.append(a*c) +array.append(b*d) +array.append(a*d) +array.append(b*c) +if (a <= 0 and b >= 0) or (c <= 0 and d >= 0): + array.append(0) +print(max(array))" +p02553,s576457191,Accepted,"from sys import stdin,stdout +# n=int(stdin.readline()) +a,b,c,d=list(map(int,stdin.readline().split())) +ans=max(a*c,a*d,b*c,b*d) +print(ans)" +p02553,s438260193,Accepted,"a, b, c, d = map(int, input().split()) +X = [a, b] +Y = [c, d] +lst = [[x*y for x in X] for y in Y] +mylist=[] +for i in lst: + for I in i: + mylist.append(I) + +mylist.sort() +print(mylist[-1])" +p02553,s134302731,Accepted,"a,b,c,d=map(int,input().split()) + +xy=[a*c,a*d,b*c,b*d] +print(max(xy))" +p02553,s212867157,Accepted,"a,b,c,d = map(int,input().split()) +x = a*c +if b*d > x: + x = b*d +if a*d > x: + x = a*d +if b*c > x: + x = b*c +print(x)" +p02553,s880945467,Accepted,"a,b,c,d=map(int,input().split()) +ans=[a*c,a*d,b*c,b*d] +print(max(ans)) +" +p02553,s833800670,Accepted,"a,b,c,d = map(int,input().split()) + +if(a > 0 and b > 0): + if(c <= 0 and d <= 0): + print(a * d) + exit() +if(c > 0 and d > 0): + if(a <= 0 and b <= 0): + print(c * b) + exit() + +print(max(a * c, b * d))" +p02553,s301943685,Accepted,"# -*- coding: utf-8 -*- +# 整数の入力 +lis = list(map(int,input().split())) +lists = [] +inc = 0 +# スペース区切りの整数の入力 +for i in range(2): + for j in range(2): + lists.append(lis[i]*lis[j+2]) + inc += 1 + + +# 出力 +print(""{}"".format(max(lists)))" +p02553,s012523152,Accepted,"from sys import stdin +inp = lambda : stdin.readline().strip() + +a,b,c,d = [int(x) for x in inp().split()] + +print(max(a*c,b*d,a*d,b*c))" +p02553,s946491274,Accepted," +a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s195271927,Accepted,"list1 = input() +list2 = list1.split() +a = int(list2[0]) +b = int(list2[1]) +c = int(list2[2]) +d = int(list2[3]) + +#x = [i for i in range(a,b+1)] +#y = [j for j in range(c,d+1)] + +x_min = a +x_max = b +y_min = c +y_max = d + +answer_list = [x_max*y_max, x_max*y_min, x_min*y_max, x_min*y_min] + +print(max(answer_list))" +p02553,s621441848,Accepted,"a,b,c,d=map(int,input().split()) +temp=[] +temp.append(a*c) +temp.append(a*d) +temp.append(b*c) +temp.append(b*d) +print(max(temp))" +p02553,s962563160,Accepted,"a, b, c, d = map(int, input().split()) +ans = [a*c, a*d, b*c, b*d] +print(max(ans))" +p02553,s777289342,Accepted,"a, b, c, d = map(int, input().split()) + +n = [a*c, a*d, b*c, b*d] +print(max(n))" +p02553,s641542679,Accepted,"a,b,c,d = [int(_n) for _n in input().split()] +print(max([a*c, a*d, b*c, b*d]))" +p02553,s526488359,Accepted,"x = list(map(int, input().split())) +print(max(x[0]*x[2], x[0]*x[3], x[1]*x[2], x[1]*x[3]))" +p02553,s210978963,Accepted,"def main(): + a,b,c,d = map(int, input().split()) + print(max([a*c, a*d, b*c, b*d])) + + +if __name__ == '__main__': + main() +" +p02553,s933372522,Accepted,"a, b, c, d = map(int, input().split()) + +m = -999999999999999999 + +ac = a * c +if ac >= m: + m = ac + +ad = a * d +if ad >= m: + m = ad + +bc = b * c +if bc >= m: + m = bc + +bd = b * d +if bd >= m: + m = bd + +print(m) +" +p02553,s558927943,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s865910622,Accepted,"a, b , c ,d = map(int, input().split()) + +print(max(a*c,b*d,a*d,b*c))" +p02553,s876403367,Accepted,"a, b, c, d = list(map(int, input().split())) +print(max(a * c, b * d, b * c, a * d))" +p02553,s326440492,Accepted,"a,b,c,d = map(int,input().split()) +print(max(max(a*c,b*d),max(a*d,b*c)))" +p02553,s592478018,Accepted,"a, b, c, d = map(int, input().split()) +ac = a * c +ad = a * d +bc = b * c +bd = b * d +l = [ac, ad, bc, bd] +print(max(l)) +" +p02553,s425468669,Accepted,"nums = input().split(' ') +a = int(nums[0]) +b = int(nums[1]) +c = int(nums[2]) +d = int(nums[3]) + +multi = [] +multi.append(a * c) +multi.append(a * d) +multi.append(b * c) +multi.append(b * d) + +ans = - 10 ** 18 +for i in range(4): + if multi[i] > ans: + ans = multi[i] + +print(ans)" +p02553,s725313893,Accepted,"a,b,c,d=map(int,input().split()) +ans=max(a*c,a*d) +ans=max(ans,b*c) +ans=max(ans,b*d) + +print(ans) +" +p02553,s231611748,Accepted,"def main(): + a, b, c, d = tuple([int(_x) for _x in input().split()]) + print(max(a*c, a*d, b*c, b*d)) + + +main() +" +p02553,s243073605,Accepted,"a,b,c,d=map(int, input().split()) + +ans = max(a*c,a*d,b*c,b*d) + +print(ans)" +p02553,s765094590,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d)) +" +p02553,s665426071,Accepted,"import sys +input = lambda: sys.stdin.readline().rstrip(""\r\n"") + +a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s296234119,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s150154110,Accepted,"a,b,c,d = map(int,input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s965004908,Accepted,"a,b,c,d=map(int,input().split()) +x1=a*c +x2=a*d +x3=b*c +x4=b*d +lst=[] +lst.append(x2) +lst.append(x3) +lst.append(x4) +lst.append(x1) +lst.sort() +print(lst[-1])" +p02553,s392079688,Accepted,"a,b,c,d = map(int,input().split()) +ans=[] +for X in [a,b]: + for Y in [c,d]: + ans.append(X*Y) +print(max(ans)) +" +p02553,s915610940,Accepted,"a,b,c,d=map(int,input().split()) + + + +x1=a*d +x2=a*c +x3=b*c +x4=b*d + +print(max(x1,x2,x3,x4))" +p02553,s309488427,Accepted,"a, b, c, d = map(int, input().split()) + + +ans = max(a * c, a * d, b * c, b * d) +print(ans)" +p02553,s695196681,Accepted,"a, b, c, d = map(int, input().split()) +print(max([a*c, a*d, b*c, b*d]))" +p02553,s808826552,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d ))" +p02553,s263425034,Accepted,"a,b,c,d = map(int,input().split()) + +print(max(a*d,a*c,b*c,b*d))" +p02553,s081840239,Accepted,"a,b,c,d=map(int, input().split()) + +l=[a*c, a*d, b*c, d*b] +print(max(l))" +p02553,s881005243,Accepted,"a,b,c,d = map(int,input().split()) + +ans = max(a*c,a*d,b*c,b*d) + +print(ans)" +p02553,s626063116,Accepted,"a,b,c,d = map(int,input().split()) +if a>=0 and c>=0: + print(b*d) +elif a>=0 and c<0<=d: + print(b*d) +elif a>=0 and d<0: + print(a*d) +elif a<0<=b and c>=0: + print(b*d) +elif a<0<=b and c<0<=d: + print(max(b*d,a*c)) +elif a<0<=b and d<0: + print(a*c) +elif b<0 and c>=0: + print(b*c) +elif b<0 and c<0<=d: + print(a*c) +elif b<0 and d<0: + print(a*c)" +p02553,s998152304,Accepted,"a, b, c, d = map(int, input().split()) + +lst = [a * c, a * d, b * c, b * d] + +print(max(lst))" +p02553,s459190997,Accepted,"[a, b, c, d] = [int(inp) for inp in input().split()] +print(max([a * c, b * d, a * d, b * c]))" +p02553,s993368353,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s616900630,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s701265917,Accepted,"n = input() + +a, b, c, d = n.split("" "") +a = int(a) +b = int(b) +c = int(c) +d = int(d) + +ac = a*c +ad = a*d +bc = b*c +bd = b*d + +print(max([ac, ad, bc, bd])) +" +p02553,s296247267,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s632033797,Accepted,"a,b,c,d = map(int,input().split()) +lsx = [a,b] +lsy = [c,d] +ans = -10**20 +for x in lsx: + for y in lsy: + ans = max(ans,x*y) +print(ans) +" +p02553,s847457841,Accepted,"a,b,c,d = list(map(int,input().split())) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s117597702,Accepted,"a, b, c, d = map(int, input().split()) +ans = max(a * c, b * c, a * d, b * d) +print(ans) +" +p02553,s907873151,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s673255024,Accepted,"a, b, c, d = map(int, input().split()) + +ans = max(a*c, a*d, b*c, b*d) +print(ans)" +p02553,s725522582,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*d, a*c, b*c, b*d))" +p02553,s923610980,Accepted,"a,b,c,d = map(int, input().split()) + +ac = a*c +ad = a*d +bc = b*c +bd = b*d + +print(max(ac,ad,bc,bd))" +p02553,s470751956,Accepted,"a, b, c, d = map(int, input().split()) + +result = a*c +result = max(result, a*d) +result = max(result, b*c) +result = max(result, b*d) +print(result)" +p02553,s860627071,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s453891204,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s712558661,Accepted,"def func(a,b,c,d): + result = a * c + if a * d > result: + result = a * d + if b * c > result: + result = b * c + if b * d > result: + result = b * d + return result + +if __name__ == ""__main__"": + inputStr = input().split() + a = int(inputStr[0]) + b = int(inputStr[1]) + c = int(inputStr[2]) + d = int(inputStr[3]) + print(func(a,b,c,d))" +p02553,s694675714,Accepted,"#!/usr/bin/env python + +def f(a: int, b: int, c: int, d: int) -> int: + """""" + >>> f(-2, -1, -2, -1) + 4 + >>> f(-2, -1, 1, 2) + -1 + >>> f(1, 2, 1, 2) + 4 + >>> f(1, 2, -2, -1) + -1 + """""" + return max(a * c, a * d, b * c, b * d) + + +if __name__ == '__main__': + a, b, c, d = map(lambda x: int(x), input().split()) + print(f(a, b, c, d))" +p02553,s307665058,Accepted,"line = input().rstrip().split("" "") +a = int(line[0]) +b = int(line[1]) +c = int(line[2]) +d = int(line[3]) + +if b>= 0 and d >= 0: + print(max(b * d, a * c)) +elif b <= 0 and d >= 0: + print(max(b * c, a * c)) +elif b >= 0 and d <= 0: + print(max(a * d, a * c)) +else: + print(a * c)" +p02553,s131988315,Accepted,"def resolve(): + a, b, c, d = map(int, input().split()) + print(max(a * c, b * d, a * d, b * c)) + +resolve()" +p02553,s015460395,Accepted,"from math import gcd + +from math import factorial as f + +from math import ceil, floor, sqrt +import math + +import bisect +import re +import heapq + +from copy import deepcopy +import itertools +from itertools import permutations + +from sys import exit + +ii = lambda: int(input()) +mi = lambda: map(int, input().split()) +li = lambda: list(map(int, input().split())) + +yes = ""Yes"" +no = ""No"" + + +def main(): + a,b,c,d = mi() + ans = -100000000000000000000 + ans = max(a*c,ans) + ans = max(b*c,ans) + ans = max(a*d,ans) + ans = max(b*d,ans) + print(ans) + + + + +main() +" +p02553,s752195337,Accepted,"nums = list(map(int, input().split())) +a, b, c, d = nums +result = a*c + +if a*d > result: + result = a*d +if b*c > result: + result = b*c +if b*d > result: + result = b*d + +print(result)" +p02553,s293634615,Accepted,"a,b,c,d = map(int,input().split()) +ans = [a*c, a*d, b*c, b*d] +print(max(ans))" +p02553,s798130541,Accepted,"a,b,c,d = map(int, input().split()) + +A=a*c +B=a*d +C=b*c +D=b*d + +print(max(A,B,C,D))" +p02553,s518725457,Accepted," +import itertools + +a,b,c,d = map(int,input().split()) + +x = [a, b] +y = [c, d] + +ans = [] + +prod = itertools.product(x,y) +for i in prod: + ans.append(i[0]*i[1]) + +print(max(ans)) +" +p02553,s821392816,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s390129520,Accepted,"a,b,c,d = map(int, input().split()) +result = [a*c,a*d,b*c,b*d] +print(max(result))" +p02553,s219901621,Accepted,"i = input().split("" "") +a = int(i[0]) +b = int(i[1]) +c = int(i[2]) +d = int(i[3]) + +negneg = a * c +negpos = a * d +posneg = b * c +pospos = b * d + +print(max([negneg,negpos,posneg,pospos]))" +p02553,s863725297,Accepted,"import sys + +sys.setrecursionlimit(10 ** 7) + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +a, b, c, d = map(int, input().split()) + +ans = max(a * c, a * d, b * c, b * d) +print(ans) +" +p02553,s923486239,Accepted,"a, b, c, d = map(int, input().split()) +ans = -float('inf') +for x in (a, b): + for y in (c, d): + ans = max(ans, x * y) +print(ans) +" +p02553,s396011786,Accepted,"a,b,c,d = map(int,input().split()) +ans = 0 +x = a*c +y = a*d +z = b*c +w = b*d +print(max(x,y,z,w))" +p02553,s911080999,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,max(a*d,max(b*c,b*d))))" +p02553,s905039189,Accepted,"a,b,c,d=map(int,input().split()) +xy=[a*c,a*d,b*c,b*d] +print(max(xy))" +p02553,s468805966,Accepted,"a,b,c,d = map(int, input().split()) + +print(max(a*c,b*d,b*c,a*d))" +p02553,s112098502,Accepted,"A = list(map(int, input().split())) +print(max(A[0]*A[2], A[0]*A[3], A[1]*A[2], A[1]*A[3]))" +p02553,s057598213,Accepted,"a = list(map(int,input().split())) + +result =[] +result.append(a[0] * a[2]) +result.append(a[0] * a[3]) +result.append(a[1] * a[2]) +result.append(a[1] * a[3]) +print(max(result)) + +" +p02553,s766495372,Accepted,"# -*- coding: utf-8 -*- +import math + +numList = [] +result = [] + +user2 = list(map(int, input().split())) + + +numList.append(user2[0] * user2[2] ) +numList.append(user2[0] * user2[3]) +numList.append(user2[1] * user2[2] ) +numList.append (user2[1] * user2[3]) + +numList.sort() + +print(numList[3]) +" +p02553,s156206893,Accepted,"a,b,c,d = map(int,input().split()) +a1 = [] +e = [a,b] +f = [c,d] +for i in e: + for j in f: + a1.append(i*j) +print(max(a1))" +p02553,s443386236,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s053848060,Accepted,"a,b,c,d = map(int,input().split()) + +l = [a*c, a*d, b*c, b*d] + +print(max(l))" +p02553,s046781371,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s432262569,Accepted,"a,b,c,d=map(int,input().split()) +big=-99999999999999999999999999999999999999999 +if a*c>a*d: + big=a*c +else: + big=a*d + +if b*c>big: + big=b*c +if b*d>big: + big=b*d + +print(big)" +p02553,s183160549,Accepted,"a,b,c,d = map(int, input().split()) + +s1 = a*c +s2 = a*d +s3 = b*c +s4 = b*d + +score = [s1,s2,s3,s4] +max_score = max(score) +if a<=0<=b and c<=0<=d and max_score<0: + print(0) +else: + print(max_score)" +p02553,s101176683,Accepted,"a, b, c, d = map(int, input().split()) +l = [a*c, a*d, b*c, b*d] +print(max(l))" +p02553,s521146913,Accepted,"# -*- coding: utf-8 -*- +a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s472375053,Accepted,"A = list(map(int,input().split())) +ans = max(A[0]*A[2],A[0]*A[3],A[1]*A[2],A[1]*A[3]) +print(ans)" +p02553,s168408159,Accepted,"n = input() +m = n.split("" "") + +x_min = int(m[0]) +x_max = int(m[1]) +y_min = int(m[2]) +y_max = int(m[3]) + +a = x_min * y_min +b = x_min * y_max +c = x_max * y_min +d = x_max * y_max + +if a >= b and a >= c and a >= d: + print(a) + +elif b >= a and b >= c and b >= d: + print(b) + +elif c >= a and c >= b and c >= d: + print(c) + +elif d >= a and d >= b and d >= c: + print(d)" +p02553,s999434024,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*c,a*d,b*d))" +p02553,s846440334,Accepted,"a, b, c, d = map(int, input().split()) +ans = max(a * c, a * d, b * c, b * d) +print(ans) +" +p02553,s517234391,Accepted,"a,b,c,d=map(int, input().split()) +maximum_list=(a*c,a*d,b*c,b*d) +print(max(maximum_list))" +p02553,s532114665,Accepted,"a,b,c,d = map(int, input().split()) + +seki = [] +seki.append(a*c) +seki.append(a*d) +seki.append(b*c) +seki.append(b*d) +seki = sorted(seki) +print(seki[-1])" +p02553,s277850702,Accepted,"from math import trunc +import sys +import copy +from collections import deque +import collections +import itertools +stdin = sys.stdin +import math + +mod = 10**9+7 + +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) +ns = lambda: stdin.readline().rstrip() # ignore trailing spaces + +a = na() + +ans = [] + +ans.append(a[0]*a[2]) +ans.append(a[0]*a[3]) +ans.append(a[1]*a[2]) +ans.append(a[1]*a[3]) + +print(max(ans))" +p02553,s349819797,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s280379089,Accepted,"a,b,c,d=map(int,input().split()) +result=[a*c,a*d,b*c,b*d] +print(max(result)) +" +p02553,s401507319,Accepted," +[a,b,c,d] = list(map(int,input().split())) + +dam=[] +dam.append(a*c) +dam.append(a*d) +dam.append(b*c) +dam.append(b*d) +print(max(dam))" +p02553,s637937869,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s284536561,Accepted,"a, b, c, d = map(int, input().split()) + +ans = -1e18 +ans = max(ans, a*c) +ans = max(ans, a*d) +ans = max(ans, b*c) +ans = max(ans, b*d) +print(ans) +" +p02553,s234974390,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s661328704,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d)) +" +p02553,s450494306,Accepted,"a,b,c,d=[int(i) for i in raw_input().split()] +print max(a*c,a*d,b*c,b*d) +" +p02553,s141048439,Accepted,"a, b, c, d = map(int, input().split()) + +ans = [a*c, a*d, b*c, b*d] + +print(max(ans))" +p02553,s247599770,Accepted,"a,b,c,d = map(int,input().split()) +ans = max(a*c,a*d,b*c,b*d) +print(ans)" +p02553,s571895729,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s117386817,Accepted,"a,b,c,d = map(int,input().split()) +ans = max(a*c,a*d,b*c,b*d) +print(ans)" +p02553,s047815684,Accepted,"a,b,c,d = map(int, input().split()) +max_list = [a*c,a*d,b*c,b*d] +max_list = sorted(max_list, reverse=True) +print(max_list[0]) +" +p02553,s670028404,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s129848580,Accepted,"dd=input("""").split("" "") +a=int(dd[0]) +b=int(dd[1]) +c=int(dd[2]) +d=int(dd[3]) +s=max(a*c,b*c,a*d,b*d) +print(s) +" +p02553,s065002609,Accepted,"import numpy as np +a, b, c, d = map(int, input().split()) + +hoge = [] +hoge.append(a*c) +hoge.append(a*d) +hoge.append(b*c) +hoge.append(b*d) + +if max(hoge) < 0: + if np.sign(a) != np.sign(b) or np.sign(c) != np.sign(d): + print(0) + else: + print(max(hoge)) +else: + print(max(hoge))" +p02553,s810262807,Accepted,"def main(): + a, b, c, d = map(int, input().split()) + + print(max(a * c, a * d, b * c, b * d)) + + +if __name__ == ""__main__"": + main() +" +p02553,s997999660,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, b*c, b*d, a*d)) +" +p02553,s436968041,Accepted,"def cal(a,b,c,d): + list = [] + list.append(a*c) + list.append(b*c) + list.append(a*d) + list.append(b*d) + new_list = sorted(list, reverse=True) + print(new_list[0]) + +a,b,c,d = map(int, input().split()) +cal(a,b,c,d)" +p02553,s821971749,Accepted,"a,b,c,d=[int(s) for s in input().split()] +ls=[a*c,a*d,b*c,b*d] +print(max(ls))" +p02553,s625003933,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s796214888,Accepted,"# B +a, b, c, d = map(int,input().split()) +kot = [] +kot.append(a * c) +kot.append(a * d) +kot.append(b * c) +kot.append(b * d) +kot = sorted(kot,reverse=True) +print(kot[0]) +" +p02553,s654955220,Accepted,"a, b, c, d = list(map(int, input().split())) +R=max([b*d, a*d, a*c, b*c]) +print(R) +" +p02553,s924624992,Accepted,"import numpy as np + +a, b, c, d= map(int, input().split()) + +xy1=a*c +xy2=a*d +xy3=b*c +xy4=b*d + +xymax=max([xy1,xy2,xy3,xy4]) +print (xymax)" +p02553,s221129619,Accepted,"a, b, c, d = map(int,input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s793024675,Accepted,"a, b, c, d = map(int, input().split()) + +list = [] +list.append(a*c) +list.append(a*d) +list.append(b*c) +list.append(b*d) +print(max(list)) +" +p02553,s847001800,Accepted,"a,b,c,d=map(int,input().split()) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s112194988,Accepted,"import sys + +input = sys.stdin.readline + + +arr = list(map(int, input().split())) +ans = [] +ans.append(arr[0]*arr[2]) +ans.append(arr[0]*arr[3]) +ans.append(arr[1]*arr[2]) +ans.append(arr[1]*arr[3]) + + +print(max(ans))" +p02553,s387633581,Accepted,"a, b, c, d = map(int, input().split()) +if a * c < a * d: + temp1 = a * d +else: + temp1 = a * c +if b * c < b * d: + temp2 = b * d +else: + temp2 = b * c +if temp1 < temp2: + print(temp2) +else: + print(temp1)" +p02553,s782073848,Accepted,"X = list(map(int, input().split())) + +print(max(X[1]*X[2], X[3]*X[0], X[0]*X[2],X[1]*X[3]))" +p02553,s170849609,Accepted,"a,b,c,d= list(map(int, input().split())) +print(max([b*d,a*c,a*d,b*c]))" +p02553,s456129466,Accepted,"a,b,c,d=map(int,input().split()) +ans=max(a,b)*max(c,d) +ans3=min(a,b)*max(c,d) +ans4=max(a,b)*min(c,d) +ans2=min(a,b)*min(c,d) +print(max(ans,ans2,ans3,ans4))" +p02553,s450878871,Accepted,"a,b,c,d = map(int, input().split()) +ans = max(a*c, a*d, b*c, b*d) + +print(ans)" +p02553,s902931099,Accepted,"a,b,c,d = map(int, input().split()) + +L = [a*c,a*d,b*c,b*d] + +L.sort(reverse = True) +print(L[0])" +p02553,s406674403,Accepted,"a,b,c,d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s078733908,Accepted,"from collections import defaultdict +from collections import deque +from collections import Counter +import math +import itertools + +def readInt(): + return int(input()) +def readInts(): + return list(map(int, input().split())) +def readChar(): + return input() +def readChars(): + return input().split() + +a,b,c,d = readInts() + +ans = max(a*c,a*d,b*c,b*d) + +print(ans)" +p02553,s107660386,Accepted,"a, b , c, d = map(int, input().split()) + +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s205065450,Accepted,"a,b,c,d = map(int,input().split()) + +ans = [a*c,a*d,b*c,b*d] + +print(max(ans))" +p02553,s440609727,Accepted,"a, b, c, d = map(int, input().split()) + +res = a * c +for x, y in [[a, d], [b, c], [b, d]]: + if x * y > res: + res = x * y + +print(res) +" +p02553,s577897495,Accepted,"a,b,c,d=map(int,input().split("" "")) +print(max(a*c,b*c,a*d,b*d)) +" +p02553,s217682243,Accepted,"a,b,c,d = map(int, input().split()) +l = [a*c,a*d,b*c,b*d] +Ans=max(l) +print(Ans)" +p02553,s675809097,Accepted,"a,b,c,d=map(int, input().split()) +v1=a*c +v2=b*d +v3=a*d +v4=b*c +s=[v1,v2,v3,v4] +s.sort() +print(s[3]) +" +p02553,s342256645,Accepted,"a, b, c, d = map(int,input().split()) +if a*b <= 0 or c*d <= 0: + A = max(a*c,a*d,b*c,b*d,0) +else: + A = max(a*c,a*d,b*c,b*d) +print(A)" +p02553,s648105966,Accepted,"a = list(map(int, input().split())) +print(max( + a[0] * a[2], a[0] * a[3], a[1] * a[2], a[1] * a[3] +))" +p02553,s515590334,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, + a*d, + b*c, + b*d))" +p02553,s400968429,Accepted,"a, b, c, d=map(int, input().split("" "")) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s383026442,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s719402536,Accepted,"a,b,c,d = map(int, input().split()) + +if a >= 0 and c >= 0 : + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif a>=0 and c <= 0: + print(max(a*d,b*d)) +elif a<=0 and c >= 0: + print(max(c*b, b*d)) +else: + print(max(a*d,b*d,c*b,a*c))" +p02553,s188504088,Accepted,"def main(): + a, b, c, d = (int(i) for i in input().split()) + print(max(a*c, b*d, a*d, b*c)) + + +if __name__ == '__main__': + main() +" +p02553,s247211433,Accepted,"array = list(map(int, input().strip().split())) +l = len(array) +list = [] +if(l==4): + ac=array[0]*array[2] + ad=array[0]*array[3] + bc=array[1]*array[2] + bd=array[1]*array[3] + + list.append(ac) + list.append(ad) + list.append(bc) + list.append(bd) + + print(max(list)) + +else: + print("""") + + + " +p02553,s159912143,Accepted,"l = list(map(int, input().split())) + +M = -(10 ** 20) + +for i in range(2): + for j in range(2, 4): + m = l[i] * l[j] + if M < m: + M = m + +print(M)" +p02553,s300688384,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s243512731,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s662464157,Accepted,"a, b, c, d = map(int, input().split()) +print(max([a*c, a*d, b*c, b*d]))" +p02553,s246434259,Accepted,"a, b, c, d = [int(x) for x in input().split()] +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s264868131,Accepted,"#akash mandal: jalpaiguri government engineering college +import sys,math + +def ii(): return int(input()) +def mii(): return map(int,input().split()) +def lmii(): return list(mii()) + + +def main(): + a,b,c,d=mii() + if a>b: + a,b=b,a + if c>d: + c,d=d,c + print(max(a*c,b*d,a*d,b*c)) +if __name__==""__main__"": + main()" +p02553,s752368326,Accepted,"li=list(map(int,input().split())) +ans=[] +a=li[0]*li[2] +b=li[0]*li[3] +c=li[1]*li[2] +d=li[1]*li[3] +ans.append(a) +ans.append(b) +ans.append(c) +ans.append(d) + +print(max(ans)) +" +p02553,s206679630,Accepted,"a,b,c,d=map(int, input().split()) +print(max([a*c, a*d, b*c, b*d]))" +p02553,s116836712,Accepted,"a, b, c, d = map(int, input().split()) +ans_list = [a * c, b * c, b * d, a * d] +print(max(ans_list))" +p02553,s610384008,Accepted,"a,b,c,d = list(map(int, input().split())) +print(max(a * c, a * d, b * c, b * d))" +p02553,s888267008,Accepted,"a,b,c,d=map(int,input().split()) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s112986385,Accepted,"a,b,c,d=list(map(int,input().split())) + +e=[a*c,a*d,b*c,b*d] + +print(max(e)) +" +p02553,s053049841,Accepted,"# -*- coding: utf-8 -*- +from sys import stdin +input = stdin.readline + + +def main(): + a, b, c, d = list(map(int,input().split())) + print(max([a*c, a*d, b*c, b*d])) + +if __name__ == ""__main__"": + main() +" +p02553,s041153009,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s835880393,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s895591495,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s703019541,Accepted," +def ii(): return int(input()) + + +def mi(): return map(int, input().split()) + + +def li(): return list(map(int, input().split())) + + +a, b, c, d = mi() + +print(max(a * c, b*c, a*d, b*d)) +" +p02553,s445658700,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d)) +" +p02553,s205398464,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s752907477,Accepted,"import math as mt +import sys, string +from collections import Counter, defaultdict +input = sys.stdin.readline + +# input functions +I = lambda : int(input()) +M = lambda : map(int, input().split()) +ARR = lambda: list(map(int, input().split())) + +a, b, c, d = M() +print(max(a*c, a*d, b*c, b*d))" +p02553,s573862642,Accepted,"a, b, c, d = map(int, input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s058304409,Accepted,"a,b,c,d = map(int, input().split()) + +ans = [a*c, a*d, b*c, b*d] +print(max(ans))" +p02553,s384232692,Accepted,"from sys import stdin + +def main(): + + input = stdin.readline + + a,b,c,d = map(int,input().split()) + + + ans = max(a*c,a*d,b*c,b*d) + + print(ans) + + +if __name__ == ""__main__"": + main()" +p02553,s474381576,Accepted,"a, b, c, d = map(int, input().split()) +ac = a * c +ad = a * d +bc = b * c +bd = b * d +print(max(ac, ad, bc, bd)) +" +p02553,s393991604,Accepted,"a,b,c,d=map(int,input().split()) +print(max(b*d,a*c,a*d,b*c))" +p02553,s175962711,Accepted,"from sys import stdin, setrecursionlimit +#input = stdin.buffer.readline +setrecursionlimit(10 ** 7) + +from heapq import heappush, heappop +from bisect import bisect_left, bisect_right +from collections import deque, defaultdict, Counter +from itertools import combinations, permutations, combinations_with_replacement +from itertools import accumulate +from math import ceil, sqrt, pi, radians, sin, cos + +MOD = 10 ** 9 + 7 +INF = 10 ** 18 + +a, b, c, d = map(int, input().split()) +#A = list(map(int, input().split())) +#A = [int(input()) for _ in range(N)] +#ABC = [list(map(int, input().split())) for _ in range(N)] +#S = input() +#S = [input() for _ in range(N)] + +print(max(a * c, a * d, b * c, b * d))" +p02553,s338359724,Accepted,"l = list(map(int, input().split())) +r = [] +for i in range(0, 2, 1): + for j in range(2, 4, 1): + r.append(l[i] * l[j]) + +print(max(r))" +p02553,s941738839,Accepted,"a, b, c, d = map(int, input().split()) + +ans = max(a * c, a * d, b * c, b * d) +print(ans) +" +p02553,s456056511,Accepted,"a,b,c,d = map(int, input().split(' ')) +print(max(a*c,a*d,b*c,b*d)) +" +p02553,s973239327,Accepted,"a,b,c,d=map(int, input().split()) + +if b<=0 and d<=0: + print(a*c) +elif a>=0 and c>=0: + print(b*d) +elif b<=0 and c>=0: + print(b*c) +elif a>=0 and d<=0: + print(a*d) +else: + if b*d>a*c: + print(b*d) + else: + print(a*c) +" +p02553,s501014788,Accepted,"a,b,c,d=map(int, input().split("" "")) +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s066685203,Accepted,"#-*-coding:utf-8-*- + +import sys + +def main(): + a,b,c,d = map(int,input().split()) + print(max(a*c,a*d,b*c,b*d)) + +if __name__ == ""__main__"": + main()" +p02553,s604262085,Accepted,"a,b,c,d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s596556166,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, b*d, a*d, b*c)) + +" +p02553,s614053939,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d)) +" +p02553,s121683331,Accepted,"a,b,c,d = map(int, input().split()) + + +if(b*d>=a*c and b*d>=b*c and b*d>=a*d): + print(b*d) +elif(a*c>=b*d and a*c>=a*d and a*c>=b*c): + print(a*c) +elif(a*d>=a*c and a*d>=b*c and a*d>=b*d): + print(a*d) +elif(b*c>=a*c and b*c>=b*d and b*c>=a*d): + print(b*c)" +p02553,s521914908,Accepted,"a,b,c,d=list(map(int,input().split())) +x=[a*c,a*d,b*c,b*d] +print(max(x)) +" +p02553,s713667676,Accepted,"r=input().split() +a=int(r[0]) +b=int(r[1]) +c=int(r[2]) +d=int(r[3]) +x=b*d +y=a*c +z=a*d +w=b*c +print(max(x,y,z,w))" +p02553,s861682801,Accepted,"a, b, c, d = map(int, input().split()) +t = [] +t.append(a*c) +t.append(a*d) +t.append(b*c) +t.append(b*d) + +print(max(t))" +p02553,s892407933,Accepted,"a, b, c, d = map(int, input().split()) +anslist = [] + +anslist.append(a*c) +anslist.append(a*d) +anslist.append(b*c) +anslist.append(b*d) + +print(max(anslist)) +" +p02553,s785595149,Accepted,"#: Author - Soumya Saurav +import sys,io,os,time +from collections import defaultdict +from collections import Counter +from collections import deque +from itertools import combinations +from itertools import permutations +import bisect,math,heapq +alphabet = ""abcdefghijklmnopqrstuvwxyz"" + +input = sys.stdin.readline + +######################################## + + +a,b,c,d = map(int , input().split()) +print(max([a*c,b*c,a*d,b*d])) + + + + + + + +''' +# Wrap solution for more recursion depth +#submit as python3 +import collections,sys,threading +sys.setrecursionlimit(10**9) +threading.stack_size(10**8) + + + +threading.Thread(target=solve).start() +''' +" +p02553,s442196144,Accepted,"a, b, c, d = map(int, input().split()) +list = [a*c, a*d, b*c, b*d] +print(max(list))" +p02553,s153836855,Accepted,"LI = lambda: list(map(int, input().split())) + +a, b, c, d = LI() + + +def main(): + ans = a * c + ans = max(ans, a * d) + ans = max(ans, b * c) + ans = max(ans, b * d) + print(ans) + + +if __name__ == ""__main__"": + main() +" +p02553,s837968716,Accepted,"# x = int(input()) +a, b, c, d = map(int, input().split()) + +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s689694015,Accepted,"a,b,c,d = map(int,input().split(' ')) +lst = [a*c,a*d,b*c,b*d] +print(max(lst))" +p02553,s968596112,Accepted,"a,b,c,d = map(int, input().split()) +ans = max(a*c, b*c, b*d, a*d) +print(ans)" +p02553,s947809732,Accepted,"il = [int(k) for k in input().split()] +a = il[0] +b = il[1] +c = il[2] +d = il[3] + +print(max([a*c, a*d, b*c, b*d])) +" +p02553,s894449076,Accepted,"(a, b, c, d) = map(int, input().split()) +print(max(b * d, a * c, a * d, b * c))" +p02553,s371829266,Accepted,"a,b,c,d=map(int,input().split()) +x=a*c +if x 0: + if c >= 0: + print(b * c) + else: + print(a * c) +elif b > 0 and d <= 0: + if a >= 0: + print(a * d) + else: + print(a * c) +elif b <= 0 and d <= 0: + print(a * c) +elif b == 0 or d == 0: + print(0) +else: + if c < 0 and a < 0: + print(max(a * c,b * d)) + else: + print(b * d)" +p02553,s721293200,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d)) +" +p02553,s729950186,Accepted,"a,b,c,d=map(int,input().split()) + + +x2=a*c +x3=a*d +x4=b*c +x5=b*d + +ans=max(x2,x3,x4,x5) + +print(ans)" +p02553,s087055218,Accepted,"x = list(map(int, input().split())) +l1 = x[:2] +l2 = x[2:] +final = [] +for i in range(2): + for j in range(2): + final.append(l1[i]*l2[j]) +print(max(final))" +p02553,s864868409,Accepted,"a,b,c,d = map(int,input().split()) +res1 = a*c +res2 = a*d +res3 = b*c +res4 = b*d + +x =[] +y =[] +z =[] +l =[] + +x.append(res1) +y.append(res2) +z.append(res3) +l.append(res4) + +res0 = x+y+z+l + +m = max(res0) + +print(m) + +" +p02553,s708808945,Accepted,"a, b, c, d = map(int, input().split()) +if b <= 0 and c >= 0: + print(b*c) +elif a >= 0 and d <= 0: + print(a*d) +else: + print(max(a*c, b*d))" +p02553,s142201887,Accepted,"def main(): + a,b,c,d=map(int,input().split()) + res_list=[a*c,a*d,b*c,b*d] + print(max(res_list)) +if __name__==""__main__"": + main()" +p02553,s469885455,Accepted,"a, b, c, d = map(int, input().split()) +print(max( + a*c, + a*d, + b*c, + b*d +)) +" +p02553,s597633039,Accepted,"a,b,c,d=map(int,input().split()) +ans=a*c +ans=max(ans,a*d) +ans=max(ans,b*c) +ans=max(ans,b*d) +print(ans)" +p02553,s320673081,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,max(a*d,max(b*c,b*d))))" +p02553,s544121022,Accepted,"def main(): + a, b, c, d = map(int, input().split()) + return max(a * c, a * d, b * c, b * d) + +if __name__ == '__main__': + print(main())" +p02553,s094750106,Accepted,"a,b,c,d = map(int,input().split()) +aa = [] +aa.append(a*c) +aa.append(a*d) +aa.append(b*c) +aa.append(b*d) +print(max(aa))" +p02553,s976396091,Accepted,"a,b,c,d = map(int, input().split()) +li = [] +i = 0 +ac = a*c +ad = a*d +bc = b*c +bd = b*d + +print(max(ac,ad,bc,bd))" +p02553,s349752147,Accepted,"a,b,c,d = [int(hoge) for hoge in input().split()] +if a==b==0 or c==d==0: + print(0) +else: + print(max([a*c,a*d,b*c,b*d]))" +p02553,s412141226,Accepted,"a, b, c, d = map(int, input().split()) + +max_x_y = max([a*c, a*d, b*c, b*d]) +print(max_x_y)" +p02553,s130421965,Accepted,"a, b, c, d = map(int, input().split()) +result = max(a*c, a*d, b*c, b*d) +print(result) +" +p02553,s447464232,Accepted,"a,b,c,d = [int(i) for i in input().split()] + +print(max(a*c,a*d,b*c,b*d))" +p02553,s924876810,Accepted,"a, b, c, d = map(int, input().split()) +ans = -float(""inf"") +for x in [a, b]: + for y in [c, d]: + tmp = x*y + ans = max(ans, tmp) +print(ans) +" +p02553,s289001020,Accepted,"import sys + + +def main(): + a, b, c, d = map(int, sys.stdin.readline().rstrip().split()) + + ac = a * c + bc = b * c + ad = a * d + bd = b * d + + if (a <= 0 and 0 <= b) or (c <= 0 and 0 <= d): + print(max(ac, bc, ad, bd, 0)) + else: + print(max(ac, bc, ad, bd)) + + +main() +" +p02553,s888083013,Accepted,"import sys +#sys.exit() +#sorted( ,reverse=True) + +a,b,c,d = map(int, input().split()) +#A = list(map(int, input().split())) +#A = [int(input()) for _ in range(N)] +#print(a,b,c,d) +#cnt = 0 +#cnt += 1 + +print(max(a*c,a*d,b*c,b*d)) + +#print(N) +#print(S,T) +#print(A) +#print('Yes') +#print('No') +#print(cnt)" +p02553,s863108808,Accepted,"a, b, c, d = map(int, input().split()) +l = [a, b] +k = [c, d] +g = a*c +for i in l: + for j in k: + if i*j > g: + g = i*j +print(g)" +p02553,s833309390,Accepted,"a,b,c,d = list(map(int,input().split())) + +AC = a * c +AD = a * d +BC = b * c +BD = b * d + +print(max(AC,AD,BC,BD))" +p02553,s743962645,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s505336941,Accepted,"x_low,x_up,y_low,y_up=map(int,input().split()) + +a1=x_low*y_low +a2=x_low*y_up +a3=x_up*y_low +a4=x_up*y_up + +ans=max(a1,a2,a3,a4) +print(ans)" +p02553,s937734255,Accepted,"[a,b,c,d] = list(map(int,input().split())) + +ans = max(a*c,a*d,b*c,b*d) + +print(ans)" +p02553,s083870640,Accepted,"a,b,c,d=map(int,input().split()) +maxxy=max(a*c,a*d,b*c,b*d) +print(maxxy)" +p02553,s353239201,Accepted,"a,b,c,d=map(int,input().split()) +prd=[a*c,a*d,b*c,b*d] + +if (a<0=0 and bd>=0): + max = max(ac, bd) +elif ac>=0: + max = ac +elif bd>=0: + max = bd + +print(max)" +p02553,s810020252,Accepted,"a, b, c, d = map(int, input().split()) +if a < 0 and c < 0: + if a*c > b*d: + print(a*c) + else: + print(b*d) +elif a > 0 and c < 0: + if a*d > b*d: + print(a*d) + else: + print(b*d) +elif a < 0 and c > 0: + if b*c > b*d: + print(b*c) + else: + print(b*d) +else: + print(b*d)" +p02553,s572132372,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, b * d, a * d, b * c))" +p02553,s783852595,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s167148806,Accepted,"a,b,c,d=map(int,input().split()) + +abcd=[a*c,a*d,b*c,b*d] + +tmp=max(abcd) + +if tmp>=0: + print(tmp) +else: + if a<=0 and 0<=b: + print(0) + elif c<=0 and 0<=d: + print(0) + else: + print(tmp) + + + + + + + + +" +p02553,s584784333,Accepted,"A,B,C,D=input().split(' ') +a,b,c,d=int(A),int(B),int(C),int(D) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s403117925,Accepted,"a, b, c, d = map(int, input().split()) +t = [a * c, a * d, b * c, b * d] +print(max(t))" +p02553,s616722519,Accepted,"a,b,c,d = map(int,input().split()) +X = [a, b] +Y = [c, d] +m = [x * y for x in X for y in Y] +print(max(m))" +p02553,s904137936,Accepted,"a, b, c, d = map(int, input().split()) + +import itertools + +max_xy = max(a * c, b * c, a * d, b * d) + +print(max_xy)" +p02553,s151058920,Accepted,"a,b,c,d = list(map(int,input().split())) + +x = [a,b] +y = [c,d] +ans = [i * j for i in x for j in y] +print( max(ans) )" +p02553,s088467451,Accepted,"# -*- coding: utf-8 -*- + +a,b,c,d=map(int,input().split()) + +ans=a*c +if a*d > ans: ans=a*d +if b*c > ans: ans=b*c +if b*d > ans: ans=b*d + +print(ans)" +p02553,s939492447,Accepted,"a,b,c,d = map(int ,raw_input().split()) +print max(a*c, a*d, b*c, b * d)" +p02553,s599882049,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d)) +" +p02553,s137324020,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s852558116,Accepted,"a,b,c,d = map(int,input().split()) + +max_a = max(a*c,a*d) +max_b = max(b*c,b*d) +print(max(max_a,max_b))" +p02553,s824462909,Accepted,"a,b,c,d=input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +p=a*c +q=a*d +r=b*c +s=b*d +print(max(p,q,r,s))" +p02553,s394429243,Accepted,"a,b,c,d = list(map(int,input().split())) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s912400684,Accepted,"a,b, c, d = [int(x) for x in input().split()] +print( max(a * c, a * d, b * c,b *d))" +p02553,s570742391,Accepted,"a, b, c, d = map(int, input().split()) + +p = [0] * 4 + +p[0] = a * c +p[1] = a * d +p[2] = b * c +p[3] = b * d + +ans = max(p) + +print(ans) +" +p02553,s392310158,Accepted,"a,b,c,d = [int(x) for x in input().split()] +t = [a*c,a*d,b*c,b*d] +print(max(t))" +p02553,s522704298,Accepted,"a, b, c, d = map(int, input().split()) + +ans = max(a*c, b*d, b*c, a*d) + +print(ans) +" +p02553,s484534581,Accepted,"a, b, c, d = map(int, input().split()) +ans=[a*c, a*d, b*c, b*d] +print(max(ans))" +p02553,s014800338,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s193324700,Accepted,"a,b,c,d = map(int,input().split()) + +l1 = [a,b] +l2 = [c,d] + +if(a<0 and 0=0: + answer = max(a*c,b*d,b*c) +if b>=0: + if a <0: + answer = max(a*c ,b * d,0) + if a >= 0: + if d< 0: + if a == 0: + answer = 0 + else: + answer = a*d + if d>=0: + answer = b*d +print(answer) +" +p02553,s676556125,Accepted,"a,b,c,d = map(int, input().split()) +result = max(a*c, a*d, b*c, b*d) +print(result)" +p02553,s396884059,Accepted,"a, b, c, d = map(int, input().split()) +l = [a*c, a*d, b*c, b*d] +print(max(l))" +p02553,s389838756,Accepted,"a, b, c, d = map(int, input().split()) + +ac = a * c +ad = a * d +bc = b * c +bd = b * d + +ans = max([ac,ad,bc,bd]) +print(ans)" +p02553,s503119592,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s123408530,Accepted,"a,b,c,d = map(int,input().split()) +ans = max(a*c,a*d,b*c,d*b) +print(ans)" +p02553,s621377337,Accepted,"a, b, c, d = map(int, input().split()) + +x1 = a * c +x2 = a * d +x3 = b * c +x4 = b * d + +ans = max(x1, x2, x3, x4) + +print(ans) +" +p02553,s915582794,Accepted,"a,b,c,d=(int(i) for i in input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s737827513,Accepted,"a,b,c,d = list(map(int,input().split())) +print(max(a*c,a*d,b*c,b*d))" +p02553,s523745041,Accepted,"a, b, c, d = map(int,input().split()) +x = a * c +y = a * d +z = b * c +u = b * d +ans = max(x, y, z, u) +print(ans)" +p02553,s018707654,Accepted,"a, b, c, d = map(int, input().split()) + +A = max(a*c, a*d) +B = max(b*c, b*d) +print(max(A, B))" +p02553,s528403864,Accepted,"a, b, c, d = map(int,input().split()) +ac = a * c +ad = a * d +bc = b * c +bd = b * d +print(max([ac, ad, bc, bd] ))" +p02553,s302580504,Accepted,"a, b, c, d = list(map(int, input().split())) + +print(max(a*c, b*c, a*d, b*d)) +" +p02553,s418584179,Accepted,"#!/usr/bin/env python3 + +import sys +import math +from bisect import bisect_right as br +from bisect import bisect_left as bl +sys.setrecursionlimit(2147483647) +from heapq import heappush, heappop,heappushpop +from collections import defaultdict +from itertools import accumulate +from collections import Counter +from collections import deque +from operator import itemgetter +from itertools import permutations +mod = 10**9 + 7 +inf = float('inf') +def I(): return int(sys.stdin.readline()) +def LI(): return list(map(int,sys.stdin.readline().split())) + +a, b, c, d = LI() +ans = max(a*c, b*d, a*d, b*c) +print(ans)" +p02553,s942647390,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s670458307,Accepted,"a, b, c, d = map(int, open(0).read().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s525287762,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s340504067,Accepted,"a, b, c, d=map(int, input().split()) +a1 = a*c +a2 = a*d +a3 = b*c +a4 = b*d +ans = max(a1, a2, a3, a4) +print(ans)" +p02553,s478612547,Accepted,"a,b,c,d=map(int,input().split()) +ans=-10**18 +for num1 in [a,b]: + for num2 in [c,d]: + ans=max(ans,num1*num2) +print(ans)" +p02553,s228503791,Accepted,"a,b,c,d = map(int,input().split()) +ans = b * d +for i in a,b: + for j in c,d: + ans = max(i*j,ans) +print(ans)" +p02553,s575927217,Accepted,"a,b,c,d = map(int,input().split()) +A = a*c +B = a*d +C = b*c +D = b*d +print(max(A,B,C,D))" +p02553,s423270615,Accepted,"x = list(map(int, input().split())) +print(max([x[0]*x[2],x[0]*x[3],x[1]*x[2],x[1]*x[3]]))" +p02553,s328922747,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s961789313,Accepted,"li = list(map(int, input().split())) +ans = [] +for i in range(2): + for j in range(2,4): + ans.append(li[i]*li[j]) +print(max(ans))" +p02553,s356975146,Accepted,"a,b,c,d=map(int,input().split()) +if a>-1 and b<1: + print(max(a*c,a*d,b*c,b*d,0)) +elif c>-1 and d<1: + print(max(a*c,a*d,b*c,b*d,0)) +else: + print(max(a*c,a*d,b*c,b*d))" +p02553,s114563808,Accepted,"inputs = input().split() +inputs = list(map(lambda x: int(x), inputs)) +x_array = [inputs[0], inputs[1]] +y_array = [inputs[2], inputs[3]] +max = -1000000000000000000 + +for x in x_array: + for y in y_array: + if(max < x * y): + max = x * y + +print(max)" +p02553,s511023576,Accepted,"a,b,c,d=map(int,input().split()) +if a>=0 and c>=0: + Ans=b*d +elif b<0 and d<0: + Ans=a*c +elif a>=0: + if d<0: + Ans=a*d + else: + Ans=b*d +elif c>=0: + if b<0: + Ans=b*c + else: + Ans=b*d +else: + if b>0 and d>0: + Ans=max([a*c,b*d]) + else: + Ans=a*c +print(Ans)" +p02553,s288258702,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b* d))" +p02553,s096462700,Accepted,"a, b, c, d = map(int, input().split()) + +ac = a * c +bc = b * c +ad = a * d +bd = b * d + +print(max([ac, bc, ad, bd])) +" +p02553,s164226895,Accepted,"(a, b, c, d) = [int(x) for x in input().split(' ')] +print(max([a*c, b*c, a*d, b*d]))" +p02553,s857981049,Accepted,"import sys +import collections as cc +import math as mt +I=lambda:list(map(int,input().split())) +a,b,c,d=I() +print(max(a*c,a*d,b*c,b*d))" +p02553,s511109836,Accepted,"def main(): + a, b, c, d = map(int, input().split()) + conds = [a*c, a*d, b*c, b*d] + print(max(conds)) + + +if __name__ == '__main__': + main()" +p02553,s909804251,Accepted,"a,b,c,d = map(int, input().split()) + +mx=max(a*c,a*d,b*c,b*d) +print(mx) +" +p02553,s791241331,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d)) " +p02553,s585529758,Accepted,"a,b,c,d = map(int,input().split()) + +ans = max(a*c,a*d,b*c,b*d) + +print(ans)" +p02553,s128799627,Accepted,"def solve(): + a,b,c,d = list(map(int, input().split())) + + ret = max(a*c, b*d, a*d, b*c) + print(ret) + +solve()" +p02553,s666670327,Accepted,"details = input() +details = details.split() +first = details[:2] +second = details[2:] +checker = [] +for numbers in first: + for dig in second: + checker.append(int(numbers) * int(dig)) +print(max(checker)) +" +p02553,s963355345,Accepted,"# coding: utf-8 +a, b, c, d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s391281578,Accepted,"s=input().split() +a=int(s[0]) +b=int(s[1]) +c=int(s[2]) +d=int(s[3]) +m=[] +m.append(a*c) +m.append(a*d) +m.append(b*c) +m.append(b*d) +print(max(m))" +p02553,s284490866,Accepted,"a, b, c, d = map(int, input().split()) +ans = max(a*c, b*d, a*d, b*c) +print(ans) +" +p02553,s824402176,Accepted,"import sys +def input(): return sys.stdin.readline().rstrip() +def main(): + a, b, c, d = map(int,input().split()) + print(max(a*c,a*d,b*c,b*d)) + +if __name__=='__main__': + main()" +p02553,s484779504,Accepted,"a, b, c, d = map(int, input().split()) +print( + max(a*c, a*d, b*c, b*d) +)" +p02553,s381139271,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, b * d, a * d, b * c))" +p02553,s512944292,Accepted,"import itertools + +a, b, c, d = tuple(map(int, input().split())) + +num = None +for x, y in itertools.product([a, b], [c, d]): + if num == None: + num = x * y + else: + num = max(num, x * y) + +print(num)" +p02553,s954741871,Accepted,"a, b, c, d = map(int,input().split()) +e1 = a*c +e2 = a*d +e3 = b*c +e4 = b*d + +list = [e1, e2, e3, e4] +list.sort() + +print(list[3])" +p02553,s123917688,Accepted,"a,b,c,d = map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s799619117,Accepted,"a,b,c,d=map(int,input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s359767491,Accepted,"a,b,c,d=map(int, input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s691176586,Accepted,"a, b, c, d = map(int, input().split()) +net = [] +net.append(a * c) +net.append(a * d) +net.append(b * c) +net.append(b * d) +print(max(net)) +" +p02553,s322654629,Accepted,"a,b,c,d = map(int, input().split()) +m = a*c +n = a*d +o = b*c +p = b*d +if(m>n and m>o and m>p): + print(m) +elif (n>m and n>o and n>p): + print(n) +elif (o> m and o>n and o>p): + print(o) +else: + print(p)" +p02553,s724173427,Accepted,"a,b,c,d=[int(x) for x in input().split(' ')] +print(max([a*c,a*d,b*c,b*d]))" +p02553,s689298630,Accepted,"a,b,c,d=map(int,input().split()) +ab=list([a,b]) +cd=list([c,d]) +ans=ab[0]*cd[0] +for i in range(len(ab)): + for j in range(len(cd)): + temp=ab[i]*cd[j] + ans=max(ans,temp) +print(ans)" +p02553,s261558723,Accepted,"A,B,C,D = map(int, input().split()) + +a1 = A * C +a2 = A * D +a3 = B * C +a4 = B * D + +list = (a1,a2,a3,a4) + +print(max(list)) +" +p02553,s070030407,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s780111316,Accepted,"lst = list(map(int, input().split())) +x_lst = [] +y_lst = [] +max_lst = [] +for i in range(2): + x_lst.append(lst[i]) + y_lst.append(lst[(i+1)*-1]) +for j in range(len(x_lst)): + for k in range(len(y_lst)): + max_lst.append(x_lst[j] * y_lst[k]) +print(max(max_lst)) +" +p02553,s220062049,Accepted,"# author: Taichicchi +# created: 13.09.2020 21:00:30 + +import sys + +a, b, c, d = map(int, input().split()) + +ans = max(a * d, a * c, b * c, b * d) +print(ans) +" +p02553,s686218809,Accepted,"import os +import sys +from atexit import register +from io import BytesIO +sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size)) +sys.stdout = BytesIO() +register(lambda: os.write(1, sys.stdout.getvalue())) +input = lambda: sys.stdin.readline().rstrip('\r\n') +raw_input = lambda: sys.stdin.readline().rstrip('\r\n') + +a,b,c,d = (int(x) for x in input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s077801948,Accepted,"a, b, c, d = map(int, input().split()) +x = [a * c, a * d, b * c, b * d] +print(max(x)) +" +p02553,s778335970,Accepted,"a,b,c,d=map(int, input().split()) +print(b*d if a>=0 and d>=0 else d*a if a>=0 and d<=0 else b*d if b>=0 and a<=0 and c>=0 + else max(b*d, c*a) if a<=0 and b>=0 and c<=0 and d>=0 else c*a if a<=0 and b>=0 and d<=0 + else b*c if b<=0 and c>=0 else c*a )" +p02553,s908476993,Accepted,"#!/usr/bin/env python3 + +import sys +input=sys.stdin.readline + +a,b,c,d=map(int,input().split()) +ans=-10**18 +#x=0 or y=0 +if a<=0<=b or c<=0<=d: + ans=max(ans,0) +#x<0 and y>0 +ans=max(ans,b*c) +#x>0 and y>0 +ans=max(ans,b*d) +#x<0 and y<0 +ans=max(ans,a*c) +#x>0 and y<0 +ans=max(ans,a*d) +print(ans)" +p02553,s623356984,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*c,a*d,b*d)) +" +p02553,s917507434,Accepted,"a, b, c, d = map(int, input().split()) +x = a * c +y = a * d +z = b * c +w = b * d +xy = max(x,y) +zw = max(z, w) +print(max(xy, zw))" +p02553,s390526585,Accepted,"import sys + +sys.setrecursionlimit(10 ** 7) +input = sys.stdin.readline +f_inf = float('inf') +mod = 10 ** 9 + 7 + + +def resolve(): + a, b, c, d = map(int, input().split()) + res = max(a * c, b * c, a * d, b * d) + print(res) + + +if __name__ == '__main__': + resolve() +" +p02553,s200086292,Accepted,"a, b, c, d = map(int, input().split()) + +ac = a * c +ad = a * d +bc = b * c +bd = b * d + +max_a = max(ac, ad) +max_b = max(bc, bd) + +print(max(max_a, max_b)) +" +p02553,s168527419,Accepted,"a,b,c,d=map(int,input().split()) + +ls=[a*c,a*d,b*c,b*d] +print(max(ls))" +p02553,s489310736,Accepted,"a,b,c,d = map(int,input().split()) + +anslist = [] +anslist.append(a*c) +anslist.append(a*d) +anslist.append(b*c) +anslist.append(b*d) + +print (max(anslist))" +p02553,s523853778,Accepted,"def l_in(type_): return list(map(type_, input().split())) +def i_in(): return int(input()) +def m_in(type_): return map(type_, input().split()) +def r_in(n, type_): return [type_(input()) for _ in range(n)] +ans = None + +a, b, c, d = m_in(int) +ans = max(a*c, a*d, b*c, b*d) + +print(ans) +" +p02553,s901102355,Accepted,"#from collections import deque,defaultdict +printn = lambda x: print(x,end='') +inn = lambda : int(input()) +inl = lambda: list(map(int, input().split())) +inm = lambda: map(int, input().split()) +ins = lambda : input().strip() +DBG = True # and False +BIG = 10**18 +R = 10**9 + 7 +#R = 998244353 + +def ddprint(x): + if DBG: + print(x) + +a,b,c,d = inm() +print(max([a*c,a*d,b*c,b*d])) +" +p02553,s978022081,Accepted,"a,b,c,d=map(int,input().split()) +ans1=a*c +ans2=a*d +ans3=b*c +ans4=b*d +print(max(max(max(ans1,ans2),ans3),ans4))" +p02553,s052093012,Accepted," +def main(): + mx = (10 ** 21) * (-1) + a,b,c,d = map(int,input().split()) + for x in (a,b): + for y in (c,d): + mx = max(mx,x*y) + print(mx) + +main() +" +p02553,s376215407,Accepted,"a,b,c,d = map(int,input().split()) +k = max(a*c,b*d) +l = max(a*d,b*c) +print(max(k,l))" +p02553,s075038997,Accepted,"a, b, c, d = map(int, input().split()) +ary = [a * c, a * d, b * c, b * d] +print(max(ary))" +p02553,s741415446,Accepted,"a,b,c,d=map(int,input().split("" "")) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s270599126,Accepted,"import sys + +input = sys.stdin.readline + + +def main(): + a, b, c, d = map(int, input().split()) + p = b * d + q = a * c + r = a * d + s = b * c + print(max(p, q, r, s)) + + +if __name__ == '__main__': + main() +" +p02553,s801503018,Accepted,"a,b,c,d=map(int,input().split());print(max(a*c,a*d,b*c,b*d))" +p02553,s739783575,Accepted,"def main(): + a,b,c,d=map(int,input().split()) + p1=a*c + p2=a*d + p3=b*c + p4=b*d + x=max(p1,p2) + y=max(p3,p4) + print(max(x,y)) + +main() + " +p02553,s034584596,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s627933852,Accepted,"# 178B +a,b,c,d = list(map(int, input().split())) +e = a*c +f = a*d +g = b*c +h = b*d +ans=[e,f,g,h] +print(max(ans))" +p02553,s965034521,Accepted,"a, b, c, d = [int(x) for x in input().split()] + + +print(max(a * c ,a * d, b * c, b * d)) + +" +p02553,s890600312,Accepted,"a,b,c,d = map(int,input().split()) + +s=[] + +s.append(a*c) +s.append(a*d) +s.append(b*c) +s.append(b*d) +if (a<=0 and b>=0) or (c<=0 and d>=0): + s.append(0) +s.sort() + +print(s[-1])" +p02553,s942047919,Accepted,"a, b, c, d = map(int, input().split()) + +lst = [a*c, a*d, b*c, b*d] +print(max(lst))" +p02553,s851952630,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s208834012,Accepted,"a,b,c,d=map(int,input().split()) +L=[a*c,a*d,b*c,b*d] +print(max(L)) +" +p02553,s582203764,Accepted,"a, b, c, d = list(map(int, input().split(' '))) +mul = [a*c, a*d, b*c, b*d] +print(max(mul))" +p02553,s027364906,Accepted,"a, b, c, d = map(int, input().split()) + +ans_l = [a*c, a*d, b*c, b*d] +print(max(ans_l))" +p02553,s431247281,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s683888557,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s847497188,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s961521325,Accepted,"import sys, math +from functools import lru_cache +sys.setrecursionlimit(10**9) +MOD = 10**9+7 + +def input(): + return sys.stdin.readline()[:-1] + +def mi(): + return map(int, input().split()) + +def ii(): + return int(input()) + +def i2(n): + tmp = [list(mi()) for i in range(n)] + return [list(i) for i in zip(*tmp)] + +def main(): + a, b, c, d = mi() + print(max(a*c, a*d, b*c, b*d)) + + +if __name__ == '__main__': + main() +" +p02553,s833880026,Accepted,"x = list(map(int, input().split())) +a = x[0] +b = x[1] +c = x[2] +d = x[3] + +print(max(a*c, b*c, a*d, b*d)) +" +p02553,s584659184,Accepted,"a,b,c,d=map(int,input().split()) + +l=[a*c,a*d,b*c,b*d] + +print(max(l))" +p02553,s597231797,Accepted,"a, b, c, d = map(int, input().split()) +l = [] +for x in (a, b): + for y in (c, d): + l.append(x*y) +print(max(l)) +" +p02553,s720635783,Accepted,"import collections +import fractions +import itertools +import functools +import bisect +import heapq +import math + +def solve(): + a, b, c, d = map(int, input().split()) + ans = [ + a*c, + a*d, + b*c, + b*d + ] + print(max(ans)) + return 0 + +if __name__ == ""__main__"": + solve()" +p02553,s818907286,Accepted,"a, b, c, d = list(map(int, input().split())) +ac = a * c +ad = a * d +bc = b * c +bd = b * d +print(max(ac,ad,bc,bd))" +p02553,s946042234,Accepted,"a, b , c ,d = map(int,input().split(' ')) +one = a*c +two = a*d +three = b*c +four = b*d +line = [one, two, three, four] +print(max(line))" +p02553,s887226142,Accepted,"a, b, c, d = map(int, input().split()) +lis = [] +lis.append(a*c) +lis.append(a*d) +lis.append(b*c) +lis.append(b*d) +S = max(lis) +print(S)" +p02553,s331119395,Accepted,"a,b,c,d = map(int,input().split()) + +A = [0]*4 +A[0] = a*c +A[1] = a*d +A[2] = b*c +A[3] = b*d +print(max(A)) +" +p02553,s253623651,Accepted,"a, b, c, d = list(map(int, input().split())) + +_max = -float(""inf"") +for i in [a, b]: + for j in [c, d]: + if _max < i * j: + _max = i * j +print(_max)" +p02553,s096912555,Accepted,"def main(): + a, b, c, d = map(int, input().split()) + res = max(a*c, a*d, b*c, b*d) + print(res) + +if __name__ == ""__main__"": + main()" +p02553,s470537941,Accepted,"a, b, c, d = map(int, input().split()) +x = a * c +y = a * d +z = b * c +u = b * d +print(max([x, y, z, u]))" +p02553,s210177676,Accepted,"a,b,c,d = map(int, input().split()) +aa = [a,b] +bb = [c,d] +pri = [] + +for i in aa: + for j in bb: + pri.append(i*j) + +print(max(pri))" +p02553,s683770115,Accepted,"a,b,c,d = map(int,input().split()) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s517411973,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*d,b*c))" +p02553,s908119949,Accepted,"a, b, c, d = map(int, input().split()) +_max = max(a * c, a * d, b * c, b * d) + +print(_max) + +" +p02553,s821760211,Accepted,"a, b, c, d = [int(x) for x in input().split()] + +print(max(a*c, a*d, b*c, b*d))" +p02553,s127235201,Accepted,"a,b,c,d = map(int,input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s529467310,Accepted," +def main(): + a,b,c,d = [int(x) for x in input().split()] + + print(max(a*c, a*d, b*c, b*d)) + return + + +main()" +p02553,s484007104,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s873076992,Accepted,"read = lambda: list(map(int, input().split())) + +a, b, c, d = read() + +p = a * c +q = a * d +r = b * c +s = b * d +print(max(p, q, r, s))" +p02553,s674738588,Accepted,"import os +import sys +import math +import heapq +from decimal import * +from io import BytesIO, IOBase +from collections import defaultdict, deque + +def r(): + return int(input()) +def rm(): + return map(int,input().split()) +def rl(): + return list(map(int,input().split())) + + +a, b, c, d = rm() +e = [a*c, a*d, b*c, b*d] +print(max(e))" +p02553,s340905161,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s097992262,Accepted,"a, b, c, d = map(int, input().split()) + +x = a * c +y = a * d +z = b * c +w = b * d + +print(max(x, y, z, w))" +p02553,s690198513,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c, b*d, a*d, b*c))" +p02553,s715920382,Accepted,"import sys + +def dump(x): + print(x, file=sys.stderr) + +a,b,c,d = [int(i) for i in input().split()] +ans = max(a*c,a*d,b*c,b*d) +print(ans) + + + + + +" +p02553,s669671454,Accepted,"a, b, c, d = map(int, input().split()) +ans = max(a * c, a * d, b * c, b * d) +print(ans)" +p02553,s103248604,Accepted,"A,B,C,D=map(int, input().split()) + +print(max(A*C,A*D,B*C,B*D))" +p02553,s134901993,Accepted," +a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s258390409,Accepted,"a,b,c,d=map(int,input().split()) +x=[]*4 +x.append(a*c) +x.append(b*c) +x.append(a*d) +x.append(b*d) +x.sort() +print(x[-1])" +p02553,s643576883,Accepted,"a, b, c, d = map(int, input().split()) + +ms = [a*c, a*d, b*c, b*d] +#print('# ms:', ms) + +print(max(ms)) +" +p02553,s211852321,Accepted,"a,b,c,d = map(int,input().split()) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s727224423,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s364724115,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d,a*d,b*c))" +p02553,s783431221,Accepted,"l = list(map(int, input().split())) + +a = l[0] +b = l[1] +c = l[2] +d = l[3] + +ac = a * c +ad = a * d +bc = b * c +bd = b * d + +hantei = [ac, ad, bc, bd] + +print(max(hantei)) +" +p02553,s651696867,Accepted,"a,b,c,d = map(int,input().split()) + +l = [a*c,a*d,b*c,b*d] + +print(max(l))" +p02553,s948724308,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c , a*d , b * c , b*d))" +p02553,s914489449,Accepted,"def main(): + a, b, c, d = [int(e) for e in input().split()] + + print(max(a*c, a*d, b*c, b*d)) + + +if __name__ == '__main__': + main() +" +p02553,s537333061,Accepted,"a, b, c, d = map(int, input().split()) + +print(max(a*c, a*d, b*c, b*d))" +p02553,s159662683,Accepted,"a,b,c,d=map(int,input().split()) +print(max(a*c,d*b,b*c,a*d))" +p02553,s101958441,Accepted,"a,b,c,d = map(int,input().split()) + + +print(max(a*c,a*d,b*c,b*d))" +p02553,s031544566,Accepted,"#!/usr/bin/env python3 +# coding:utf-8 + +def main(): + a, b, c, d = map(int, input().split()) + stdOut = solve(a, b, c, d) + print(stdOut) + + +"""""" +方針 + + +"""""" + + +def solve(a, b, c, d): + ac = a * c + ad = a * d + bc = b * c + bd = b * d + l = [ac, ad, bc, bd] + m = max(l) + return m + + +if __name__ == ""__main__"": + main() +" +p02553,s170088966,Accepted,"a, b, c, d = map(int, input().split()) +print(max(a*c, a*d, b*c, b*d))" +p02553,s522727627,Accepted,"a,b,c,d=map(int, input().split()) +ans=a*c +ifans=a*d +if(ifans>ans): + ans=ifans +ifans=b*c +if(ifans>ans): + ans=ifans +ifans=b*d +if(ifans>ans): + ans=ifans +print(ans) +" +p02553,s133837091,Accepted,"a,b,c,d = map(int,input().split()) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s345197830,Accepted,"a, b, c, d = map(int, input().split()) +print(max([a*c, a*d, b*c, b*d]))" +p02553,s803362663,Accepted,"a, b, c, d = map(int, input().split()) + +ans = a * c +ans = max(a * d, ans) +ans = max(b * c, ans) +ans = max(b * d, ans) + +print(ans) + +" +p02553,s613975586,Accepted,"a,b,c,d = map(int,input().split()) +prod1 = a*c +prod2 = a*d +prod3 = b*c +prod4 = b*d +print(max(prod1,prod2,prod3,prod4))" +p02553,s704701151,Accepted,"A, B, C, D = [int(x) for x in input().split()] +print(max(A * C, A * D, B * C, B * D)) + +" +p02553,s742465940,Accepted,"a,b,c,d=map(int,input().split()) + +q=a*c +w=a*d +e=b*c +r=b*d + +ans=max(q,w,e,r) +print(ans)" +p02553,s340257526,Accepted,"from sys import stdin +a, b, c, d = [int(x) for x in stdin.readline().rstrip().split()] +A = [] +A.append(a * c) +A.append(a * d) +A.append(b * c) +A.append(b * d) +m = max(A) +print(m)" +p02553,s211795841,Accepted,"a, b, c, d = map(int, input().split()) +L = [a*c, a*d, b*c, b*d] +ans = max(L) +print(ans)" +p02553,s760700469,Accepted,"a = list(map(int, input().split())) +x = a[:2] +y = a[2:] +num = [] +for i in x: + for j in y: + num.append(i * j) + + +print(max(num))" +p02553,s969683027,Accepted,"a, b, c, d = map(int, input().split()) +l = [] +l.append(a * c) +l.append(a * d) +l.append(b * c) +l.append(b * d) +print(max(l))" +p02553,s396786747,Accepted,"a, b, c, d = [int(x) for x in input().split()] + +print(max(a*d, a*c, b*d, b*c)) + " +p02553,s897854321,Accepted,"a,b,c,d=map(int,input().split()) +x = max(a*c,b*d,a*d,b*c) +print(x)" +p02553,s297122869,Accepted," +def solve(): + a,b,c,d=[int(v) for v in input().split()] + print(max(a*c, a*d, b*c, b*d)) + +t = 1 #int(input()) +for _ in range(t): + solve() +" +p02553,s861470987,Accepted,"a, b, c, d = [int(t) for t in input().split()] +print(max([b*d, a*c, a*d, b*c]))" +p02553,s441610390,Accepted,"a, b, c, d= map(int,input().split()) +print(max(a * c, a * d, b * c, b * d))" +p02553,s897150097,Accepted,"a, b, c, d = map(int,input().split()) +print(max(a*d,b*c,b*d,a*c)) +" +p02553,s545598280,Accepted,"a,b,c,d=map(int,input().split()) +ans=max(a*c,b*d) +ans=max(ans,a*d) +ans=max(ans,b*c) +print(ans)" +p02553,s470336817,Accepted,"a, b, c, d = map(int, input().split()) + +answer = max(a*c, a*d, b*c, b*d) +print(answer)" +p02553,s548808458,Accepted,"a,b,c,d=map(int,input().split()) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s180583179,Accepted,"a,b,c,d = map(int,input().split("" "")) +print(max([a*c,a*d,b*c,b*d]))" +p02553,s771238176,Accepted,"a,b,c,d = map(int,input().split()) +print(max(a*c,a*d,b*c,b*d))" +p02553,s966790934,Accepted,"a,b,c,d=map(int,input().split()) +Ans=max(a*c,a*d,b*c,b*d) +if (a<0 and b>=0) or (c<0 and d>=0): + Ans=max(Ans,0) +print(Ans)" +p02553,s633105179,Accepted,"a, b, c, d = list(map(int, input().split())) + +print(max(a*c,a*d,b*c,b*d))" +p02553,s646361751,Accepted,"# input +a, b, c, d = map(int, input().split()) + +# process +ans = -10**18 +t = a*c +if ans < t: + ans = t +t = a*d +if ans < t: + ans = t +t = b*c +if ans < t: + ans = t +t = b*d +if ans < t: + ans = t + +# output +print(ans) +" +p02553,s013867507,Accepted,"a, b, c, d = map(int, input().split()) + +ans_candi = [] + +ans_candi.append(a*c) +ans_candi.append(a*d) +ans_candi.append(b*c) +ans_candi.append(b*d) + +print(max(ans_candi))" +p02553,s028486983,Accepted,"a,b,c,d=map(int,input().split()) +ans=a*c +ans=max(ans,a*d) +ans=max(ans,b*c) +ans=max(ans,b*d) +print(ans) +" +p02553,s182892623,Accepted,"a,b,c,d=map(int,input().split()) +x=-10**18 +for i in [a,b]: + for j in [c,d]: + if i*j>x: + x=i*j +print(x)" +p02553,s409146882,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans=[a*c,a*d,b*c,b*d] +if ((a<0 and b>0) and d<0) or ((c>0 and d>0) and b<0): + print(0) +else: + print(max(ans))" +p02553,s101775036,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ab = a +cd = c +ab_flag = 0 +cd_flag = 0 + +if abs(a) < abs(b): + ab = b + ab_flag = 1 + +if abs(c) < abs(d): + cd = d + cd_flag = 1 + +ans = ab * cd + +if ans < 0: + if a > 0: + ans = a * d + elif c > 0: + ans = b * c + elif a > 0 and d > 0: + ans = b * d + elif c > 0 and b > 0: + ans = d * b + +print(str(ans)) +" +p02553,s433087986,Wrong Answer,"a,b,c,d=list(map(int,input().split())) + +if b>0 and d>0: + + one=b + two=c +elif b>=0 and d>=0: + + one=a + two=c +else: + if b>0: + + one=a + two=d + else: + + one=b + two=c + +print(one*two)" +p02553,s623256582,Wrong Answer,"a,b,c,d = map(int, input().split()) +if a >=0: + if c > 0: + print(b * d) + elif d < 0: + print(a * d) + else: + print(b*d) +else: + if c > 0: + print(b * c) + elif d < 0: + print(a * c) + else: + print(a * c)" +p02553,s877635207,Wrong Answer,"a = [int(x) for x in input().split()] +print(max(a[0]*a[2],a[1]*a[3]))" +p02553,s458291697,Wrong Answer,"a,b,c,d = map(int, input().split()) +x = a +y = c +max = x * y +if b <= 0: + print(max) +else: + for x in range(a,b + 1): + for y in range(c,d + 1): + if x * y > max: + max = x * y + print(max)" +p02553,s585677432,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*c >= b*d: + print(a*c) +elif a*d >= b*d: + print(a*d) +elif b*c >= b*d: + print(b*c) +else: + print(b*d)" +p02553,s844990479,Wrong Answer,"a,b,c,d = map(int,input().split()) +print(max(a*c,b*d,a*d))" +p02553,s166097857,Wrong Answer,"a, b, c, d = map(int, input().split()) +L = [a*b, a*c, a*d, b*c, b*d, c*d] +print(max(L))" +p02553,s768452131,Wrong Answer,"a, b, c, d = map(int, input().split()) + +x=0 +y=0 +if b < 0: + x=b +else: + x=a + +if d < 0: + y=d +else: + y=c + +print(x*y)" +p02553,s940210898,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a<=0 and b<=0 and c<=0 and d<=0: + print(a*c) +elif a>=0 and b>=0 and c>=0 and d>=0: + print(b*d) +else: + print(b*d)" +p02553,s971734945,Wrong Answer,"def resolve(): + a, b, c, d = list(map(int, input().split())) + + if b > 0 and d > 0: + print(b * d) + elif b > 0 and d < 0: + print(d * a) + elif b < 0 and d > 0: + print(c * b) + else: + print(a * c) + +resolve()" +p02553,s829626117,Wrong Answer,"a,b,c,d = map (int, input ().split ()) +if b < 0 and d < 0: + print (a*c) +elif b > 0 and d > 0: + print (b*d) +else: + if a < 0 and c < 0: + print (a*c) + elif a < 0: + print (b*c) + else: + print (a*d)" +p02553,s028386806,Wrong Answer,"def resolve(): + a, b, c, d = list(map(int, input().split())) + ans = -10 ** 9 + + for x in (a, b): + for y in (c, d): + ans = max(ans, x * y) + if (b == 0 and d > 0) or (b > 0 and d == 0): + ans = 0 + + print(ans) + +resolve()" +p02553,s806843631,Wrong Answer,"import sys +from itertools import combinations +input = sys.stdin.readline + +a,b,c,d = map(int,input().split()) +h = [] +h.append(a) +h.append(b) +h.append(c) +h.append(d) + +li = list(combinations(h,2)) +answer = -10000000001 +for i in li: + answer = max(answer,i[0]*i[1]) +print(answer)" +p02553,s272252133,Wrong Answer,"#!/usr/bin/env python3 +a,b,c,d=map(int,input().split()) +if b>0 and d>0: + print(b*d) +elif b<0 and c>0: + print(b*c) +elif a>0 and d<0: + print(a*d) +else: + print(a*c)" +p02553,s275870227,Wrong Answer,"a,b,c,d = map(int,input().split()) +aa = abs(a) +bb = abs(b) +cc = abs(c) +dd = abs(d) +if a > 0 and c > 0: + print(b*d) +elif b < 0 and d < 0: + print(a*c) +elif a == 0 or b == 0 or c == 0 or d == 0: + print(0) +elif b < 0: + print(b*c) +else: + print(a*d)" +p02553,s164076393,Wrong Answer,"a,b,c,d=map(int,input().split()) +x=[] +x.append(max(a,b)*max(c,d)) +x.append(max(a,b)*min(c,d)) +x.append(min(a,b)*max(c,d)) +x.append(min(a,b)*max(c,d)) +print(max(x))" +p02553,s385069301,Wrong Answer,"a, b, c, d = map(int,input().split()) +x = 0 +y = 0 +if a >= 0 and c >= 0: + x = b + y = d +elif a >= 0 and d < 0: + x = a + y = d +elif b < 0 and c >= 0: + x = b + y = c +elif b <= 0 and d <= 0: + x = a + y = c + +print(x * y) +" +p02553,s732618416,Wrong Answer,"a,b,c,d = map(int,input().split()) + +ans = -10**9 + +ans = max(ans,a*c) +ans = max(ans,a*d) +ans = max(ans,b*c) +ans = max(ans,b*d) + +print(ans)" +p02553,s313578443,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans=[a*b,a*c,a*d,b*c,b*d,c*d,0] +print(max(ans))" +p02553,s480799716,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0: + if c>=0 or d>=0: + print(b*d) + else: + print(a*d) +elif b<=0: + if d<=0: + print(a*c) + else: + if a*c <= b*d: + print(b*d) + else: + print(a*c)" +p02553,s111712342,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if a >= 0 and c >= 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif a < 0 and c < 0: + if b<0 or d<0: + print(a*c) + elif abs(a)>=abs(b) and abs(c)>=abs(d): + print(a*c) + else: + print(b*d) +elif (b<0 and c>=0): + print(b*c) +elif (a>=0 and d<0): + print(a*d) +else: + print(b*d)" +p02553,s727722628,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b>0 and d>0: + print(b*d) +else: + if b<=0 and d<=0: + print(min(a,b)*min(c,d)) + elif a<=0 or b<=0: + print(max(a,b)*min(c,d)) + else: + print(min(a,b)*max(c,d))" +p02553,s455743530,Wrong Answer,"a, b, c, d = map(int, input().split()) + +m = -9999 + +ac = a * c +if ac >= m: + m = ac + +ad = a * d +if ad > m: + m = ad + +bc = b * c +if bc >= m: + m = bc + +bd = b * d +if bd >= m: + m = bd + +print(m) +" +p02553,s675095670,Wrong Answer,"def main(): + a,b,c,d = map(int,input().split()) + + ans = -1 * 10**10 + + for i in (a,b): + for j in (c,d): + if i*j > ans: + ans = i*j + print(ans) + +if __name__ == '__main__': + main()" +p02553,s592116274,Wrong Answer,"n = list(map(int, input().split())) +print(n[1]*n[3])" +p02553,s166587236,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans=max(a*c,b*d,a*d,b*d) +print(ans)" +p02553,s078915409,Wrong Answer,"a, b, c, d = map(int, input().split()) + + +if a >= 0 and b >= 0 and c < 0 and d < 0: + print(min(a, b) * max(c, d)) +elif a < 0 and b < 0 and c >= 0 and d >= 0: + print(min(c, d) * max(a, b)) +else: + print(max(abs(a), abs(b)) * max(abs(c), abs(d)))" +p02553,s520293619,Wrong Answer,"a = list(map(int,input().split())) + +max = a[0]*a[2] +if max < a[0]*a[3]: + max = a[0]*a[3] +if max < a[1]*a[2]: + max = a[1]*a[2] +if max < a[1]*a[3]: + max < a[1]*a[3] + +print(max)" +p02553,s720797658,Wrong Answer,"a,b,c,d=map(int,input().split()) +x,y=0,0 +if a>b: + x=a +else: + x=b +if c>d: + y=c +else: + y=d +print(x*y)" +p02553,s800093453,Wrong Answer,"a = sorted(list(map(int, input().split()))) +print(max( + a[0] * a[1], a[-2] * a[-1] +))" +p02553,s438411725,Wrong Answer,"num = input().split() +a = int(num[0]) +b = int(num[1]) +c = int(num[2]) +d = int(num[3]) +if a >= 1 and c >= 1: + print(b * d) +elif a <= 0 and c <= 0: + print(a * c) +elif b <= 1: + print(b * c) +elif d <= 1: + print(a * d) +" +p02553,s481275677,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] +m1 = max(a,b) +m2 = max(c,d) +if(m1<=0 and m2<=0): + print(min(a,b)*min(c,d)) +elif(m1>0 and m2<=0): + print(min(a,b)*m2) +elif(m1<=0 and m2>0): + print(m1*min(c,d)) +else: + print(m1*m2)" +p02553,s552098854,Wrong Answer,"a,b,c,d = map(int, input().split()) +if a>0 and c>0: print(b*d) +else: + if b>0 and d>0: + print(b*d) + elif b<0 and d>0: + print(max(a,b)*min(c,d)) + elif d<0 and b>0: + print(min(a,b)*max(c,d)) + else: + print(min(a,b)*min(c,d)) +" +p02553,s495605369,Wrong Answer,"a,b,c, d = map(int,input().split()) + +print(max(a*c,b*d,b*c,a*d,0))" +p02553,s442410901,Wrong Answer,"a,b,c,d=map(int,input().split()) +M=0 + +if a>0: + if d<0: + M=a*d + else: + M=b*d + +if a<=0 and b>0: + if d<=0: + M=a*c + if d>0: + if c<0: + M=max(b*d,a*c) + else: + M=b*d + +else: + if c>0: + M=b*c + else: + M=a*c +print(M) + " +p02553,s659436958,Wrong Answer,"a,b,c,d = map(int,input().split()) + +ans = [] +ans.append(a*b) +ans.append(a*d) +ans.append(b*c) +ans.append(b*d) + +print(max(ans)) + +" +p02553,s423301717,Wrong Answer,"a,b,c,d=map(int,input().split( )) +print(b*d)" +p02553,s374445409,Wrong Answer,"a,b,c,d=map(int,input().split()) +x=0 +if b>=0 and d>=0: + x=b*d +elif b>=0 and d<0: + x=a*d +elif b<0 and d>=0: + x=b*c +elif b<0 and d<0: + x=a*c + +print(x)" +p02553,s131788488,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d))" +p02553,s668120681,Wrong Answer,"a,b,c,d = map(int, input().split()) +if b*d > 0: + print(b*d) +else: + print(-1*min(abs(a),abs(b))*min(abs(c),abs(d)))" +p02553,s671533643,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ab = a +cd = c +ab_flag = 0 +cd_flag = 0 + +if abs(a) < abs(b): + ab = b + ab_flag = 1 + +if abs(c) < abs(d): + cd = d + cd_flag = 1 + +ans = ab * cd + +if ans < 0: + if a > 0: + ans = a * d + elif c > 0: + ans = b * c + +print(str(ans))" +p02553,s663344524,Wrong Answer,"a, b, c, d = [int(e) for e in input().split("" "")] +if((0 <= a or 0 <= c) and (0 <= b and 0 <= d)): + #print(""A"") + print(b * d) +elif((a < 0 and b < 0) and (0 <= c and 0 <= d)): + #print(""B"") + print(b * c) +elif((c < 0 and d < 0) and (0 <= a and 0 <= b)): + #print(""C"") + print(d * a) +elif(a < 0 and b < 0 and c < 0 and d < 0): + #print(""D"") + print(a * d) +elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)): + print(max((a * c), (b * d)))" +p02553,s922976670,Wrong Answer,"inputs = [int(x) for x in input().split()] +a = inputs[0] +b = inputs[1] +c = inputs[2] +d = inputs[3] + +# Avoid using 0 +if a == 0: + a += 1 +if b == 0: + b -= 1 +if c == 0: + c += 1 +if d == 0: + d -= 1 + +if (a > 0 and b > 0 and c < 0 and d < 0) or (a < 0 and b < 0 and c > 0 and d > 0): + # Return the max negative value + print(-(min(abs(a), abs(b)) * min(abs(c), abs(d)))) +else: + # Return the max positive value + print(max(a * c, b * d))" +p02553,s528321168,Wrong Answer,"a = list(map(int,input().split())) +max = -10 ** 11 +for i in range(2): + for j in range(2,4): + p = a[i] * a[j] + #print(p) + if abs(max) < abs(p) and 0 < p: + max = p + elif abs(p) < abs(max) and 0 > p: + max = p +print(max)" +p02553,s860285215,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if 0 <= a or 0 <= c: + if d < 0: + print(a*d) + elif b < 0: + print(b*c) + else: + print(b*d) +elif 0 <= b or 0 <= d: + print(a*c)" +p02553,s546506275,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a>=b: + x=a +elif a=d: + y=c +elif d>c: + y=d +print(x*y)" +p02553,s796195522,Wrong Answer,"a, b, c, d = map(int,input().split()) +ans = 0 +if a*c >= 0 and b*d >= 0: + ans = max(a*c,b*d) +else: + ans = max(a*d,b*c) +print(ans) +" +p02553,s332140068,Wrong Answer,"a, b, c, d = list(map(int, input().split())) + +if b <= 0 and d <= 0: + print(a*c) +elif b < 0 and d >= 0: + print(max(c, 1)*b) +elif b >= 0 and d < 0: + print(max(a, 1)*d) +else: + print(b*d)" +p02553,s926819462,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if a < 0 and b < 0 : + print(b*c) +elif a < 0 and b >=0: + if c < 0 and d < 0: + print(a*c) + elif c < 0 and d >=0: + if a * c < b * d : + print(b*d) + else : + print(a*c) + else : + print(b*d) +elif a>=0 and b >=0: + if c < 0 and d < 0: + print(a*d) + else : + print(b*d)" +p02553,s167651483,Wrong Answer,"li = list(map(int,input().split())) + +a = li[0] +b = li[1] +c = li[2] +d = li[3] + +ac = a * c +bc = b * c +ad = a * d +bd = a * d +result = ac +if result < bc: + result = bc +elif result < ad: + result = ad +elif result < bd: + result = bd +elif a < 0 and 0 < b and result < 0: + result = 0 +elif c < 0 and 0 < d and result < 0: + result = 0 +print(result)" +p02553,s224986683,Wrong Answer,"a,b,c,d = map(int,input().split()) + +xp = True if a + b > 0 else False +yp = True if c + d > 0 else False + +if xp: + if yp: + ans = b * c + else: + ans = a * d +else: + if yp: + ans = b * c + else: + ans = b * d + +print(ans)" +p02553,s824453161,Wrong Answer,"a,b,c,d = map(int, input().split()) +if b*d>0: print(b*d) +else: + if b<0: + print(max(a,b)*min(c,d)) + elif d<0: + print(min(a,b)*max(c,d)) + else: + print(min(a,b)*min(c,d))" +p02553,s851677390,Wrong Answer,"array = input().split() + +a = int(array[0]) +b = int(array[1]) +c = int(array[2]) +d = int(array[3]) + +if b > 0 and d > 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif b <= 0 and d > 0: + print(b * c) +elif b > 0 and d <= 0: + print(a * d)" +p02553,s458218503,Wrong Answer,"# -*- coding: utf-8 -*- +a, b, c, d = map(int, input().split()) +ans = max(a*c, b*d) +ans = max(ans, a*d) +ans = max(ans, b*d) +print(ans)" +p02553,s089603176,Wrong Answer,"a,b,c,d=input().split() +if int(a)<0 and int(c)<0: + if int(a)*int(c)0 and int(c)>0: + print(int(b)*int(d)) +elif int(a)<0 and int(b)<0: + print(int(b)*int(c)) +elif int(c)<0 and int(d)<0: + print(int(a)*int(d))" +p02553,s191317132,Wrong Answer,"a,b,c,d = (int(x) for x in input().split()) +if b and d >= 0: + if a*c > b*d : + print(a*c) + else: + print(b+d) +elif b and d < 0: + print(a*c) +elif b >=0 and d < 0: + if a*d > b*c : + print(a*d) + else: + print(b*c) +elif b <0 and d >= 0: + if a*d > b*c : + print(a*d) + else: + print(b*c)" +p02553,s652146664,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*c >= b*d: + if a*c >= a*d: + if a*c >= b*c: + print(a*c) +if a*d >= b*d: + if a*d >= b*c: + print(a*d) +if b*c >= b*d: + print(b*c) +else: + print(b*d) +" +p02553,s429290856,Wrong Answer,"a, b, c, d =map(int, input().split()) + +if 0 < b and 0 < d: + print(b*d) +elif 0 > b and 0 < d: + print(b*c) +elif 0 < b and 0 > d: + print(a*d) +else: + print(a*c) +" +p02553,s107767417,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max([a*c,b*c,a*d,c*d])); +" +p02553,s243304025,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b < 0 and d < 0: + print(c * a) + +elif a > 0 and b > 0: + print(a * b) + +elif b < 0 and d > 0: + print(c * b) + + +elif b > 0 and d < 0: + print(d * a) +" +p02553,s757115476,Wrong Answer,"a,b,c,d = map(int,input().split()) +if b*c >= b*d: + print(b*c) +elif a*c >= b*d: + print(a*c) +elif a*d >= b*d: + print(a*d) +else: + print(b*d) +" +p02553,s454965217,Wrong Answer,"a, b, c, d = map(int,input().split()) + +if (b > 0 and d > 0): + print(b * d) +elif (b < 0 and c > 0): + print(b * c) +elif (a > 0 and d < 0): + print(a * d) +else: + print(a * c)" +p02553,s272800941,Wrong Answer,"a,b,c,d = map(int,input('').split(' ')) + +print(b*d)" +p02553,s885887410,Wrong Answer,"a, b, c, d = input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +def m(): + if a<=b and c<=d: + max=a*b+c*d + print(max) + else: + print(""plese press again"") +m() +" +p02553,s005093798,Wrong Answer,"a,b,c,d=list(map(int, input(""Enter a multiple value: "").split())) +prod=[] + +prod.append(a*c) +prod.append(a*d) +prod.append(b*c) +prod.append(b*d) + +print(max(prod))" +p02553,s045482842,Wrong Answer,"a,b,c,d = map(int,input().split()) +if 0 <= a and 0 <= c: + print(b*d) +elif 0 <= a and d <= 0: + print(a*d) +elif b <= 0 and 0 <= c: + print(b*c) +elif b <= 0 and d <= 0: + print(a * c)" +p02553,s728191221,Wrong Answer,"import sys +a,b,c,d=map(int,input().split()) +if max(a,b)>=0 and max(c,d)>=0: + print(max(a,b)*max(c,d)) + sys.exit() +elif max(a,b)<=0 and max(c,d)<=0: + print(min(a,b)*min(c,d)) + sys.exit() +elif max(a,b)>=0 and max(c,d)<=0: + print(min(a,b)*max(c,d)) + sys.exit() +elif max(a,b)<=0 and max(c,d)>=0: + print(max(a,b)*min(c,d)) + sys.exit() +else: + pass" +p02553,s562929857,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b <= 0 and d <= 0: + print(c * a) + +elif b > 0 and d > 0: + print(b * d) + +elif b < 0 and d > 0: + if c > 0: + print(c * b) + else: + print(a * c) + +elif b > 0 and d < 0: + if a > 0: + print(a * d) + else: + print(a * c) + +else: + print(b * d) +" +p02553,s469039348,Wrong Answer,"[a, b, c, d] = [int(inp) for inp in input().split()] +print(max([a * c, b * d]))" +p02553,s510670743,Wrong Answer,"l=list(map(int,input().split())) +if l[1]<0 and l[3]<0: + print(l[0]*l[2]) +elif l[1]<0: + print(l[1]*l[2]) +elif l[3]<0: + print(l[0]*l[3]) +else: + print(l[1]*l[3]) + +" +p02553,s062961876,Wrong Answer,"a, b, c, d = map(int,input().split()) + +if b < 0 and d < 0: + print(a*c) + +elif a > 0 and b > 0 and d < 0: + print(a*d) + +elif b < 0 and c > 0 and d > 0: + print(b*c) + +elif a < 0 and b > 0 and c < 0 and d > 0: + print(b*d) + +elif a < 0 and b > 0 and d < 0: + print(a*c) + +else: + print(b*d)" +p02553,s944170060,Wrong Answer,"import sys +import collections as cc +import math as mt +I=lambda:list(map(int,input().split())) +a,b,c,d=I() +print(max(b*d,a*c,a*d,b*d)) +" +p02553,s305507381,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a * c) +elif a >= 0 and c >= 0: + print(b * d) +elif b <= 0 and c >= 0: + print(b * c) +elif d <= 0 and a >= 0: + print(a * d) +else: + print(b * d) +" +p02553,s410333458,Wrong Answer,"a,b,c,d=map(int, input().split()) + +x=a if abs(a)>abs(b) else b +y=c if abs(c)>abs(d) else d + +if ( (x>0 and y>0) or (x<0 and y<0) ): + print (x*y) +else : + x=a if abs(a) 0 and d > 0: + print(b * d) + +elif b < 0 and d > 0: + if c > 0: + print(c * a) + else: + print(b * c) + +elif b > 0 and d < 0: + if a > 0: + print(a * c) + else: + print(a * d) +" +p02553,s039903220,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans=[a*c,a*d,b*c,b*d] +if ((a<=0 and b>=0) and d<=0) or ((c>=0 and d>=0) and b<=0): + print(0) +else: + print(max(ans))" +p02553,s158101650,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b > 0 and d > 0: + print(max(b*d, a*c)) +elif b > 0 and d < 0: + print(a*d) +elif b < 0 and d > 0: + print(b*c) +elif b <= 0 and d <= 0: + print(a*c)" +p02553,s912405797,Wrong Answer,"a,b,c,d = map(int,input().split()) + +ans = 0 + +if ans < a*c: + ans = a*c + +if ans < a*d: + ans = a*d + +if ans < b*c: + ans = b*c + +if ans < b*d: + ans = b*d + +print(ans)" +p02553,s830247102,Wrong Answer,"a = list(map(int,input().split())) +a_1,a_2 = [],[] +a_1.append(a[0]) +a_1.append(a[1]) +a_2.append(a[2]) +a_2.append(a[3]) + +print(a_1,a_2) +max_a = -(10**30) +for i in a_1: + for l in a_2: + if(i*l > max_a): + max_a = i*l + +print(max_a) + +" +p02553,s258095478,Wrong Answer,"#!/usr/bin/env python3 +import sys +sys.setrecursionlimit(1000000) +from collections import deque + +# スペース区切りの整数の入力 +a, b, c, d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a*c) +elif b < 0 and d > 0: + print(b*c) +elif b >0 and d < 0: + print(a*d) +else: + print(b*d)" +p02553,s021885228,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d,a*d,b*d))" +p02553,s362293366,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b <= 0 and d <= 0: + print(c * a) + +elif b > 0 and d > 0: + print(b * d) + +elif b < 0 and d > 0: + if c > 0: + print(c * d) + else: + print(b * d) + +elif b > 0 and d < 0: + if a > 0: + print(a * d) + else: + print(a * c) +" +p02553,s533320560,Wrong Answer,"a,b,c,d=map(int,input().split()) +list1=[a,b] +list2=[c,d] +ans=-1*10**10 +tmp=0 +for i in list1: + for j in list2: + tmp=i*j + if ans 0: + print(b*c) + else: + print(a*c) +elif a < 0: + if d < 0: + print(a*c) + elif c < 0: + print(max(a*c,b*d)) + else: + print(b*d) +else: + if d < 0: + print(b*c) + else: + print(b*d) + +" +p02553,s904828488,Wrong Answer,"a,b,c,d = map(int,input().split()) +ans = [] +for i in c,d: + ans.append(a*i) +for j in c,d: + ans.append(b*i) + +print(max(ans))" +p02553,s796455375,Wrong Answer,"def main(): + a,b,c,d = map(int, input().split()) + if b <= 0 and d <= 0: + print(a*c) + elif b >=0 and d <= 0: + print(a*d) + elif b <= 0 and d >= 0: + print(b*c) + elif b>=0 and d >=0: + print(b*d) + + +if __name__ == ""__main__"": + main()" +p02553,s387418292,Wrong Answer,"a,b,c,d = map(int,input().split()) +if(b<0 or d<0): + if(b>=0 or d>=0): + print(0) + else: + print(a*b) +else: + print(b*d)" +p02553,s089464732,Wrong Answer,"a,b,c,d=map(int,input().split(' ')) +if a>=0: + x=b + y=d + ans=b*d +elif a<=0 and b>=0: + if c>=0: + x=b + y=d + ans=b*d + elif c<=0 and d>=0: + ans=max(a*c,b*d) + else: + ans=a*c +else: + if c>=0: + ans=b*c + else: + ans=a*c +print(ans)" +p02553,s921812185,Wrong Answer,"a,b,c,d = map(int,input().split()) +mx = 0 + + +print(b*d)" +p02553,s605234194,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans=-10**9 + +if b<=0 and d<=0: + ans=a*c +elif b>0 and d>0: + ans=b*d +elif b>0 and d<=0: + ans=a*d +elif b<=0 and d>0: + ans=b*c + +print(ans)" +p02553,s815761194,Wrong Answer,"import numpy as np + +a, b, c, d = map(int, input().split()) + +print(max(np.abs([(a*c), (a*d), (b*c), (b*d)])))" +p02553,s660098139,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*c,a*d,b*d,0))" +p02553,s581042838,Wrong Answer,"a,b,c,d = map(int,input().split()) + +print(max(a*b,c*d,b*c,a*d))" +p02553,s381812581,Wrong Answer,"import sys +input = sys.stdin.readline + +a,b,c,d = map(int,input().split()) +if a >= 0 and c >= 0: + print(b*d) +elif a >= 0 and c < 0 and d >= 0: + print(b*d) +elif a >= 0 and c < 0 and d < 0: + print(a*d) +elif a < 0 and c < 0: + print(a*c) +elif a < 0 and b >= 0 and c >=0: + print(b*d) +elif a < 0 and b < 0 and c >= 0: + print(b * c) + +" +p02553,s052828696,Wrong Answer,"a,b,c,d=map(int,input().split()) +ac=a*c +ad=a*d +bc=b*c +bd=b*d +if max(ac,ad,bc,bd)<0: + if a<0=0: + if c > 0: + print(b * d) + elif d < 0: + print(a * d) + else: + print(b*d) +else: + if c > 0: + print(b * c) + elif d < 0: + print(b * d) + else: + print(b * c)" +p02553,s226095019,Wrong Answer,"a, b, c, d = [int(t) for t in input().split()] +print(max([b*d, a*c, a*d, b*d]))" +p02553,s015305056,Wrong Answer,"def main(): + a,b,c,d=(int(x) for x in input().split()) + if b>0 and d>0: + x=b + y=d + print(x*y) + elif a<=0 and c<=0: + x=a + y=c + print(x*y) + elif b>d: + x=a + y=d + print(x*y) + elif b=0: + print(a*d) +elif b>=0 and d<=0: +"""""" +A=abs(a) +B=abs(b) +C=abs(c) +D=abs(d) + +check_1 = a*c +check_2=a*d +check_3=b*c +check_4=b*d + +if check_1<=check_2: + check_1=check_2 + +if check_3<=check_4: + check_3=check_4 + +if check_1<=check_3: + print(check_1) +else: + print(check_2) +" +p02553,s725847014,Wrong Answer,"a,b,c,d = map(int,input().split()) +if b*c >= b*d: + print(b*c) +elif a*d >= b*d: + print(a*d) +elif a*c >= b*d: + print(a*c) +else: + print(b*d) +" +p02553,s455226859,Wrong Answer,"a,b,c,d = map(int,input().split()) +e = a*c +f = a*d +g = b*c +h = b*d +xy =[e,f,g,h] +max(xy)" +p02553,s437714217,Wrong Answer,"x = input() +x = [int(i) for i in x.split("" "")] +y = x[1] * x[3] +print(y)" +p02553,s460030114,Wrong Answer,"a,b,c,d = input().split() +a = int(a) +b = int(b) +c = int(c) +d = int(d) +if d < 0 and b > 0: + if d > 0: + d = c + else: + b = a +if d > 0 and b < 0: + if d > 0: + d = c + else: + b = a +if a < 0 and c < 0: + d = c + b = a +print(b * d)" +p02553,s394301952,Wrong Answer,"arr = list(map(int,input().split())) + +for i in range(2): + for j in range(2,4): + if i == 0: + ans = arr[i]*arr[j] + else: + ans = max(ans, arr[i]*arr[j]) + +print(ans)" +p02553,s537811737,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*d > b*d: + print(a*d) +elif a*c > b*d: + print(a*c) +elif b*c > b*d: + print(b*c) +else: + print(b*d) +" +p02553,s643490464,Wrong Answer,"lists = list(map(int,input().split())) +lists.sort() +a = lists[0] +b = lists[1] +c = lists[2] +d = lists[3] +e = a*b +f = c*d +if a*b>=c*d: + print(a*b) +else: + print(c*d) + " +p02553,s213484075,Wrong Answer,"a,b,c,d=input().split() +a = int(a) +b = int(b) +c = int(c) +d = int(d) + +z1 = a*b +z2 = a*c +z3 = b*c +z4 = b*d + +l = [z1, z2, z3, z4] +max_value = max(l) +print(max_value)" +p02553,s345047343,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b>0 and d>0: + print(b*d) +elif b<=0 and d>0: + print(c*b) +elif b>0 and d<=0: + print(a*d) +else: + print(a*c)" +p02553,s815765701,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(min([a*c,a*d,b*c,b*d]))" +p02553,s935529386,Wrong Answer,"a,b,c,d = map(int,input().split()) +if 3*a*c > (a*d+b*c+b*d): + print(a*c) +elif 3*a*d > (a*c+b*c+b*d): + print(a*d) +elif 3*b*c > (a*c+a*d+b*d): + print(b*c) +else: + print(b*d)" +p02553,s368248610,Wrong Answer," +[a,b,c,d] = list(map(int,input().split())) + +if b>0 and d>0: + out=b*d + +elif b<=0 and d<=0: + out=a*c + +else: + if b>=0 and d<0: + if a<0: + out=a*c + else: + out=a*d + else: + if c<0: + out=a*c + else: + out=b*c + +print(out)" +p02553,s583852602,Wrong Answer,"import numpy as np +num = list(map(int, input().split())) +a,b,c,d = num[0],num[1],num[2],num[3] + +mat = np.array([]) +for i in [a,b]: + for j in [c,d]: + mat = np.append(mat, i*j) +print(int(np.max(mat))) + " +p02553,s066297743,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b<=0 and d<=0: + print(a*c) +elif b<=0: + print(b*c) +elif d<=0: + print(d*a) +else: + print(b*d) + " +p02553,s007473518,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if b<0 and d<0: + print(max(b*d,a*c)) +elif b>=0 and d>=0: + print(max(b*d,a*c)) +else: + print(max(b*c,a*d)) +" +p02553,s855732373,Wrong Answer,"a,b,c,d=map(int,input().split()) +List=[] +for i in range(a,b+1): + for j in range(c,d+1): + List.append(i*j) +max(List)" +p02553,s441252285,Wrong Answer,"a, b, c, d = map(int, input().split()) + +a_b = [a, b] +c_d = [c, d] + +if max(a_b) > 0 and max(c_d) > 0: + print(max(a_b) * max(c_d)) +elif max(a_b) > 0 and max(c_d) <= 0: + print(min(a_b) * max(c_d)) +elif max(c_d) > 0 and max(a_b) <= 0: + print(min(c_d) * max(a_b)) +elif max(a_b) <= 0 and max(c_d) <= 0: + print(min(a_b) * min(c_d))" +p02553,s991294135,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b*d>=0: + if b>0 and d>0: + print(b*d) + else: + print(a*c) + +else: + if b<0: + print(b*c) + if d<0: + print(a*d) + " +p02553,s655732331,Wrong Answer,"a,b,c,d = map(int, input().split()) + +x = max(a, b) * max(c, d) +y = min(a, b) * min(c, d) + +print(max(x, y)) +" +p02553,s743645550,Wrong Answer,"a=list(map(int,input().split())) + +if a[0]>=0 and a[2]>=0: + print(a[1]*a[3]) + +elif a[1]<=0 and a[3]<=0: + print(a[0]*a[2]) + +elif a[1]<=0 and a[2]>=0: + if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0: + print(0) + else: + print(a[0]*a[2]) + +elif a[0]>=0 and a[3]<=0: + if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0: + print(0) + else: + print(a[0]*a[3])" +p02553,s157957525,Wrong Answer,"a, b, c, d = input().split() + +print(a)" +p02553,s278847363,Wrong Answer,"a, b, c, d = map(int,input().split()) +print(max(a*b, b*c, c*d, a*d))" +p02553,s769315794,Wrong Answer,"a, b, c, d = map(int, input().split()) +if a>=0 and c>=0: + print(b*d) +elif b<=0 and d<=0: + print(a*c) +elif b<=0 and c>=0: + print(b*c) +elif a>=0 and d<=0: + print(a*d)" +p02553,s014612833,Wrong Answer,"L=list(map(int,input().split())) +# print(L) +ab=[L[0],L[1]] +cd=[L[2],L[3]] +ans=-(10**10) +for i in ab: + for j in cd: + ans=max(ans,i*j) +print(ans) + +" +p02553,s771362741,Wrong Answer,"# B +z = list(map(int, input().split("" ""))) +maxnum = -1000000000 +if z[0]*z[1] < 0 or z[2]*z[3] < 0: + maxnum = 0 +for i in range(2): + for j in range(2): + x = z[i] + y = z[j+2] + if maxnum < x*y: + maxnum = x*y +print(maxnum)" +p02553,s913311569,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] +print(abs(b * d)) +" +p02553,s801558483,Wrong Answer,"A = list(map(int,input().split())) + +maximum = -1*10**9 +ifzero = 0 +for i in range(2): + for j in range(2,4): + maximum = max(maximum,A[i]*A[j]) + +if (maximum<0): + if (A[0]*A[1]<=0)|(A[2]*A[3]<=0):maximum=0 +print(maximum)" +p02553,s815686068,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ans = -2e10 +for x in [a, b, 0]: + for y in [c,d, 0]: + if x * y > ans: + ans = x * y +print(ans)" +p02553,s609317969,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if((a >= 0 and d < 0) or (b < 0 and c >= 0)): + print(a*d) +elif(a >= 0 and c >= 0): + print(b*d) +elif(b <= 0 and d <= 0): + print(a*c) +else: + print(b*c) + + + + + +" +p02553,s007543687,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(a*d)" +p02553,s712323006,Wrong Answer,"a,b,c,d = map(int,input().split()) +if b <= 0 and d <= 0: + print(a*c) +elif b <= 0 and d > 0: + print(b*c) +elif d <= 0 and b > 0: + print(d*a) +else: + print(b*d)" +p02553,s119458188,Wrong Answer,"a, b, c, d = input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +def m(): + if a>=0 and d<=0: + max=a*d + print(max) + elif a>=0 and c>=0: + max=b*d + print(max) + elif b<=0 and c>=0: + max=b*c + print(max) + elif b<=0 and d<=0: + max=a*c + print(max) + +m() +" +p02553,s803540983,Wrong Answer,"a,b,c,d=(int(x) for x in input().split()) + +if a*c<=b*d: + print(b*d) +if a*c>b*d: + print(a*c)" +p02553,s985674848,Wrong Answer,"a, b, c, d = map(int, input().split()) +if a < b: + if c < d: + print(b*d) + else: + print(b*c) +elif b0 and c<=0 and d>0: + print(max(a*c,b*d)) +elif b<=0: + print(b*c) +elif d<=0: + print(d*a) +else: + print(b*d)" +p02553,s422362505,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*b,b*c,b*d,a*c))" +p02553,s612723759,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if a >= 0 and d <= 0: + print(a*d) +elif a <= 0 and c <= 0: + print(a*c) +else: + print(b*d) +" +p02553,s499683969,Wrong Answer,"nums = [int(e) for e in input().split()] +a=nums[0] +b=nums[1] +c=nums[2] +d=nums[3] +i = 0 +j = 0 +max = a*c +if not a < 0 and c < 0: + for i in range(a, b+1, 1): + for j in range(c, d+1, 1): + if max < i * j: + max = i * j + +print(max)" +p02553,s365509290,Wrong Answer,"x = input().split() +a = int(x[1]) +b = int(x[3]) +print(a*b) +" +p02553,s584053175,Wrong Answer,"a,b,c,d=map(int,input().split()) + +ans=max(a*c,b*d,a*d,b*c) +if ((0<=b and 0>=a) or (0<=d and 0>=b)): + print(max(0,ans)) +else: + print(ans)" +p02553,s256654010,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ans = -1000000 +tmp = 0 +tmp = a*c +if ans < tmp: + ans = tmp +tmp = a*d +if ans < tmp: + ans = tmp +tmp = b*d +if ans < tmp: + ans = tmp + +tmp = b*c +if ans < tmp: + ans = tmp +print(ans) +" +p02553,s833089467,Wrong Answer,"a, b, c, d = map(int, input().split()) + +x = a*c + +if a*c < a*d: + x=a*d +elif a*d < b*c: + x=b*c +elif b*c < b*d: + x=b*d + +print(x)" +p02553,s759481151,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a<0 and b<0 and c>=0 and d>=0: + print(b*c) +elif a<0 and b<0 and c<0 and d>=0: + print(a*c) +elif a<0 and b>=0 and c<0 and d<0: + print(a*c) +elif a<0 and b<0 and c<0 and d<0: + print(a*c) +elif a<0 and b>=0 and c<0 and d>=0 and abs(a*c)>=abs(b*d): + print(a*c) +else: + print(b*d)" +p02553,s545845945,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +if a>=0 and c>=0: + print(b*d) +elif c>=0 and d<=0: + print(a*d) +elif b<=0 and c>=0: + print(b*c) +else: + print(a*c)" +p02553,s557208788,Wrong Answer,"# coding: utf-8 +# Your code here! + +input_line = input().split("" "") +a = int(input_line[0]) +b = int(input_line[1]) +c = int(input_line[2]) +d = int(input_line[3]) + +if b > 0 and d > 0: + print(b * d) +if b <= 0 and d <= 0: + print(a * c) +if b >=0 and d < 0: + print(a * d) +if b < 0 and d >= 0: + print(b * c) + + " +p02553,s305736399,Wrong Answer,"a,b,c,d = map(int , input().split()) +if 0 < a and 0 < b and 0 < c and 0 < d: + x = b + y = d +elif a < 0 and b < 0 and c < 0 and d < 0: + x = a + y = c +elif a < 0 and b < 0 and 0 < c and 0 < d: + x = b + y = c +elif 0 < a and 0 < b and c < 0 and d < 0: + x = a + y = d +elif a < 0 and b == 0 and c < 0 and d == 0: + x = a + y = c +else: + x = b + y = d + +print(x * y)" +p02553,s921398677,Wrong Answer,"a, b, c, d = map(int, input().split()) + +minx = min(a, b) +miny = min(c, d) +maxx = max(a, b) +maxy = max(c, d) + +if maxx >= 0 and maxy >= 0 or minx < 0 and miny < 0: + print(max(miny * minx, maxx * maxy)) +elif maxx > 0: + print(minx * maxy) +else: + print(maxy * minx) +" +p02553,s664041990,Wrong Answer,"i = list(map(int, input().split())) + + +p = [ abs(i[0]), abs(i[1]) ] +q = [ abs(i[2]), abs(i[3]) ] + +print(max(p)*max(q))" +p02553,s513645147,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a >= 0 and c >= 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif a >= 0 and d <= 0: + print(a*d) +elif b <= 0 and c >= 0: + print(c*b) + " +p02553,s428638085,Wrong Answer,"a = list(map(int, input().split())) + +tmp = 0 +if(len(a) != 4): + exit() +if(a[0] > a[1]): + tmp = a[1] + a[1] = a[0] + a[0] = tmp + +if(a[2] > a[3]): + tmp = a[3] + a[3] = a[2] + a[2] = tmp +a_len = a[1] +b_len = a[3] + +if(a[0] < 0 and a[2] < 0): + max = a[0] * a[2] +else: + max = a_len * b_len +print(max)" +p02553,s070970952,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +charo=[a*c,a*d,b*c,b*d] +print(max)" +p02553,s809352541,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a * b) +elif b <= 0 and d > 0: + print(b * c) +elif b > 0 and d <= 0: + print(a * d) +else: + print(b * d)" +p02553,s704252627,Wrong Answer,"templist = input().split() +a = int(templist[0]) +b = int(templist[1]) +c = int(templist[2]) +d = int(templist[3]) +flg1 = 0 +flg2 = 0 + +if b <= 0: + flg1 = 1 +if d <= 0: + flg2 = 1 + +if flg1 == 0 and flg2 == 0: + print(b * d) +elif flg1 == 1 and flg2 == 1: + print(a * c) +elif flg1 == 1 and flg2 == 0: + print(b * c) +else: + print(a * d)" +p02553,s631404517,Wrong Answer,"a, b, c, d = map(int,input().split()) +if b >= 0 and d >= 0: + print(b*d) +elif b < 0 and d >= 0: + print(b*c) +elif b >= 0 and d < 0: + print(a*d) +else: + print(a*c)" +p02553,s860913409,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if (a>=0 and b<=0) and (c <= 0 and d <=0): + print(a*d) +elif (a>=0 and b>=0) and (c <= 0 and d <=0): + print(a*d) +elif (a<=0 and b<=0) and (c <= 0 and d <=0): + print(a*c) +elif (a<=0 and b<=0) and (c <= 0 and d >=0): + print(a*c) +elif (a<=0 and b<=0) and (c >= 0 and d >=0): + print(b*c) +else: + print(b*d)" +p02553,s463965460,Wrong Answer,"a, b, c, d = map(int,input().split()) + +if a == c and b == d: + print(max(a*c, b*d)) + exit() +else: + if a > 0 and b > 0: + if c > 0 and d > 0: + print(b*d) + elif c <= 0 and d <= 0: + print(a*d) + else: + if c > 0 and d > 0: + print(b*c) + else: + print(a*c)" +p02553,s342216270,Wrong Answer,"a,b,c,d=map(int,input().split()) + +f=1 +g=1 +ans=1 +if b<0: + f=0 +if d<0: + g=0 +if f+g==0: + ans=a*c +elif f==0: + ans=b*c +elif g==0: + ans=a*d +else: + ans=b*d +print(ans) + + " +p02553,s335931682,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if a < 0 and b < 0 : + print(b*c) +elif a < 0 and b == 0: + if c <= 0: + print(a*c) + else : + print(b*c) +elif a < 0 and b > 0 : + if a * c < b * d : + print(b*d) + else : + print(a*c) +elif a==0 and b >0: + if d <= 0: + print(0) + else : + print(b*d) +else : + print(b*d)" +p02553,s352389800,Wrong Answer,"# B +z = list(map(int, input().split("" ""))) +maxnum = z[0]*z[2] +if z[0]*z[1] < 0 or z[2]*z[3] < 0: + maxnum = 0 +for i in range(2): + for j in range(2): + x = z[i] + y = z[j+2] + prod = x*y + if maxnum < prod: + maxnum = prod +print(maxnum)" +p02553,s894256323,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b<0 and c<0: + print(a*c) +elif b<0 and d==0: + print(b*c) +elif b<0 and c>0: + print(b*c) +elif b==0 and d<0: + print(a*d) +elif b==0 and d==0: + print(a*c) +elif b==0 and c>0: + print(b*c) +elif a>0 and d<0: + print(a*d) +elif a>0 and d==0: + print(a*d) +elif a>0 and d>0: + print(b*d) +" +p02553,s161620202,Wrong Answer,"a, b, c, d = map(int, input().split()) +x = [a, b] +y = [c, d] + +ans = 0 +for i in x: + for j in y: + ans = max(ans, i*j) + +print(ans)" +p02553,s234012992,Wrong Answer,"a,b,c,d = map(int,input().split()) + +n = [[a,b],[c,d]] + +result = -(10**9) +for i in range(2): + for j in range(2): + ans = n[0][i]*n[1][j] + result = max(result,ans) + + +print(result) +" +p02553,s178371537,Wrong Answer,"# B +z = list(map(int, input().split("" ""))) +maxnum = z[0]*z[2] +for i in range(2): + for j in range(2): + x = z[i] + y = z[j+2] + prod = x*y + if prod > maxnum: + maxnum = prod +print(maxnum)" +p02553,s734511465,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a,b)*max(c,d))" +p02553,s973291755,Wrong Answer,"(X1,X2,Y1,Y2)=list(map(int,input().split())) +print (X1,X2,Y1,Y2) +ans=X2*Y2 +ans=max(ans,X1*Y1) +ans=max(ans,X1*Y2) +ans=max(ans,X2*Y1) +print (ans)" +p02553,s618034079,Wrong Answer,"a, b, c, d = map(int, input().split()) + +max = 0 +if max < a*c: + max = a*c +elif max < a*d: + max = a*d +elif max < b*c: + max = b*c +elif max < b*d: + max = b*d +print(max) + +" +p02553,s884937185,Wrong Answer,"a,b,c,d = map(int, input().split()) +if a < 0 and b < 0 and c < 0: + print(a*c) +elif a < 0 and b < 0 and c >= 0 and d >= 0: + print(b*c) +elif a < 0 and b >= 0 and c < 0 and d < 0: + print(a*c) +elif a < 0 and b >= 0 and c < 0 and d >= 0: + print(max(a*c, b*d)) +elif a < 0 and b >= 0 and c >= 0 and d >= 0: + print(b*d) +elif a >= 0 and b >= 0 and c < 0: + print(a*d) +else: + print(b*d)" +p02553,s259826335,Wrong Answer,"a,b,c,d = map(int,input().split()) +g= a*c +h= b*d +q=a*d +z=b*c +w=a*d +e=b*c +r=b*c +t=a*d +if g>h: + print(g) +elif q> z: + print(q) +elif w>e: + print(w) +elif r>t: + print(r) + +" +p02553,s095915828,Wrong Answer,"a,b,c,d=map(int,input().split()) +p1=0;p2=0;p3=0;p4=0 +if (a,b,c,d)==(0,0,0,0): + print(0) +else: + p1=a*c + p2=a*d + p3=b*c + p4=b*d +print(max(max(p1,p2),max(p3,p4)))" +p02553,s892833221,Wrong Answer,"a,b,c,d = map(int, input().split()) +import numpy as np +A = np.matrix([[a],[b]]) +C = np.matrix([c,d]) +print(A.shape) +print(C.shape) +X = np.dot(A,C) +print(np.max(X))" +p02553,s376762288,Wrong Answer,"a, b, c, d = map(int,input().split()) + +if b < 0 and d < 0: + print(a*c) + +elif a > 0 and b > 0 and d < 0: + print(a*d) + +elif b < 0 and c > 0 and d > 0: + print(b*c) + +elif a < 0 and b > 0 and c < 0 and d > 0: + print(b*d) + +elif a < 0 and b > 0 and d < 0: + print(a*c) + +elif a > 0 and c > 0: + print(b*d) + +elif b < 0 and c < 0 and d > 0: + print(a*c)" +p02553,s509137830,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] + +x, y = 0, 0 + +if a == 0: + a = b +elif b == 0: + b = a + +if c == 0: + c = d +elif d == 0: + d = c + +if a <= 0 and b <= 0: + y = c +else: + y = d + +if c <= 0 and d <= 0: + x = a +else: + x = b + + +print(x*y) +" +p02553,s096640049,Wrong Answer,"a,b,c,d = map(int,input().split()) +num =0 +if b < 0 and d < 0: + num = a*c +if b > 0 and d > 0: + num = b*d +if b < 0 and d >0 and c <0: + num=0 +if b > 0 and d <0 and a <0: + num = 0 +if a >0 and d < 0: + num = a*d +if c >0 and b <0: + num = b*c +if b <=0 and d <=0: + num =a*c +print(num) + + +" +p02553,s722374379,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b > 0 and d > 0: + print(b*d) + +elif a <= b <= 0 and c <= d <= 0: + print(max(abs(a), abs(b)) * max(abs(c), abs(d)) * -1) + +else: + print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1) +" +p02553,s370180629,Wrong Answer,"a,b,c,d=map(int, input().split()) +ans=-10**10 +ans=max(a*c,ans) +ans=max(a*d,ans) +ans=max(b*c,ans) +ans=max(b*d,ans) +print(ans)" +p02553,s150263279,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ans = a*c +if ans < a*d: + ans = a*d +elif ans < b*c: + ans = b*c +elif ans < b*d: + ans = b*d +print(ans) +" +p02553,s714530186,Wrong Answer,"a,b,c,d = map(int,input().split()) +print(b*d)" +p02553,s206511015,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*b,a*c,b*d,b*c))" +p02553,s164766663,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a>0 and d<0: + print(a*d) +elif a==0 and d<0: + print(0) +elif a>=0: + print(b*d) +elif a<0 and b>=0 and d<0: + print(a*c) +elif a<0 and b>=0 and c<0 and d>=0: + print(max(0,d*d,a*c)) +elif a<0 and b>=0 and c>=0: + print(b*d) +elif b<0 and d<0: + print(a*c) +elif b<0 and c<0 and d>=0: + print(max(0,a*c)) +elif b<0 and c==0: + print(0) +elif b<0 and c>0: + print(b*c)" +p02553,s166513687,Wrong Answer,"def main(): + a, b, c, d = map(int, input().split()) + if (b >= 0 and c >= 0) or (d >= 0 and a >= 0): + print(b*d) + elif (b < 0 and c >= 0): + print(b*c) + elif (d < 0 and a >= 0): + print(a*d) + elif (b <= 0 and c <= 0) or (d <= 0 and a <= 0): + print(a*c) + +if __name__ == '__main__': + main()" +p02553,s210146024,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a * c, b * d)) +" +p02553,s638062680,Wrong Answer,"t = input() +t = t.split("" "") +t = [int(x) for x in t] + +a,b = t[0], t[1] +c,d = t[2], t[3] + +g1_max = max(a,b) +g1_min = min(a,b) + +g2_max = max(c,d) +g2_min = min(c,d) + +if b > 0 and d > 0: + print(g1_max*g2_max) +elif b < 0 and d >0: + print(g1_max*g2_min) +elif b <= 0 and d <= 0: + print(g1_min*g2_min) +else: + print(g1_min*g2_max) + " +p02553,s173623166,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b<=0 and d<=0: + print(a*c) +elif b<0: + print(b*c) +elif d<0: + print(a*d) +else: + print(b*d)" +p02553,s593648234,Wrong Answer,"a,b,c,d = map(int,input().split()) +answer =0 +if b < 0: + if c < 0: + answer = a*c + if c>=0: + answer = a * c +if b>=0: + if a <0: + answer = max(a*c ,b * d,0) + if a >= 0: + if d< 0: + answer = a*d + if d>=0: + answer = b*d +print(answer)" +p02553,s218332500,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0: + if c>=0 or d>=0: + print(b*d) + else: + print(a*c) +elif b<0: + if d<0: + print(a*c) + else: + if a*c < b*d: + print(b*d) + else: + print(a*c)" +p02553,s176080073,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +if b<=0 and d<=0: + print(a*c) +elif b>=0 and d>=0: + print(b*d) +elif b<=0 and d>=0: + print(b*c) +else: + print(a*d) + + +" +p02553,s142070832,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if b == 0: + b = b - 1 + +if d == 0: + d = d - 1 + +if a == 0: + a = a + 1 + +if c == 0: + c = c + 1 + +if b < 0 and d < 0: + print(a*c) +elif b < 0 and d > 0: + print(b*c) +elif b > 0 and d < 0: + print(a*d) +else: + print(b*d)" +p02553,s647985802,Wrong Answer,"a,b,c,d=(int(x) for x in input().split()) +if a>=0 and c>=0: + print(b*d) +elif b<0 and d<0: + print(a*c) +elif a<0 and c>=0: + print(b*c) +elif c<0 and a>=0: + print(a*d) +" +p02553,s241770602,Wrong Answer,"a,b,c,d=map(int,input().split()) + +f=1 +g=1 +ans=1 +if b<=0: + f=0 +if d<=0: + g=0 +if f+g==0: + ans=a*c +elif f==0: + ans=b*c +elif g==0: + ans=a*d +else: + if(a<0 and c<0): + ans=a*c + else: + ans=b*d +print(ans) + + " +p02553,s543438909,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b <= 0 and d <= 0: + print(a * c) +elif a > 0 and d <= 0: + print(a * d) +elif b <= 0 and c > 0: + print(b * c) +else: + print(b * d)" +p02553,s236275397,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a*b<0 and c*d<0: + print(max(a*c,b*d)) +elif b>=0 and d>=0: + print(b*d) +elif b<0 and d<0: + print(a*c) +else: + print(max(a*d,b*c))" +p02553,s064939055,Wrong Answer,"array = input().split() + +a = float(array[0]) +b = float(array[1]) +c = float(array[2]) +d = float(array[3]) + +if b > 0 and d > 0: + print(str(b*d)) +elif b <= 0 and d <= 0: + print(str(a*c)) +elif b <= 0 and d > 0: + print(str(b * c)) +elif b > 0 and d <= 0: + print(str(a * d))" +p02553,s972737418,Wrong Answer,"a,b,c,d=map(int, input().split("" "")) +print(max(a*b, a*c, a*d, b*c, b*d, c*d))" +p02553,s752364036,Wrong Answer,"a = list(map(int, input().split())) + +if a[0] > 0: + if a[3] < 0: + print(a[0] * a[3]) + else: + print(a[1] * a[3]) + +elif a[1] < 0: + if a[2] < 0: + print(a[0] * a[2]) +else: + if a[3] < 0: + print(a[0] * a[2]) + elif a[2] > 0: + print(a[1] * a[3]) + else: + if a[0] * a[2] > a[1] * a[3]: + print(a[0] * a[2]) + else: + print(a[1] * a[3]) + " +p02553,s073687272,Wrong Answer,"a,b,c,d = map(int,input().split()) +ans = a*c +if(a*d > ans): + ans = a*d +elif(b*c > ans): + ans = b*c +elif(b*d > ans): + ans = b*c +print(ans)" +p02553,s192201644,Wrong Answer,"a,b,c,d = map(int , input().split()) +if 0 < a and 0 < b and 0 < c and 0 < d: + x = b + y = d +elif a < 0 and b < 0 and c < 0 and d < 0: + x = a + y = c +elif a < 0 and b < 0 and 0 < c and 0 < d: + x = b + y = c +elif 0 < a and 0 < b and c < 0 and d < 0: + x = a + y = d +else: + x = b + y = d + +print(x * y)" +p02553,s897786077,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >=0 and c>=0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif b*c <= 0: + print(max(b*c,a*d)) +else: + print(max(a*c,b*d))" +p02553,s050857265,Wrong Answer,"i = list(map(int, input().split())) +max_num=0 + +def seki(x,y): + return x*y +result=[seki(i[0],i[2]),seki(i[0],i[3]),seki(i[1],i[2]),seki(i[1],i[3])] + +for i in result: + if max_num< i: + max_num=i + +print(max_num)" +p02553,s105542821,Wrong Answer,"a,b,c,d=map(int,input().split()) +def ret(a,b,c,d): + return max(b*d,a*c,0 if (a*b<=0 or c*d<=0) else -1e16,a*d,b*c) +print(ret(a,b,c,d))" +p02553,s372879712,Wrong Answer,"a, b, c, d = map(int, input().split()) + +x_max = max(a, b) +x_min = min(a, b) + +y_max = max(c, d) +y_min = min(c, d) + +ans = max(x_max * y_max, x_max * x_min, x_min * y_max, x_min * y_min) + +if (x_max >= 0 and x_min <= 0) or (y_max >= 0 and y_min <= 0): + ans = max(ans, 0) + +print(ans)" +p02553,s267757645,Wrong Answer,"a,b,c,d = map(int, input().split()) +ans = max(a*c, b*c, b*d) +print(ans)" +p02553,s946151863,Wrong Answer,"def main(): + a,b,c,d = map(int, input().split()) + if b <= 0 and d <= 0: + print(a*c) + elif b >=0 and d <= 0: + if a >= 0: + print(a*d) + else: + print(a*c) + elif b <= 0 and d >= 0: + if c >= 0: + print(b*c) + else: + print(a*c) + elif b >= 0 and d >=0: + print(b*d) + + +if __name__ == ""__main__"": + main()" +p02553,s895604779,Wrong Answer,"a,b,c,d = map(int,input().split()) +max = -1000000000 +if max < a*c: + max = a*c +if max < a*d: + max = a*d +if max < b*c: + max = b*c +if max < b*d: + max = b*d + +print(max)" +p02553,s139676558,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if b > 0 and d > 0: + print(b*d) +elif a < 0 and c < 0: + print(a*c) +else: + x = min(abs(a),abs(b)) + y = min(abs(c),abs(d)) + print(-x*y)" +p02553,s327577819,Wrong Answer,"# B +z = list(map(int, input().split("" ""))) +maxnum = z[0]*z[2] +if z[0]*z[1] < 0 or z[2]*z[3] < 0: + maxnum = 0 +for i in range(2): + for j in range(2): + x = z[i] + y = z[j+2] + prod = x*y + if prod > maxnum: + maxnum = prod +print(maxnum)" +p02553,s817010208,Wrong Answer,"arr = list(map(int,input().split())) +ans = 0 + +for i in range(2): + for j in range(2,4): + ans = max(ans, arr[i]*arr[j]) + +print(ans)" +p02553,s114647479,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a>=0 and c>=0: + print(b*d) +if a>=0 and c<0: + if d>=0: + print(b*d) + else: + print(a*d) +if a<0 and c>=0: + if b>=0: + print(b*c) + else: + print(b*c) +if a<0 and c<0: + if b>=0 and d>=0: + print(max(a*c,b*d)) + else: + print(a*c)" +p02553,s500946145,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b<0 and d<0: + print(b*d) +elif b<0 and d==0: + print(b*c) +elif b<0 and c>0: + print(b*c) +elif b==0 and d<0: + print(a*d) +elif b==0 and d==0: + print(a*c) +elif b==0 and c>0: + print(b*c) +elif b>0 and d<0: + print(a*d) +elif b>0 and d==0: + print(b*d) +elif b>0 and d>0: + print(b*d) +" +p02553,s776532019,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a >= 0 and c >= 0: + print(b * d) +elif b <= 0 and d <= 0: + print(a * c) +elif a >= 0 and d <= 0: + print(a * d) +elif b <= 0 and c >= 0: + print(b * c)" +p02553,s457812259,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b < 0 or d < 0: + if b < 0: + x = b + else: + x = a + + if d < 0: + y = d + else: + y = c +else: + x = max(a, b) + y = max(c, d) + +print(x * y)" +p02553,s856379925,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a*c) +elif b <= 0 and d >= 0: + print(b*c) +elif b >= 0 and d <= 0: + print(a*d) +else: + print(b*d) + " +p02553,s432804481,Wrong Answer,"a,b,c,d=list(map(int,input().split())) + +if b>0 and d>0: + + one=b + two=c +elif b>=0 and d>=0: + + one=a + two=c +else: + if b>0: + + one=a + two=d + else: + + one=b + two=c + +print(one*two)" +p02553,s926417154,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a<0 and b<0 and c<0 and d<0: + print(b*d) +elif a<0 and b>=0 and c<0 and d>=0: + print(max(a*c,b*d)) +elif a<0 and b>=0 and c<0 and d<0: + print(0) +elif a<0 and b<0 and c<0 and d>=0: + print(0) +elif a>=0 and b>=0 and c<0 and d<0: + print(a*d) +elif a<0 and b<0 and c>=0 and d>=0: + print(b*c) +else: + print(b*d)" +p02553,s221000121,Wrong Answer,"# coding: utf-8 +# Your code here! + +input_line = input().split("" "") +a = int(input_line[0]) +b = int(input_line[1]) +c = int(input_line[2]) +d = int(input_line[3]) + +if b > 0 and d > 0: + print(b * d) +if b <= 0 and d <= 0: + print(a * c) +if b > 0 and d <= 0: + print(a * d) +if b <= 0 and d > 0: + print(b * c) + + " +p02553,s794601787,Wrong Answer,"A,B,C,D = map(int, input().split()) + +ans = -(10 ** 9) -1 + +ans = max(ans,A * C) +ans = max(ans,A * D) +ans = max(ans,B * C) +ans = max(ans,B * D) + +print(ans) +" +p02553,s932323010,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] +if b <= 0 or d <= 0: + if b <= 0 and d <= 0: + print(a * c) + else: + print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d))) +else: + print(b * d) +" +p02553,s571630663,Wrong Answer,"a, b, c, d = map(int, input().split()) +s = [] +for i in [a, b]: + s.append(c * i) + s.append(d * i) + s.append(0) +print(max(s))" +p02553,s898200916,Wrong Answer,"_list = list(map(int, input().split())) +print(_list) + +_list_multi = [_list[0]*_list[2], _list[0]*_list[3], _list[1]*_list[2], _list[1]*_list[3]] +print(max(_list_multi)) " +p02553,s582269286,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b <= 0 and d <= 0: + print(a * c) +elif b < 0 and 0 < c: + print(b * c) +elif 0 < a and d < 0: + print(a * d) +elif 0 <= a and 0 <= c: + print(b * d)" +p02553,s161297605,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b < 0 and c < 0 or b >= 0 and d >= 0: + if a < 0 and c < 0: + print(a * c) if a * c > b * d else print(b * d) + else: + print(b * d) +else: + if b < 0: + print(b * c) + else: + print(a * d) +" +p02553,s981176911,Wrong Answer,"listA=list(map(int,input().split())) +print(listA) +x_list = [] +for i in [0,1]: + x_list.append(listA[i]) + +y_list = [] +for i in [2,3]: + y_list.append(listA[i]) + +i_list = [] +for x in x_list: + for y in y_list: + i_list.append(x*y) + +print(max(i_list))" +p02553,s677250229,Wrong Answer,"a,b,c,d = map(int,input().split()) +ac = a*c +ad = a*d +bc = b*c +bd = b*d + +if ac>ad and ac>bc and ac>bd: + print(ac) +elif ad >bc and ad>bd and ad>ac: + print(ad) +elif bc>ac and bc>ad and bc>bd: + print(bd) +else: + print(bd)" +p02553,s248638139,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b > 0 and d > 0: + print(b*d) +elif a < 0 and c < 0: + print(a*c) +else: + e = abs(a) + f = abs(b) + g = abs(c) + h = abs(d) + l = [e,f,g,h] + l.sort() + print(-1*l[0]*l[1])" +p02553,s844355403,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a>=0 and b>=0 and c>=0 and d>=0: + print(b*d) +elif a>=0 and b>=0 and c<0 and d<0: + print(a*d) +elif a<0 and b<0 and c<0 and d<0: + print(a*c) +else: + print(a*c)" +p02553,s807952890,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if a <= b: + x = b +if a >= b: + x = a + +if c <= d: + y = d +if c >= d: + y = c +print(x*y)" +p02553,s540656643,Wrong Answer,"a = input().split("" "") + +x = [int(a[0]),int(a[1])] +y = [int(a[2]),int(a[3])] + +max = -1000000000 +for i in x: + for j in y: + s = i*j + + if max < s: + max = s +print(max) + +" +p02553,s566470120,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] +print(max(a*c,b*d,a*b,b*c)) +" +p02553,s511632568,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*c >= b*d: + if a*c >= a*d: + if a*c >= b*c: + print(a*c) +if a*d >= b*d: + if a*d >= b*d: + if a*d >= a*c: + print(a*d) +if b*c >= b*d: + if b*c >= a*d: + if b*c >= a*c: + print(b*c) +if b*d >= b*c: + if b*d >= a*d: + if b*d >= a*c: + print(b*d)" +p02553,s824726843,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if a > 0 and b > 0 and c > 0 and d > 0: + print(b * d) +elif a <= 0 and b <= 0 and c <= 0 and d <= 0: + print(a * c) +elif a > 0 and b > 0 and c <= 0 and d <= 0: + print(a * d) +elif a <= 0 and b <= 0 and c > 0 and d > 0: + print(b * c)" +p02553,s075388445,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a<=0 and b<=0 and c<=0 and d<=0: + print(a*c) +elif a>=0 and b>=0 and c>=0 and d>=0: + print(b*d) +elif b>=0 and c<=0 and d<=0: + print(b*c) +else: + print(a*d)" +p02553,s582367048,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b<=0 and d<=0: + print(a*c) +elif b<=0 and c>=0: + print(b*c) +elif d<=0 and a>=0: + print(d*a) +elif b<=0 and c<=0 and d>=0: + print(b*c) +elif d<=0 and a<=0 and d>=0: + print(d*a) +else: + print(b*d)" +p02553,s728521267,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if b <= c: + if b <= 0 and c >= 0: + print(int(b*c)) + elif b >= 0 and c >= 0: + print(int(b*d)) + elif b <= 0 and d <= 0: + print(int(a*c)) +else: + if d <= 0 and a >= 0: + print(int(a*d)) + elif d >= 0 and a >= 0: + print(int(b*d)) + elif d <= 0 and b <= 0: + print(int(a*c)) + +" +p02553,s657753153,Wrong Answer,"a, b, c, d = map(int, input().split()) +ans = 1 +aa, bb, cc, dd = abs(a), abs(b), abs(c), abs(d) + +if aa <= bb and cc <= dd: + ans = b * d +elif aa > bb and cc <= dd: + ans = b * c +elif aa <= bb and cc > dd: + ans = a * d +else: + ans = a * c + +print(ans)" +p02553,s645673713,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if(b<=0 and d<=0): + print(a*c) + +elif(b>0 and d>0): + print(b*d) + +elif(b>=0 and d<0): + print(a*d) + +else: + print(b*c)" +p02553,s879015719,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if b > 0 and d > 0: print(b*d) +elif b <= 0 and d <= 0: print(a*c) +elif b < 0: + if c < 0: print(a*c) + else: print(b*c) +elif d < 0: + if a < 0: print(a*c) + else: print(a*d)" +p02553,s666593905,Wrong Answer,"a,b,c,d = map(int,input().split()) +if(b<=0 and d<=0): + print(a*c) +elif(b<0 or d<0): + if(a>0): + print(d*a) + elif(c>0): + print(b*c) + else: + print(0) +else: + print(max(b*d,a*c))" +p02553,s156357257,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b>0 and d>0: + print(b*d) +else: + if a*b<=0 and c*d<=0: + print(max(a*c,b*d)) + else: + print(max(a*d,b*c))" +p02553,s905280949,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0 and c >= 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif a <= 0 and b >= 0 and c <= 0 and d >= 0: + print(max(a*c,b*d)) +elif a >= 0 and d <= 0: + print(a*d) +elif b <= 0 and c >= 0: + print(b*c)" +p02553,s120258639,Wrong Answer,"a,b,c,d = map(int,input().split()) + +n = [[a,b],[c,d]] + +result = -10**9 +for i in range(2): + for j in range(2): + ans = n[0][i]*n[1][j] + result = max(result,ans) + + +print(result) +" +p02553,s280817358,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b < 0 and d < 0: + print(a*b) +elif b < 0 and c >= 0: + print(b*c) +elif a >= 0 and d < 0: + print(a*d) +else: + print(b*d)" +p02553,s405762728,Wrong Answer,"a, b, c, d = map(int,input().split()) + +if b < 0 and d < 0: + ans = a * c +elif b < 0 and d > 0: + ans = b * c +elif b > 0 and d > 0: + ans = b * d +elif b > 0 and d < 0: + ans = a * d +else: + ans = 0 + +print(ans)" +p02553,s221294475,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if b <= 0 and d > 0: + if c >= 0: + print(b * c) + else: + print(a * c) +elif b > 0 and d <= 0: + if a >= 0: + print(a * d) + else: + print(a * c) +elif b <= 0 and d <= 0: + print(a * c) +elif b == 0 or d == 0: + print(0) +else: + if c < 0 and a < 0: + print(max(abs(a),b) * max(abs(c),d)) + else: + print(b * d)" +p02553,s768911586,Wrong Answer,"li = list(map(int,input().split())) + +a = li[0] +b = li[1] +c = li[2] +d = li[3] + +ac = a * c +bc = b * c +ad = a * d +bd = b * d +result = ac +if result < bc: + result = bc +elif result < ad: + result = ad +elif result < bd: + result = bd +elif a < 0 and 0 < b and result < 0: + result = 0 +elif c < 0 and 0 < d and result < 0: + result = 0 +print(result)" +p02553,s816926256,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b<0 and c<0: + print(b*c) +elif b<0 and d==0: + print(b*c) +elif b<0 and c>0: + print(b*c) +elif b==0 and d<0: + print(a*d) +elif b==0 and d==0: + print(a*c) +elif b==0 and c>0: + print(b*c) +elif a>0 and d<0: + print(a*d) +elif a>0 and d==0: + print(a*d) +elif a>0 and d>0: + print(b*d) +" +p02553,s308164847,Wrong Answer,"a,b,c,d = map(int, input().split()) +i = 0 +for x in range(a, b+1): + for y in range(c, c+1): + z = x * y + if z >= i: + i = z +print(i)" +p02553,s328444809,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*b,a*c,b*c,b*d))" +p02553,s922526374,Wrong Answer,"import numpy as np +a, b, c, d = map(int, input().split()) +products = np.zeros(4) +products[0] = a * c +products[1] = a * d +products[2] = b * c +products[3] = b * d +print(int(np.max(products)))" +p02553,s999970366,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b >= 0 and d >= 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif b < 0 and d > 0: + print(b*c) +else: + print(a*d)" +p02553,s165913454,Wrong Answer,"import itertools +l=list(map(int, input().split())) +c=itertools.combinations(l,2) +ans=l[0]*l[1] +for i in c: + if i[0]*i[1]>ans: + ans=i[0]*i[1] +print(ans)" +p02553,s530777947,Wrong Answer,"#[int(i) for i in input().split()] +a,b,c,d = [int(i) for i in input().split()] +x=y=0 +if (b>0 and d>0): + x=b + y=d +elif (b<=0 and d<=0): + x=a + y=c +else: + if b<=0: + x=b + else: x=a + if d<=0: + y=d + else:y=c + +print(x*y) +" +p02553,s239549216,Wrong Answer,"import math + +def a(): + x = int(input()) + if x == 0: + print(1) + else: + print(0) + + +def b(): + a,b,c,d = map(int,input().split()) + + if a*c >b*d: + print(a*c) + else: + print(b*d) + + + +def c(): + pass + + + +def d(): + pass + + +# a() +b() +# c() +# d()" +p02553,s690311902,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if (b < 0 and d < 0) or (b > 0 and d > 0): + print(b * d) +elif b < 0: + print(b * c) +elif d < 0: + print(a * d) +else: + print(a * c)" +p02553,s494621559,Wrong Answer,"def main(): + + a = list(map(int,input().split())) + + sum = a[0]*a[3] + if sum < a[0]*a[2]: + print(a[0]*a[2]) + elif sum < a[1]*a[2]: + print(a[1]*a[2]) + elif sum < a[1]*a[3]: + print(a[1]*a[3]) + else: + print(sum) + +if __name__ == '__main__': + main() +" +p02553,s298924661,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(a >= 0 and d <= 0): + print(a*d) +elif(a >= 0 and c >= 0): + print(b*d) +elif(b <= 0 and d <= 0): + print(a*c) +else: + print(b*c) + + + + + +" +p02553,s217424276,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if 0 <= a or 0 <= c: + if d < 0: + print(a*d) + elif b < 0: + print(b*c) + else: + print(b*d) +elif 0 < b or 0 < d: + print(a*c) +" +p02553,s428572473,Wrong Answer,"z = list(map(int,input().split())) + +w = z[0]*z[3] + +for x in range(z[0],z[1]): + for y in range(z[2],z[3]): + if x*y >= w: + w = x*y +print(w)" +p02553,s498908179,Wrong Answer,"a, b, c, d = map(int, input().split()) +x = [a, b] +y = [c, d] + +ans = -1000100100100 +for i in x: + for j in y: + ans = max(ans, i*j) + +print(ans)" +p02553,s454009486,Wrong Answer,"import numpy as np +a, b, c, d = map(int, input().split()) +max = -999999 +x = [a,b] +y = [c,d] +for i in x: + for j in y: + if i*j > max: + max = i*j +print(max) +" +p02553,s776861682,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b * d >= 0: + print(b * d) +else: + z = [] + + for x in range(a, b + 1): + for y in range(c, d + 1): + z.append(x * y) + print(max(z))" +p02553,s425552734,Wrong Answer,"A, B, C, D = input().split() + +AC = int(A)*int(C) +BD = int(B)*int(C) + +if AC > BD: + print(AC) + +else: + print(BD)" +p02553,s449008204,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0 and c >= 0: + print(int(b*d)) +elif b <= 0 and d <= 0: + print(int(a*c)) +elif b*c > a*d: + print(int(b*c)) +else: + print(int(a*d))" +p02553,s160202336,Wrong Answer,"a,b,c,d=input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +list1=[] +list1.append(a*c) +list1.append(a*d) +list1.append(b*c) +list1.append(b*c) +list1.sort() +print(list1[3])" +p02553,s044113174,Wrong Answer,"a,b,c,d = map(int,input().split()) +cnt = 0 + +if b <= 0: + cnt+=1 +if d <= 0: + cnt+=1 + +if cnt > 0: + if cnt == 1: + if b < 0: + print(b*c) + else: + print(d*a) + elif cnt == 2: + print(a*c) +else: + print(b*d)" +p02553,s018784360,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a * b, a * c, b + c, b * d))" +p02553,s769227221,Wrong Answer,"a,b,c,d=map(int,input().split()) +e=max(a*b,a*c) +f=max(b*c,b*d) +print(max(e,f)) +" +p02553,s490468211,Wrong Answer,"a,b,c,d = map(int, input().split()) +if b >= 0 and d >= 0: + if a <= 0 and c <= 0: + if (a-0)*(-1) >= b-0 and (c-0)*(-1) >= d-0: + print(a * c) + if (a-0)*(-1) <= b-0 and (c-0)*(-1) <= d-0: + print(b * d) + else: + print(b * d) +elif a*b >= 0 and c*d >= 0: + if a*c <= 0: + print(a * d) + else: + print(a * c) +else: + print(a * c)" +p02553,s751396364,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +if a>=0 and c>=0: + one=b + two=d + +elif a<0 and c<0: + one=a + two=c + +elif a>=0 and c<0: + one=a + two=d +else: + one=b + two=c + + +print(one*two)" +p02553,s505922627,Wrong Answer,"a,b,c,d = map(int, input().split()) +if(a >= 0 and c >= 0): + print(b * d) +elif(b < 0 and d < 0): + print(a * c) +elif(a > 0 and d < 0): + print(a * c) +elif(b < 0 and c > 0): + print(b * d)" +p02553,s763579364,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if c < 0 or d < 0: + x = min(a, b) +else: + x = max(a, b) + +if x < 0: + y = min(c, d) +else: + y = max(c, d) + +print(x * y)" +p02553,s147224699,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*d > b*d: + print(a*d) +elif a*c > b*d: + print(a*c) +elif b*c > b*d: + print(b*c) +else: + print(b*c)" +p02553,s835674497,Wrong Answer,"a,b,c,d = map(int,input().split()) +print(max(a*b,b*c,c*d,d*a,b*c,b*d,c*d))" +p02553,s614804602,Wrong Answer,"import sys +import collections as cc +import math as mt +I=lambda:list(map(int,input().split())) +a,b,c,d=I() +print(max(a*c,a*d,b*d,b*d))" +p02553,s569123936,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(max(a,b) <=0 and max(c,d) > 0): + print( min(c,d)*max(a,b)) +elif(max(a,b) > 0 and max(c,d) <=0): + print(min(a,b)*max(c,d)) +elif(max(a,b) > 0 and max(c,d) > 0): + print(max(a,b)*max(c,d)) +elif(max(a,b) <= 0 and max(c,d) <= 0): + print(min(a,b)*min(c,d)) + +" +p02553,s923324179,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a*c) +elif b <= 0 and d > 0: + print(b*c) +elif d <= 0 and b > 0: + print(a*d) +else: + print(b*d)" +p02553,s185300482,Wrong Answer,"l=list(map(int,input().split())) +if l[1]<=0 and l[3]<=0: + print(l[0]*l[2]) +elif l[1]<0: + print(l[1]*l[2]) +elif l[3]<0: + print(l[0]*l[3]) +else: + print(l[1]*l[3]) + +" +p02553,s107653221,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b == 0: + b -= 1 +if d == 0: + d -= 1 +print(max(a * c, a * d, b * c, b * d))" +p02553,s696397310,Wrong Answer,"nums = input().split(' ') +a = int(nums[0]) +b = int(nums[1]) +c = int(nums[2]) +d = int(nums[3]) + +multi = [] +multi.append(a * c) +multi.append(a * d) +multi.append(b * c) +multi.append(b * d) + +ans = - 10 ** 9 +for i in range(4): + if multi[i] > ans: + ans = multi[i] + +print(ans)" +p02553,s907889491,Wrong Answer,"a, b, c, d = map(int, input().split()) + +x = a*c + +if a*c < a*d: + x=a*d +elif a*d < b*c: + x=b*c +elif b*c < b*d: + x=b*d + +print(x)" +p02553,s050347454,Wrong Answer,"a,b,c,d=map(int,input().split()) +if (a<0 and b>0) or (c<0 and d>0): + print(0) +else: + print(max(a*c,a*d,b*c,b*d,-a*c,-a*d,-b*c,-b*d))" +p02553,s977486579,Wrong Answer,"a,b,c,d = map(int, input().split()) + +mab = max(abs(a), abs(b)) +mcd = max(abs(c), abs(d)) + + +print(mab*mcd)" +p02553,s719608432,Wrong Answer,"a,b,c,d=input().split() +if int(a)<0 and int(c)<0: + if int(a)*int(c)0 and d>0: + n1.append(b*d) +elif a<0 and c<0: + n1.append(a*c) +else: + if b<0 and c>0: + n1.append(b*c) + elif a>0 and d<0: + n1.append(a*d) + else: + n1.append(0) +print(max(n1)) +" +p02553,s846037932,Wrong Answer,"a,b,c,d=map(int,input().split()) + +l=[a,b,c,d] +xy=[] +for i in range(4): + for j in range(i+1,4): + xy.append(l[i]*l[j]) + +print(max(xy))" +p02553,s334746789,Wrong Answer,"a,b,c,d = map(int, input().split()) +if(a >= 0 and c >= 0): + print(b*d) +elif(a > 0 and c < 0): + print(a * d) +elif(a < 0 and c > 0): + print(b * c) +else: + print(a * c) + +" +p02553,s327158576,Wrong Answer,"# coding: utf-8 +# Your code here! +arr = input().split() + +a = int(arr[0]) +b = int(arr[1]) + +c = int(arr[2]) +d = int(arr[3]) + +x = max(a,b) +y = max(c,d) + +x2 = min(a,b) +y2 = min(c,d) + +ans = max(x*y,x2*y2) + +print(ans) +" +p02553,s484481612,Wrong Answer,"a,b,c,d = map(int,input().split()) +A = max(a,b) +B = max(c,d) +if A <= 0 and B > 0: + A = max(a,b) + B = min(c,d) +elif A >= 0 and B < 0: + A = min(a,b) + B = max(c,d) + +elif A <= 0 and B <= 0: + A = min(a,b) + B = min(c,d) + +print(A*B)" +p02553,s255883560,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if (a >= 0 and c >= 0) or (b <= 0 and d <= 0): print(b*d) +elif (a >= 0 and d <= 0): print(b*c) +elif (b <= 0 and c >= 0): print(a*d)" +p02553,s936150321,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(a*b,a*c,a*d,b*c,b*d,c*d)" +p02553,s020656495,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b <= 0 and d <= 0: + print(c * a) + +elif b > 0 and d > 0: + print(b * d) + +elif b <= 0 and d >= 0: + if c > 0: + print(c * b) + else: + print(a * c) + +elif b >= 0 and d <= 0: + if a > 0: + print(a * d) + else: + print(a * c) + +else: + print(b * d) +" +p02553,s927182662,Wrong Answer,"a,b,c,d=map(int,input().split()) +x = max(a*c,0,b*d) +print(x)" +p02553,s573558106,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if (b > 0 and d > 0): + ans = b * d +elif (b <= 0 and d <= 0): + ans = a * c +else: + if b <= 0: + ans = b * c + elif d <= 0: + ans = d * a + +print(ans) +" +p02553,s157697066,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if b < 0 and d > 0: + print(b*c) +elif b > 0 and d < 0: + print(a*d) +elif (b < 0 and d < 0) or (b == 0 and d == 0): + print(a*c) +else: + print(b*d)" +p02553,s614990537,Wrong Answer,"def main(): + a, b, c, d = map(int, input().split()) + + ans = float('inf') * -1 + for i in [a, b]: + for j in [c, d]: + ans = max(ans, i * j) + + if (a < 0 and 0 < b): + ans = min(ans, 0) + if (c < 0 and 0 < d): + ans = min(ans, 0) + print(ans) + + +if __name__ == ""__main__"": + main() + +" +p02553,s571491204,Wrong Answer,"a,b,c,d = map(int,input().split()) +m = a*c +if a*d > m: + m = a*d +elif b*c > m: + m = b*c +elif b*d > m: + m = b*d + +print(m)" +p02553,s325087002,Wrong Answer,"a, b, c, d = map(int, input().split()) + +max_value = max([a*c, a*d, b*c, b*d])" +p02553,s673816448,Wrong Answer,"import sys + +sys.setrecursionlimit(10**6) +int1 = lambda x: int(x)-1 +p2D = lambda x: print(*x, sep=""\n"") +def II(): return int(sys.stdin.readline()) +def MI(): return map(int, sys.stdin.readline().split()) +def LI(): return list(map(int, sys.stdin.readline().split())) +def LLI(rows_number): return [LI() for _ in range(rows_number)] +def SI(): return sys.stdin.readline()[:-1] + +a,b,c,d=MI() +ans=-10**16 +ans=max(ans,a*c) +ans=max(ans,a*d) +ans=max(ans,b*c) +ans=max(ans,b*d) +if a<=0<=b or c<=0<=d: + ans=max(0,ans) +print(ans) +" +p02553,s149755339,Wrong Answer,"lst = [ int(i) for i in input().split() ] + +ans = sorted(lst) + +print(ans[-1]*ans[-2])" +p02553,s490375322,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a*c) +elif b <= 0 and d > 0: + print(b*c) +elif b > 0 and d <= 0: + print(a*d) +else: + print(b*d) + " +p02553,s010705248,Wrong Answer,"li=list(map(int,input().split())) + +if (li[0] or li[1])>0: + if (li[2] or li[3])>0: + x=max(li[0],li[1]) + y=max(li[2],li[3]) + print(x*y) + else: + x=min(li[0],li[1]) + y=max(li[2],li[3]) + print(x*y) +else: + if (li[2] or li[3])>0: + x=max(li[0],li[1]) + y=min(li[2],li[3]) + print(x*y) + else: + x=min(li[0],li[1]) + y=min(li[2],li[3]) + print(x*y)" +p02553,s284011292,Wrong Answer,"import numpy as np +li= list(map(int,input().split())) +li_s= list(map(np.sign,li)) + +if li_s[0]==li_s[1] and li_s[2]==li_s[3] and li_s[0]*li_s[2]==-1: + print(li[1]*li[2]) +else: + print(max(li[0]*li[2],li[1]*li[3]))" +p02553,s024525367,Wrong Answer,"a = list(map(int,input().split())) +max_a = -(10**30) +import itertools +for i in itertools.combinations(a,2) : + #print(i[0]*i[1]) + if( i[0]*i[1] > max_a): + max_a = i[0]*i[1] + +print(max_a) +" +p02553,s237354013,Wrong Answer,"def maxProduct(nums): + B = nums[::-1] + + for x in range(1,len(nums)): + if nums[x - 1] != 0: + nums[x] *= nums[x - 1] + + if B[x - 1] != 0: + B[x] *= B[x - 1] + return max(nums + B) +nums=list(map(int,input().split())) +print(maxProduct(nums))" +p02553,s157208474,Wrong Answer,"a,b,c,d=map(int,input().split()) + +if b<0 and d>0: + print(b*c) + +elif b>0 and d<0: + print(a*d) + +elif b==0 and d==0: + print(a*c) + +elif b<0 and d<0: + print(a*c) + +else: + print(b*d)" +p02553,s525394916,Wrong Answer,"a,b,c,d = map(int, input().split()) +x = a +y = c +max = x * y +if b < 0: + print(max) +elif b == 0 and c > 0: + print(0) +else: + for x in range(a,b + 1): + for y in range(c,d + 1): + if x * y > max: + max = x * y + print(max) +" +p02553,s548048811,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if a >= 0 and b >= 0 and c >= 0 and d >= 0: + print(b * d) +elif a <= 0 and b <= 0 and c <= 0 and d <= 0: + print(a * c) +elif a >= 0 and b >= 0 and c <= 0 and d <= 0: + print(a * d) +elif a <= 0 and b <= 0 and c <= 0 and d <= 0: + print(b * c)" +p02553,s467523412,Wrong Answer,"a, b , c, d = map(int, input().split()) +if( b<0 and d>0): + print(b*c) +elif( b>0 and d<0): + print(a*d) +elif( b>0 and d>0): + print(b*d) +else: + print(a*c)" +p02553,s260319953,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(a >= 0 and d <= 0): + print(a*d) +elif(b<= 0 and d <= 0): + print(a*c) +elif((b <= 0 and c >= 0) or (b > 0 and d < 0)): + print(b*c) +elif(b > 0 and c > 0): + print(b*d) +elif(a*c > a*d): + print(a*c) +elif(a*c < a*d): + print(a*d) + + + + + +" +p02553,s998690862,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] +if b < 0 or d < 0: + if b < 0 and d < 0: + print(a * c) + else: + print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d))) +else: + print(b * d)" +p02553,s855743397,Wrong Answer,"a,b,c,d=map(int,input().split()) + +if b>0 & d>0: + print(int(b*d)) + +elif b<0 & d<0: + print(int(a*c)) + +elif a>0 & d<0: + print(int(a*d)) + +else: + print(int(b*c)) +" +p02553,s199139618,Wrong Answer,"[a,b,c,d] = input().split() +a = int(a) +b = int(b) +c = int(c) +d = int(d) + +if b > 0 and d > 0: + print(b*d) +elif b > 0 and d <= 0: + print(a*d) +elif b <= 0 and d > 0: + print(b*c) +elif b <= 0 and d <= 0: + print(a*c) +" +p02553,s494212239,Wrong Answer,"array = input().split() + +a = int(array[0]) +b = int(array[1]) +c = int(array[2]) +d = int(array[3]) + +if b > 0 or d > 0: + print(b*d) +else: + print(a*c) +" +p02553,s769913234,Wrong Answer,"if __name__ == ""__main__"": + li = list(map(int, input().split())) + array = [] + array.append(li[0] * li[1]) + array.append(li[0] * li[2]) + array.append(li[0] * li[3]) + array.append(li[1] * li[2]) + array.append(li[1] * li[3]) + array.append(li[2] * li[3]) + + print(max(array))" +p02553,s116652692,Wrong Answer,"# -*- coding: utf-8 -*- +"""""" +Created on Sun Sep 13 21:03:42 2020 + +@author: naoki +"""""" + +a,b,c,d = map(int, input().split()) +ac = a*c +bd = b*d + +if ac>=bd: + print(ac) +else: + print(bd)" +p02553,s703408248,Wrong Answer," +n = list(map(int, input().split())) + +i = n[0] +j = n[2] +max = 0 + +for i in range(n[1]): + for j in range(n[3]): + if max < i * j: + max = i*j + +print(max)" +p02553,s720601898,Wrong Answer,"a, b, c, d = map(int, open(0).read().split()) + +if a * c <= 0 and b * d <= 0: + print(a * d) +else: + print(max([a * c, b * d]))" +p02553,s492420490,Wrong Answer,"a = [int(x) for x in input().split()] +print(a[1]*a[3])" +p02553,s229420818,Wrong Answer,"a, b, c, d = map(int, input().split()) +res1 = a * c +res2 = a * d +res3 = b * c +res4 = b * d +if ((-10**9) <= a, c <= b, d <= (-10**9) and (10**9)): + if (res1>res2 and res1>res3 and res1>res4): + print(res1) + if (res2>res3 and res2>res4 and res2>res1): + print(res2) + if (res3 > res4 and res3 > res2 and res3 > res1): + print(res1) + if (res4>res2 and res4>res3 and res4>res1): + print(res4)" +p02553,s305944325,Wrong Answer,"import numpy as np +num = list(map(int, input().split())) +a,b,c,d = num[0],num[1],num[2],num[3] +if a<=b and c<=d: + mat = np.array([]) + for i in [a,b]: + for j in [c,d]: + mat = np.append(mat, i*j) + print(int(np.max(mat))) + " +p02553,s282084340,Wrong Answer,"s = input().split() +x_min = int(s[0]) +x_max = int(s[1]) + +y_min = int(s[2]) +y_max = int(s[3]) + + +max_value=0 + +for x in range(x_min,x_max+1): + for y in range(y_min,y_max+1): + if(x*y > max_value): + max_value = x*y + +print(max_value)" +p02553,s407414522,Wrong Answer,"a,b,c,d=map(int,input().split("" "")) +print(max(a,b)*max(c,d))" +p02553,s030025102,Wrong Answer,"# coding: utf-8 +a,b,c,d = map(int,input().split()) + +print(max(b*c,c*d,b*c,b*d)) + +" +p02553,s671564648,Wrong Answer,"a,b,c,d = input().split() + +a = int(a) +b = int(b) +c = int(c) +d = int(d) + +if b > 0 and d > 0: + print(b*d) +elif b <= 0 and d <= 0: + print(min(a,b)*min (c,d)) +elif b<=0 and c > 0: + print(max(a,b)*min(c,d)) +elif a>0 and d <= 0: + print(min(a,b)*max(c,d))" +p02553,s168573712,Wrong Answer,"a,b,c,d=map(int,input().split()) +l=[] +l.append(a*c) +l.append(a*d) +l.append(b*c) +l.append(b*d) +M=max(l) +if (a<=0 and b>=0) or (c<=0 and b>=0): + print(max(M,0)) +else: + print(M)" +p02553,s095581491,Wrong Answer,"a,b,c,d=map(int,input().split()) + +max=a*b +for i in (a,b): + for j in (c,d): + if max < i*j: + max = i*j + +print(max)" +p02553,s872137873,Wrong Answer,"a,b,c,d = map(int,input().split()) + +print(max(a*b,a*c,b*c,d*b)) +" +p02553,s979536923,Wrong Answer,"a,b,c,d = input().split() + +a = int(a) +b = int(b) +c = int(c) +d = int(d) + +if b > 0 and d > 0: + print(b*d) +elif b <= 0 and d <= 0: + print(min(a,b)*min (c,d)) +elif b<=0 and c > 0: + print(max(a,b)*min(c,d)) +elif a>0 and d <= 0: + print(min(a,b)*max(c,d))" +p02553,s006549434,Wrong Answer,"X = list(map(int, input().split())) + +print(max(X[0]*X[1], X[1]*X[2], X[2]*X[3], X[3]*X[0], X[0]*X[2], + X[1]*X[3]))" +p02553,s174889378,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d))" +p02553,s839396665,Wrong Answer,"a,b,c,d = map(int, input().split()) +ans = max(a*b, a*c, a*d, b*c, b*d, c*d) +print(ans)" +p02553,s701850450,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a*c, b*d, a*c, b*d))" +p02553,s748591404,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a >= 0 and c >= 0: + print(b * d) +elif b < 0 and d < 0: + print(a * c) +elif a > 0 and d < 0: + print(a * d) +elif b < 0 and c > 0: + print(b * c)" +p02553,s422827946,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b > 0 and d > 0: + print(b*d) + +else: + print(min(abs(a),abs(b)) * min(abs(c),abs(d)) * -1) +" +p02553,s958478528,Wrong Answer,"#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# FileName: B +# CreatedDate: 2020-09-13 20:49:18 +0900 +# LastModified: 2020-09-13 21:05:17 +0900 +# + + +import os +import sys +# import numpy as np +# import pandas as pd + + +def main(): + a, b, c, d = map(int, input().split()) + if 0 <= a and 0 <= c: + print(b*d) + elif 0 >= b and 0 >= d: + print(a*c) + elif 0 <= a and 0 >= d: + print(a*d) + elif 0 >= b and 0 <= c: + print(b*c) + + +if __name__ == ""__main__"": + main() +" +p02553,s982730223,Wrong Answer,"a, b, c, d = tuple(map(int, tuple(input().split("" "")))) +print(max(max(a, b) * max(c, d), min(a, b) * min(c, d)))" +p02553,s763066535,Wrong Answer,"a,b,c,d=map(int,input().split()) +x = max(a*c,0,b*d,a*d,b*c) +print(x)" +p02553,s468737527,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b >= 0 and d >= 0 and a <= 0 and c <= 0: + e = b*d + f = a*c + if e > f: + print(e) + else: + print(f) +else: + e = abs(a) + f = abs(b) + g = abs(c) + h = abs(d) + l = [e,f,g,h] + l.sort() + print(-1*l[0]*l[1])" +p02553,s230076568,Wrong Answer,"from math import inf +a,b,c,d = map(int, input().split()) +if b < a: + b, a = a, b +if d < c: + c, d = d, c +high = -inf +for i in range(b, a): + for j in range(d, c): + prod = i*j + if high < prod: + high = prod +print(high)" +p02553,s819677834,Wrong Answer," +a,b,c,d = map(int,input().split()) + +e = max(a*b,a*c,a*d,b*c,b*d,c*d) + +print(e)" +p02553,s276788099,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b <= 0 and d <= 0: + print(a * c) +elif (b <= 0 and c >= 0) or (a >= 0 and d <= 0): + print(-min(abs(a), abs(b)) * min(abs(c), abs(d))) +else: + print(b * d) + + " +p02553,s520648847,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(max(a,b) <=0 and max(c,d) > 0): + print( min(c,d)*max(a,b)) +elif(max(a,b) > 0 and max(c,d) <=0): + print(min(a,b)*max(c,d)) +elif(max(a,b) > 0 and max(c,d) > 0): + print(max(a,b)*max(c,d)) +elif(max(a,b) < 0 and max(c,d) < 0): + print(max(a,b)*max(c,d)) +elif(max(a,b)==0 and max(c,d) ==0): + print(min(a,b)*min(c,d)) +else: + print(max(a,b)*max(c*d)) + " +p02553,s040498316,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(max(a,b) <=0 and max(c,d) > 0): + print( min(c,d)*max(a,b)) +elif(max(a,b) > 0 and max(c,d) <=0): + print(min(a,b)*max(c,d)) +elif(max(a,b) > 0 and max(c,d) > 0): + print(max(a,b)*max(c,d)) +elif(max(a,b) < 0 and max(c,d) < 0): + print(min(a,b)*min(c,d)) +elif(max(a,b)==0 and max(c,d) ==0): + print(min(a,b)*min(c,d)) +" +p02553,s302726547,Wrong Answer,"a,b,c,d=input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +if a>0: + if d>0: + print(b*d) + else: + print(a*d) +else: + if b>0: + if d>0: + print(b*d) + else: + print(a*d) + else: + if d>0: + print(b*c) + else: + print(b*c)" +p02553,s858825787,Wrong Answer,"a , b , c , d = map(int,input().split()) +if (a*d) >= (b*c): + if (a*d) >= (b *d): + if (a*d) >= (a*c): + print(a*d) + else: + print(a*c) +else: + if (b*c) >= (a *c): + if (b*c) >= (b *d): + print(b * c) + else: + print(b * d)" +p02553,s816412711,Wrong Answer,"a, b, c, d = map(int, input().split()) + +max = 0 +if max < a*b: + max = a*b +elif max < a*c: + max = a*c +elif max < a*d: + max = a*d +elif max < b*c: + max = b*c +elif max < b*d: + max = b*d +elif max < c*d: + max = c*d +print(max)" +p02553,s693947548,Wrong Answer,"a,b,c,d = map(int,input().split()) +ans = -10**9 +ab = [a,b] +cd = [c,d] +for i in ab: + for j in cd: + ans = max(i*j,ans) +print(ans)" +p02553,s613105282,Wrong Answer,"a,b,c,d=map(int,input().split()) +if a>=0 and c>=0: + print(b*d) +elif b<=0 and d<=0: + print(a*c) +elif a>=0 and d<=0: + print(a*d) +elif b<=0 and c>=0: + print(b*c) + + +" +p02553,s773322667,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if a < 0 or c < 0: + if a < 0 and c < 0: + print(a * c) + elif a < 0: + print(b * c) + elif c < 0: + print(a * d) +else: + print(b * d)" +p02553,s463791731,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b<0 and d<0: + print(a*c) +elif b<0 and d==0: + print(b*c) +elif b<0 and c>0: + print(a*c) +elif b==0 and d<0: + print(a*d) +elif b==0 and d==0: + print(a*c) +elif b==0 and c>0: + print(b*d) +elif a>0 and d<0: + print(a*d) +elif a==0 and d==0: + print(a*d) +elif a>0 and c>0: + print(b*d)" +p02553,s479317491,Wrong Answer,"n = list(map(int,input().split())) + +x = False +y = False + +if max(n[0],n[1]) <= 0: + x = True + +if max(n[2],n[3]) <= 0: + y = True + +if x and y: + ans = min(n[0],n[1]) * min(n[2],n[3]) +elif y: + ans = min(n[0],n[1]) * max(n[2],n[3]) +elif x: + ans = max(n[0],n[1]) * min(n[2],n[3]) +else: + ans = max(n[0],n[1]) * max(n[2],n[3]) + +print(ans)" +p02553,s529612472,Wrong Answer,"a,b,c,d = map(int,input().split()) +ans = [] +for i in b,c,d: + ans.append(a*i) +for j in c,d: + ans.append(b*i) +ans.append(c*d) + +print(max(ans))" +p02553,s416613666,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*c >= b*d: + if a*c >= a*d: + if a*c >= b*c: + print(a*c) +if a*d >= b*d: + if a*d >= b*c: + if a*d >= a*c: + print(a*d) +if b*c >= b*d: + if b*c >= a*d: + if b*c >= a*c: + print(b*c) +if b*d >= b*c: + if b*d >= a*d: + if b*d >= a*c: + print(b*d) +" +p02553,s119457540,Wrong Answer,"L = list(map(int, input().split())) +X = L[:2] +Y = L[2:] + +# ans = 0 +ans_max = -10**9 + +for x in X: + for y in Y: + ans = x * y + if ans > ans_max: + ans_max = ans +print(ans_max) + +" +p02553,s164298315,Wrong Answer,"a,b,c,d=map(int,input().split()) + +if a*b>0 and c*d>0 and (a<0 or c<0): + ans=max(a*d,b*c) +else: + ans=max(a*c,b*d) +print(ans)" +p02553,s193955267,Wrong Answer,"# coding: utf-8 +# Your code here! + +input_line = input().split("" "") +a = int(input_line[0]) +b = int(input_line[1]) +c = int(input_line[2]) +d = int(input_line[3]) + +if b > 0 and d > 0: + print(b * d) +if b <= 0 and d <= 0: + print(a * c) +if b > 0 and d <= 0: + print(b * d) +if b <= 0 and d > 0: + print(b * d) + + " +p02553,s450825491,Wrong Answer,"a, b, c, d = map(int, input().split()) +x = max([a, b]) +y = max([c, d]) +print(x*y) +" +p02553,s412652939,Wrong Answer,"import random + + +def gcd(a, b): + if a == 0: + return b + return gcd(b % a, a) + + +def lcm(a, b): + return (a * b) / gcd(a, b) +a=list(map(int , input().split())) +ans=-1 +for i in range(4): + for j in range(i+1,4): + if ans==-1: + ans=a[i]*a[j] + else: + ans=max(ans, a[i]*a[j]) +print(ans)" +p02553,s043617747,Wrong Answer,"a = list(map(int,input().split())) +max_a = 10**30 +import itertools +for i in itertools.combinations(a,2) : + #print(i[0]*i[1]) + if( i[0]*i[1] > max_a): + max_a = i[0]*i[i] + +print(max_a) +" +p02553,s319762311,Wrong Answer,"a,b,c,d=[int(_) for _ in input().split()] +if a<0 or b<0 or c<0 or d<0: + print(min(a,b)*max(c,d)) +else: + print(max(a,b)*max(c,d)) +" +p02553,s846816387,Wrong Answer,"a, b, c, d = [int(i) for i in input().split()] +list1 = [a,b] +list2 = [c,d] +ans = 0 +max = float(""-inf"") +print(list1) +for i in list1: + for j in list2: + ans = i * j + if (ans > max): + max = ans +print(max)" +p02553,s955537188,Wrong Answer,"a,b,c,d = map(int, input().split()) +import numpy as np +A = np.matrix([[a],[b]]) +C = np.matrix([c,d]) +print(A.shape) +print(C.shape) +X = np.dot(A,C) +print(np.max(X))" +p02553,s031000447,Wrong Answer,"a,b,c,d = (int(x) for x in input().split()) + +if a*b<=0 and c*d<=0: + if a*c > b*d: + print(a*c) + else: + print(b*d) + # print(""-+-+"") +elif b*d>=0: + # print(""b:d>0"") + print(b*d) +elif b<0: + # print(""b<0"") + print(b*c) +else: + # print(""b>0"") + print(a*d) +" +p02553,s241574521,Wrong Answer,"a,b,c,d=map(int,input().split()) +if d<0=0: + print(b*d) +else: + print(a*c)" +p02553,s312282108,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b < 0 and d < 0: + print(d*b) + +elif b < 0 and d > 0: + print(c * b) + + +elif b > 0 and d < 0: + print(d * a) + +elif a > 0 and b > 0: + print(a * b) + +else: + print(c * a) +" +p02553,s655947887,Wrong Answer,"a,b,c,d = map(int,input().split()) +ac = a*c +ad = a*d +bc = b*c +bd = b*d + +if ac>ad and ac>bc and ac>bd: + print(ac) +elif ad >bc and ad>bd and ad>ac: + print(ad) +elif bc>ac and bc>ad and bc>bd: + print(bd) +elif bd>ac and bd>ad and bd>bc: + print(bd)" +p02553,s301433342,Wrong Answer,"a,b,c,d = map(int, input().split()) + +if b <= 0 and d > 0: + print(b * c) +elif b > 0 and d <= 0: + print(a * d) +elif b <= 0 and d <= 0: + print(a * c) +elif b == 0 or d == 0: + print(0) +else: + if c < 0 and a < 0: + print(max(abs(a),b) * max(abs(c),d)) + else: + print(b * d)" +p02553,s591174567,Wrong Answer,"i = list(map(int,input().split())) +a = i[0] +b = i[1] +c = i[2] +d = i[3] + +if a >= 0 and c >= 0: + print(b*d) +elif a < 0 and b >= 0 and c < 0 and d >= 0: + if a*c >= b*d: + print(a*c) + else: + print(b*d) +elif b <= 0 and c >= 0: + print(b*c) +elif b >= 0 and c <= 0: + print(a*d) +else: + print(a*c)" +p02553,s034675686,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(b*d,a*c))" +p02553,s010582722,Wrong Answer,"a,b,c,d = map(int, input().split()) +l = [] +l.append(a*c) +l.append(a*d) +l.append(b*c) +l.append(b*d) + +l.sort() +print(l) +print(max(l))" +p02553,s528378957,Wrong Answer,"a,b,c,d=input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +if a>0: + if b*d>a*d: + print(b*d) + else: + print(a*d) +else: + if a*c>b*c: + print(a*c) + else: + print(b*c)" +p02553,s345137124,Wrong Answer,"def main(): + a,b,c,d=(int(x) for x in input().split()) + if b*d>=0: + x=b + y=d + print(x*y) + elif a<=0 and c<=0: + x=a + y=c + print(x*y) + elif b>d: + x=a + y=d + print(x*y) + elif b= 0: + print(b*c) +elif a >= 0 and d < 0: + print(a*d) +else: + print(b*d) +" +p02553,s048876298,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +print(max([a*b,a*c,b*c,b*d]))" +p02553,s582033246,Wrong Answer,"a,b,c,d = map(int,input().split()) + +xp = True if a + b > 0 else False +yp = True if c + d > 0 else False + +if xp: + if yp: + ans = b * d + else: + ans = a * d +else: + if yp: + ans = b * c + else: + ans = b * d + +print(ans)" +p02553,s172215798,Wrong Answer,"a, b, c, d = map(int, input().split()) +x = 0 +y = 0 + +if abs(a) >= abs(b): + x = a +else: + x = b + +if abs(c) >= abs(d): + y = c +else: + y = d + +if x*y <= 0: + if abs(a) >= abs(b): + x = b + else: + x = a + + if abs(c) >= abs(d): + y = d + else: + y = c + +print(x*y)" +p02553,s477199075,Wrong Answer,"a,b,c,d=(int(x) for x in input().split()) +p=max(a*c,a*d,b*c,b*d) +" +p02553,s455017134,Wrong Answer,"# B +z = list(map(int, input().split("" ""))) +maxnum = -1000000000000000000 +if z[0]*z[1] < 0 or z[2]*z[3] < 0: + maxnum = 0 +for i in range(2): + for j in range(2): + x = z[i] + y = z[j+2] + if maxnum < x*y: + maxnum = x*y +print(maxnum)" +p02553,s600447093,Wrong Answer,"a,b,c,d = map(int, input().split()) + +print(max(a*b, a*c, a*d, b*c, b*d, c*d))" +p02553,s573806629,Wrong Answer,"a,b,c,d = map(int, input().split()) + +list_xy = [a*c,a*d,b*c,b*d] + +max_xy = 0 + +for i in list_xy: + if i >= max_xy: + max_xy = i + +print(max_xy)" +p02553,s858064754,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a*c, b*d, a*d))" +p02553,s039505143,Wrong Answer,"a, b,c,d = map(int, input().split()) +if(b >= 0 and d >= 0): + print(b*d) +elif(b > 0 and d < 0): + print(a * c) +elif(b < 0 and d > 0): + print(b * c) +else: + print(b * d) + " +p02553,s081755010,Wrong Answer,"a,b,c,d = (int(x) for x in input().split()) +print(b*d)" +p02553,s339657466,Wrong Answer,"import sys +input = sys.stdin.readline + +a,b,c,d = map(int,input().split()) +answer = -10000000001 +if a > 0 and c > 0: + print(b*d) +elif a > 0 and c < 0: + print(a*d) +elif a < 0 and c < 0: + print(a*c) +elif a < 0 and c >0: + print(b*c) + +" +p02553,s875381999,Wrong Answer,"L = list(map(int,input().split())) +a=L[0] +b=L[1] +c=L[2] +d=L[3] + +if (a<0 and b>=0 and c<0 and d<0) or (a<0 and b<0 and c<0 and d>=0): + print(a*c) +elif (a>=0 and b>=0 and c<0 and d<0): + print(a*d) +elif (c>=0 and d>=0 and a<0 and b<0): + print(b*c) +else: + print(b*d)" +p02553,s430565931,Wrong Answer,"a, b, c, d = map(int, input().split()) +if abs(a) <= abs(b) and abs(c) <= abs(d): + print(b*d) +elif abs(a) > abs(b) and abs(c) <= abs(d): + print(b*c) +elif abs(a) <= abs(b) and abs(c) > abs(d): + print(a*d) +elif abs(a) > abs(b) and abs(c) > abs(d): + print(a*c)" +p02553,s557882751,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d))" +p02553,s190572696,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0: + if d <= 0: + print(a*d) + else: + print(b*d) + +elif b>0: + if c<0 and d<0: + print(a*c) + else: + print(b*d) +else: + if c>=0: + print(b*c) + else: + print(a*c)" +p02553,s457644175,Wrong Answer,"a,b,c,d,=map(int,input().split()) +if(a<-1 and c<-1): + x=a*c + print(x) +else: + y=b*d + print(y) + + +" +p02553,s513468273,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b < 0 and d > 0 : + print(b*c) +elif b > 0 and d < 0 : + print(a*d) +elif b == d and b == 0 : + print(a*c) +else : + print(b*d)" +p02553,s121463307,Wrong Answer,"a,b,c,d = map(int,input().split()) +answer =0 +if b < 0: + if c < 0: + answer = a*c + if c>=0: + answer = a * c +if b>=0: + if a <0: + answer = max(a*c ,b * d,0) + if a >= 0: + if d< 0: + if a == 0: + answer = 0 + else: + answer = a*d + if d>=0: + answer = b*d +print(answer) +" +p02553,s839387787,Wrong Answer,"L = list(map(int,input().split())) +a=L[0] +b=L[1] +c=L[2] +d=L[3] + +if (a<0 and b>=0 and c<0 and d<0) or (a<0 and b<0 and c<0 and d>=0): + print(a*c) +elif (a>=0 and b>=0 and c<0 and d<0): + print(a*d) +elif (c>=0 and d>=0 and a<0 and b<0): + print(b*c) +elif (a<0 and b>=0 and c<0 and d>=0): + print(max(a*c,b*d)) +else: + print(b*d) +" +p02553,s762983715,Wrong Answer,"a,b,c,d=map(int,input().split("" "")) +p=max(a*c,b*c,a*c,a*d) +print(p) +" +p02553,s278524815,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if b <= 0 and d <= 0: + print(a*c) +elif b < 0 and c >= 0: + print(b*c) +elif a >= 0 and d < 0: + print(a*d) +else: + print(b*d) +" +p02553,s861935284,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d))" +p02553,s616836156,Wrong Answer,"# coding: utf-8 +a,b,c,d = map(int,input().split()) + +print(max(a*b,b*c,c*d,b*c,b*d,c*d)) + +" +p02553,s681131493,Wrong Answer,"a, b, c, d = map(int, input().split()) + +print(max(abs(a), abs(b)) * max(abs(c), abs(d)))" +p02553,s116485845,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if d < 0 and b > 0: + print(a * d) +elif d > 0 and b < 0: + print(b * c) +elif a < 0 and c < 0: + print(a * c) +else: + print(c * d)" +p02553,s519028168,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a<0 and c<0 : + if b>=0 and d>=0: + if a*c >= b*d: + print(a*c) + else: + print(b*d) +elif a>0 and d<0: + print(a*d) +elif b<0 and d<0: + print(a*c) +else: + print(b*d)" +p02553,s368069670,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans=[a*b,a*c,a*d,b*c,b*d,c*d] +print(max(ans))" +p02553,s985107820,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ans = max(a*b, a*c, a*d, b*c, b*d, c+d) + +print(ans)" +p02553,s549398399,Wrong Answer,"templist = input().split() +a = int(templist[0]) +b = int(templist[1]) +c = int(templist[2]) +d = int(templist[3]) +flg1 = 0 +flg2 = 0 + +if b <= 0: + flg1 = 1 +if d <= 0: + flg2 = 1 + +if flg1 == 0 and flg2 == 0: + print(b * d) +elif flg1 == 1 and flg2 == 1: + if a * c >= b * d: + print(a * c) + else: + print(b * d) +elif flg1 == 1 and flg2 == 0: + print(b * c) +else: + print(a * d)" +p02553,s385525968,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b<0 and c<0: + print(a*c) +elif b<0 and d==0: + print(b*c) +elif b<0 and c>0: + print(b*c) +elif b==0 and d<0: + print(a*d) +elif b==0 and d==0: + print(a*c) +elif b==0 and c>0: + print(b*c) +elif a>0 and d<0: + print(a*d) +elif a>0 and d==0: + print(a*d) +elif a>0 and d>0: + print(a*d) +" +p02553,s809372717,Wrong Answer,"a,b,c,d = map(int, input().split()) +A = a * b +B = a * c +C = a * d +D = b * c +E = b * d +F = c * d +print(max(A,B,C,D,E,F))" +p02553,s185177928,Wrong Answer,"a,b,c,d = map(int,input().split()) + +ans = 0 +if b > 0 and d > 0: + ans = b*d +elif b <= 0 and d <= 0: + ans = a*c +elif b >= 0 and d <= 0: + ans = a*d +elif b <= 0 and d >= 0: + ans = b*c + +print(ans) + + + +" +p02553,s639328243,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,b*d))" +p02553,s567041215,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a*c, b*d, a*d, b*d)) +" +p02553,s564813593,Wrong Answer,"a, b, c, d = map(int, input().split()) + +A = a*c +B = a*d +C = b*c +D = b*d + + +max([A, B, C, D])" +p02553,s767024748,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*b,a*c,b*c,b*d))" +p02553,s080264708,Wrong Answer,"# -*- coding: utf-8 +a,b,c,d= map(int,input().split()) +if a>0 and c>0: + print(b*d) +if a<0 and c>0 or a>0 and c<0: + print(a*d) +if a<=0 and c <= 0 : + print(max(abs(a),abs(b))*max(abs(c),abs(d)))" +p02553,s099665407,Wrong Answer,"a,b,c,d=map(int,input().split()) +ans = -10**9 +for i in [a,b]: + for j in [c,d]: + ans = max(ans, i*j) + +print(ans) +" +p02553,s606546999,Wrong Answer,"import numpy as np +a, b, c, d = map(int, input().split()) +products = np.zeros(4) +products[0] = a * c +products[1] = a * d +products[2] = b * c +products[3] = b * d +print(int(np.max(products)))" +p02553,s670304699,Wrong Answer,"nums = [int(i) for i in input().split()] +a = nums[0] +b = nums[1] +c = nums[2] +d = nums[3] +ac = a*c +bd = b*d +if (ac<=0 and bd<=0): + max = a*d +elif (ac>=0 and bd>=0): + max = max(ac, bd) +elif ac>=0: + max = ac +elif bd>=0: + max = bd + +print(max)" +p02553,s685871559,Wrong Answer,"a, b, c, d = map(int, input().split()) +ans = 0 +if b != 0 and d != 0: + if c < 0: + ans = a * d + else: + ans = b * d +else: + ans = min(a, b) * min(c, d) + +print(ans)" +p02553,s648335245,Wrong Answer," +a,b,c,d = list(map(int, input().split())) +print(max(a*c, b*d)) +" +p02553,s576761465,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if 0<= a and 1 <= b and 0 <= c and 1 <= d: + print(b * d) +elif a < 0 and b <= 0 and c < 0: + print(a * c) +elif b < 0 and 0 <= c and 1 <= d: + print(b * c) +elif 0 <= a and d <= 0: + print(a * d)" +p02553,s336487407,Wrong Answer,"a,b,c,d = map(int, input().split()) +l = [i*j for i, j in zip(range(a,b+1), range(c,d+1))] +print(max(l))" +p02553,s213078949,Wrong Answer,"a,b,c,d = map(int, input().split()) + + + +if a >= 0 and c >= 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +elif a < 0 and c < 0: + if abs(a)>abs(b) and abs(c)>abs(d): + print(a*c) + else: + print(b*d) +elif (b<0 and c>0): + print(b*c) +elif (a>0 and d<0): + print(a*d) +else: + print(b*d)" +p02553,s605178676,Wrong Answer,"a,b,c,d = input().split() +print(max(int(a)*int(c),int(b)*int(d)))" +p02553,s541325074,Wrong Answer,"# -*- coding: utf-8 +a,b,c,d= map(int,input().split()) +if b <= 0 and d <= 0: + print(max(abs(a), abs(b)) * max(abs(c), abs(d))) +if a and b and c and d >0: + print(b*d) +if a<0 and b>0 and c<0 and d>0 : + print(max(abs(a),abs(b))*max(abs(c),abs(d))) +if b >0 and d<0: + print(a*d)" +p02553,s055287441,Wrong Answer,"a,b,c,d = map(int,input().split()) +answer =0 +if b < 0: + if c < 0: + answer = max(a*c,b*d) + if c>=0: + answer = max(a*c,b*d) +if b>=0: + if a <0: + answer = max(a*c ,b * d,0) + if a >= 0: + if d< 0: + if a == 0: + answer = 0 + else: + answer = a*d + if d>=0: + answer = b*d +print(answer) +" +p02553,s793106197,Wrong Answer,"a, b, c, d = list(map(int, input().split())) + +if b > 0 and d > 0: + print(b * d) +elif a < 0 and c < 0: + print(a * c) +else: + print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d))) +" +p02553,s777089848,Wrong Answer,"a,b,c,d = map(int,input().split()) +print(b*d)" +p02553,s738851732,Wrong Answer,"a,b,c,d = map(int,input().split()) +A = (a*c) +B = (a*d) +C = (b*c) +D = (c*d) +MAX = A + +if MAX < B: + MAX = B +elif MAX < C: + MAX = C +elif MAX < D: + MAX = D + +print(MAX)" +p02553,s352598843,Wrong Answer,"a,b,c,d = map(int ,raw_input().split()) + +print max(a*c, d*b)" +p02553,s810296523,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a * c, b * d))" +p02553,s886174306,Wrong Answer,"def resolve(): + a, b, c, d = map(int, input().split()) + if b <= 0 and d <= 0: + print(a * c) + elif a >= 0 and c >= 0: + print(b * d) + elif b <= 0 and c >= 0: + print(b * c) + elif d <= 0 and a >= 0: + print(a * d) + +resolve()" +p02553,s942613469,Wrong Answer,"a,b,c,d=map(int,input().split()) +m=a*c +if(a>0 and b>0 and c>0 and d>0): + m=b*d +elif(a<0 and b<0 and c<0 and d<0): + m=a*c +elif(a<0 and b<0 and c>0 and d>0): + m=b*c +elif(a>0 and b>0 and c<0 and d<0): + m=a*d +elif(a<0 and b>0 and c<0 and d>0): + max=a*c +print(m)" +p02553,s308910243,Wrong Answer,"a,b,c,d = map(int,input().split()) +answer =0 +if b < 0: + if c < 0: + answer = a*c + if c>=0: + answer = a * c +if b>=0: + if a <0: + answer = max(a*c ,b * d,0) + if a >= 0: + if d< 0: + if a == 0: + answer = 0 + answer = a*d + if d>=0: + answer = b*d +print(answer) +" +p02553,s906997033,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0: + if c>=0 or d>=0: + print(b*d) + else: + print(a*d) +elif b<0: + if d<0: + print(a*c) + else: + if a*c < b*d: + print(b*d) + else: + print(a*c)" +p02553,s683945670,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(max(a * c, a * d, b + c, b * d))" +p02553,s414229581,Wrong Answer,"a,b,c,d = map(int, input().split()) + +ans1 = a*c +ans2 = b*d + +if ans1 > ans2: + print(ans1) +else: + print(ans2)" +p02553,s739121488,Wrong Answer,"import sys +input = sys.stdin.readline + +a,b,c,d = map(int,input().split()) +answer = -10000000001 +if a >= 0 and c >= 0: + print(b*d) +elif a >= 0 and c < 0 and d > 0: + print(b*d) +elif a >= 0 and c < 0 and d < 0: + print(a*d) +elif a < 0 and c < 0: + print(a*c) +elif a < 0 and b >= 0 and c >=0: + print(b*d) +elif a < 0 and b < 0 and c >= 0: + print(b * c) + +" +p02553,s606391401,Wrong Answer,"#!/usr/bin/env python3 + +import sys +input=sys.stdin.readline + +a,b,c,d=map(int,input().split()) +if b<0 and d<0: + print(a*c) +elif b>=0 and d<0: + if a<=0: + print(0) + else: + print(a*d) +elif b<0 and d>=0: + if c<=0: + print(0) + else: + print(b*c) +elif b>=0 and d>=0: + print(max(b*d,a*c))" +p02553,s767312793,Wrong Answer,"import sys +input = sys.stdin.readline + +a,b,c,d = map(int,input().split()) +answer = -10000000001 +if a > 0 and c > 0: + print(b*d) +elif a > 0 and c < 0: + print(a*d) +elif a < 0 and c < 0: + print(a*c) +elif a < 0 and c >0: + print(b*d)" +p02553,s804992198,Wrong Answer,"a,b,c,d = map(int,input().split()) +if b>=0 and c>=0: + print(b*d) +elif b<0 and c>=0: + print(b*c) +elif a>=0 and c<0 and d>=0: + print(b*d) +elif a<0 and b>=0 and c<0 and d>=0: + print(b*d) +elif b<0 and c<0 and d>=0: + print(b*c) +elif a>=0 and d<0: + print(a*d) +elif a<0 and b>=0 and d<0: + print(a*c) +elif b<0 and d<0: + print(a*c)" +p02553,s281280646,Wrong Answer,"a,b,c,d=map(int,input().split()) +x,y,r=[],[],[] +for i in range(a,b+1): + x.append(i) +for i in range(c,d+1): + y.append(i) +print(x) +print(y) +for i in x: + for j in y: + r.append(i*j) +print(max(r)) +" +p02553,s287167787,Wrong Answer,"a, b, c, d = map(int, input().split()) + +mx = - (1 << 30) + +mx = max(a * c, mx) +mx = max(a * d, mx) +mx = max(b * c, mx) +mx = max(b * d, mx) + +print(mx) +" +p02553,s279477423,Wrong Answer,"# B +z = list(map(int, input().split("" ""))) +maxnum = -1000000000 +for i in range(2): + for j in range(2): + x = z[i] + y = z[j+2] + if maxnum < x*y: + maxnum = x*y +print(maxnum)" +p02553,s211571377,Wrong Answer,"def maxProduct(nums): + B = nums[::-1] + + for x in range(1,len(nums)): + if nums[x - 1] != 0: + nums[x] *= nums[x - 1] + + if B[x - 1] != 0: + B[x] *= B[x - 1] + return max(nums + B) +nums=list(map(int,input().split())) +print(maxProduct(nums))" +p02553,s461430019,Wrong Answer,"def resolve(): + a, b, c, d = list(map(int, input().split())) + ans = -10 ** 10 + + for x in (a, b): + for y in (c, d): + ans = max(ans, x * y) + + print(ans) + +resolve() +" +p02553,s639393138,Wrong Answer,"#!/usr/bin/env python3 +a,b,c,d=map(int,input().split()) +if b>0 and d>0: + print(b*d) +elif a<0 and c>=0: + print(b*c) +elif a>=0 and c<0: + print(a*d) +else: + print(a*c)" +p02553,s059965142,Wrong Answer,"a,b,c,d = map(int,input().split()) +if(b<0 and d<0): + print(a*b) +elif(b<0 or d<0): + print(0) +else: + print(b*d)" +p02553,s722878880,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a*d > b*d: + print(a*d) +elif a*c > b*d: + print(a*c) +elif b*c > b*d: + print(b*c) +elif b*d ==0: + print(a*c) +else: + print(b*d)" +p02553,s795689601,Wrong Answer,"li = list(map(int,input().split())) + +a = li[0] +b = li[1] +c = li[2] +d = li[3] + +ac = a * c +bc = b * c +ad = a * d +bd = b * d +result = ac +if result < bc: + result = bc +elif result < ad: + result = ad +elif result < bd: + result = bd +elif a <= 0 and 0 <= b and result < 0: + result = 0 +elif c <= 0 and 0 <= d and result < 0: + result = 0 +print(result)" +p02553,s854161805,Wrong Answer,"a,b,c,d = map(int,input().split()) +print(max(a*c,b*d))" +p02553,s385602001,Wrong Answer,"a,b,c,d=map(int,input().split()) +if b>0 and d>0: + print(b*d) +elif b>0 and d<=0: + print(a*d) +elif b<=0 and d>0: + print(b*c) +else: + print(a*c)" +p02553,s355326823,Wrong Answer,"a,b,c,d = list(map(int,input().split())) +if a>0 and c>0: + print(b*d) +elif a>0 and c<0: + print(a*d) +elif a<0 and c>0: + print(b*c) +else: + print(a*c)" +p02553,s516399181,Wrong Answer,"a,b,c,d = map(int, input().split()) + +print(max(a,b) * max(c,d))" +p02553,s496811171,Wrong Answer,"# -*- coding: utf-8 -*- +import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +a,b,c,d = map(int, readline().split()) +if a >= 0 and c >= 0: + print(b*d) +elif b <= 0 and d <= 0: + print(a*c) +else: + print(max(a*d,b*d,a*c,b*d))" +p02553,s199677796,Wrong Answer,"a,b,c,d= map(int,input().split()) +if b>=0 and d>=0: + print(b*d) +elif b>=0 and d<0 and a>=0: + print(a*d) +elif b>=0 and d<0 and a<0: + print(a*c) +elif b<0 and d>=0 and c>=0: + print(b*c) +elif b<0 and d>=0 and c<0: + print(a*c) +else: + print(a*c) + +" +p02553,s933484386,Wrong Answer,"a,b,c,d=map(int,input().split()) +" +p02553,s515849166,Wrong Answer,"a, b, c, d = map(int, input().split()) +ans = 0 + +if(b > 0 & d > 0): + ans = b*d +elif(b <= 0 & d <= 0): + ans = a*c +else: + ans = a*d + +print(ans)" +p02553,s485231937,Wrong Answer,"a, b, c, d = map(int, input().split()) + +ans = -2e10 +for x in [a, b]: + for y in [c,d]: + if x * y > ans: + ans = x * y +print(ans) +" +p02553,s918749825,Wrong Answer,"a,b,c,d = map(int,input().split()) +if a >= 0 and b >= 0 and c >= 0 and d >= 0: + print(b*d) +elif a < 0 and b < 0 and c < 0 and d < 0: + print(a*c) +elif a >= 0 and b >= 0 and c < 0 and d < 0: + print(a*d) +elif a < 0 and b < 0 and c >= 0 and d >= 0 : + print(c*d) +elif a < 0 and b >= 0 and c < 0 and d >= 0 : + if a * c > b * d : + print(a*c) + else: + print(b * d)" +p02553,s306834249,Wrong Answer,"a, b, c, d = map(int, input().split()) + +if (b < 0 and d < 0) or (b > 0 and d > 0): + print(b * d) +elif b < 0: + print(b * c) +elif d < 0: + print(a * c) +" +p02553,s655014325,Wrong Answer,"li = list(map(int,input().split())) + +a = li[0] +b = li[1] +c = li[2] +d = li[3] + +ac = a * c +bc = b * c +ad = a * d +bd = b * d +result = ac +if result < bc: + result = bc +elif result < ad: + result = ad +elif result < bd: + result = bd + +print(result) +" +p02553,s550225567,Wrong Answer,"import sys + +input_ = sys.stdin.readline + +a, b, c, d = [int(x) for x in input_().strip().split("" "")] + +x = max(a, b) +y = max(c, d) +if x >= 0 and y >= 0: + print(x * y) +elif x < 0 and y < 0: + print(min(a, b) * min(c, d)) +elif x < 0: + print(x * min(c, d)) +elif y < 0: + print(min(a, b) * y) +" +p02553,s274811589,Wrong Answer,"a, b, c, d = map(int, input().split()) +x = a if a >= b else b +y = c if c>= d else d +print(x*y)" +p02553,s042221631,Wrong Answer,"def calc(intA,intB,intC,intD): + #b>0 d>0 →x × y>0 + if b>0 and d>0: + ret = b*d + elif b<=0 and d<=0: + ret = a*c + elif b<=0 and d>0: + ret = b*c + elif b>0 and d<=0: + ret = a*d + return ret + +a,b,c,d = map(int,(input()).split()) + +print(calc(a,b,c,d))" +p02553,s291021993,Wrong Answer,"a, b, c, d = [int(x) for x in input().split()] + +max_x = b +max_y = d +min_x = a +min_y = c + +li = [max_x, max_y, min_x, min_y] + +max_num = -10**9 +for i in range(len(li)): + for j in range(i, len(li)): + num = li[i] * li [j] + if num > max_num: + max_num = num + +print(max_num) +" +p02553,s387700030,Wrong Answer,"array = input().split() + +a = float(array[0]) +b = float(array[1]) +c = float(array[2]) +d = float(array[3]) + +if b > 0 and d > 0: + print(""{:.0f}"".format(b*d)) +elif b <= 0 and d <= 0: + print(""{:.0f}"".format(a*c)) +elif b <= 0 and d > 0: + print(""{:.0f}"".format(b * c)) +elif b > 0 and d <= 0: + print(""{:.0f}"".format(a * d))" +p02553,s534667959,Wrong Answer,"a,b,c,d=map(int,input().split()) +if max(a,b)>0 and max(c,d)>0: + print(max(a,b)*max(c,d)) +elif max(a,b)<0 and max(c,d)<0: + print(min(a,b)*min(c,d)) +elif max(a,b)==0 and max(c,d)==0: + print(min(a,b)*min(c,d)) +elif max(a,b)<=0: + print(max(a,b)*min(c,d)) +else: + print(min(a,b)*max(c,d))" +p02553,s665687204,Wrong Answer,"a, b, c, d = map(int, input().split()) +if a > 0 and d < 0: + print(a * d) +elif b < 0 and c > 0: + print(b * c) +elif b <= 0 and d <= 0: + print(a * c) +else: + print(b * d) +" +p02553,s607386864,Wrong Answer,"a, b, c, d = map(int, input().split()) + +print(max(a * c, b * d))" +p02553,s400275224,Wrong Answer,"a, b, c, d = map(int, input().split(' ')) + +print(max(a,b) * max(c,d))" +p02553,s415807462,Wrong Answer,"a,b,c,d = map(int, input().split()) +if b > 0: + if d > 0: + print(b*d) + else : + print(a*d) +else : + if d > 0: + print(b*c) + else : + print(a*c)" +p02553,s719769311,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +if b<=0: + if c<=0: + print(c*a) + else: + print(b*c) +else: + if d<=0: + if a<0: + print(a*c) + else: + print(a*d) + else: + print(b*d) + + + " +p02553,s912457356,Wrong Answer,"n = list(map(int,input().split())) + +a =n[0]*n[2] +b =n[0]*n[3] +c =n[1]*n[2] +d =n[0]*n[3] + +x = max(a,b,c,d) + +print(x) +" +p02553,s277526922,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(a>= 0 and c>= 0): + print(b*d) +elif(b<=0 and d<=0): + print(a*c) +elif(a>=0 and d<=0): + print(a*d) +elif(b<=0 and c>=0): + print(b*c) +elif(a*c > b*d): + print(a*c) +elif(a*c < b*d): + print(b*d) + + + + + +" +p02553,s713115296,Wrong Answer,"a,b,c,d=list(map(int,input().split())) + +if a<=b: + s=b +else: + s=a + +if c<=d: + t=d +else: + t=c + +print(s*t)" +p02553,s505620653,Wrong Answer,"a,b,c,d = map(int,input().split()) +if(b<0 or d<0): + if(b>0 or d>0): + print(0) + else: + print(a*b) +else: + print(b*d)" +p02553,s699574244,Wrong Answer,"a,b,c,d=input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +if a>0: + if d>0: + print(b*d) + else: + print(a*d) +else: + if b>0: + if d>0: + print(b*d) + else: + print(a*d) + else: + print(b*c)" +p02553,s014585841,Wrong Answer,"a,b,c,d = list(map(int,input().split())) + +x1 = a * c +x2 = a * d +x3 = b * c +x4 = b * d + +max = x1 +if x2 > max: + max = x2 +elif x3 > max: + max = x3 +else: + max = x4 + +print(max)" +p02553,s725720106,Wrong Answer,"a, b, c, d = map(int, input().split()) +print(b * d) +" +p02553,s823698747,Wrong Answer,"a,b,c,d=map(int,input().split()) +if max(a,b)>0 and max(c,d)>0: + print(max(a,b)*max(c,d)) +elif max(a,b)<0 and max(c,d)<0: + print(min(a,b)*min(c,d)) +elif max(a,b)<=0: + print(max(a,b)*min(c,d)) +else: + print(min(a,b)*max(c,d))" +p02553,s316078374,Wrong Answer,"a,b,c,d = map(int,input().split()) + +if(a >= 0 and d <= 0): + print(a*d) +elif(a >= 0 and c >= 0): + print(b*d) +elif(b <= 0 and d <= 0): + print(a*c) +elif(b*c < b*d): + print(b*d) +else: + print(b*c) + + + + + + +" +p02553,s007221896,Wrong Answer,"a,b,c,d,=map(int,input().split()) +x=a*c +y=a*d +z=b*c +w=b*d +if(w 0: + print(a * d) +elif d > 0 and b <= 0: + print(c * b) +elif d <= 0 and b <= 0: + print(a * c) +else: + print(b * d) +" +p02553,s897412434,Wrong Answer,"a, b, c, d = map(int,input().split()) + +if (a >= 0 and c >= 0): + print(b * d) +elif (b < 0 and d < 0): + print(a * c) +elif (a > 0 and d < 0): + print(a * d) +else: + print(a * c)" +p02553,s160482966,Wrong Answer,"a = list(map(int,input().split())) + +for i in range(len(a)) : + if( a[i] < 0 ): + a[i] *= -1 + +a= sorted(a, reverse = True) + +print(a[0]*a[1])" +p02553,s370255362,Wrong Answer,"a,b,c,d = map(int,input().split()) +print(max(a,b)*max(c,d))" +p02553,s096502721,Wrong Answer,"a = list(map(int, input().split())) +ans = -float('inf') +for i, v in enumerate(a): + for j in a[i + 1:]: + ans = max(ans, v * j) +print(ans)" +p02553,s867833802,Wrong Answer,"a,b,c,d = map(int, input().split()) + +cross_list = [a*c, a*d, b*c, b*d] + +cross_list.sort +print(cross_list[3])" +p02553,s777005973,Wrong Answer,"a,b,c,d=map(int,input().split()) +print(max(a*c,a*d,b*c,b*c))" +p02553,s633938780,Wrong Answer,"a = list(map(int,input().split())) + +tmp = a[2] +flag = True +flag2 = True +result = [] + +if a[0] < 10 ** 5 and a[2] < 10 ** 5 and a[1] < 10 ** 5 and a[3] < 10 ** 5: + print(a[0] * a[2]) + exit(0) + +while flag: + flag2 = True + if a[0] < a[1]: + while flag2: + result.append(a[0] * tmp) + if tmp == a[3]: + flag2 = False + a[0] += 1 + tmp = a[2] + else: + tmp += 1 + else: + flag = False + +print(max(result))" +p02553,s696143106,Wrong Answer,"a,b,c,d = map(int,input().split()) +max = a*c +if a*d > max: + max = a*d +elif b*c > max: + max = b*c +elif b*d > max: + max = b*d + +print(max)" +p02553,s100496126,Wrong Answer,"a,b,c,d = (int(x) for x in input().split()) +if b and d >= 0: + if a*c > b*d : + print(a*c) + else: + print(b+d) +elif b and d < 0: + print(a*c) +elif b >=0 and d < 0: + if a*d > a*c : + print(a*d) + else: + print(a*c) +elif b <0 and d >= 0: + if a*c > b*c : + print(a*c) + else: + print(b*c)" +p02553,s130649455,Wrong Answer,"a,b,c,d = map(int,input().split()) +if b<=0: + if c<0: + print(a*c) + elif c>=0: + print(b*c) +if a >=0: + if d<=0: + print(a*d) + elif d>0: + print(b*d) +if a<=0 and b>=0: + if d<=0: + print(a*c) + elif c>=0: + print(b*d) + else: + print(max(a*c,b*d)) + " +p02553,s708853060,Wrong Answer,"a,b,c,d = (int(x) for x in input().split()) + +if a*b==0 or c*d==0: + print(0) +elif a*b<=0 and c*d<=0: + if a*c > b*d: + print(a*c) + else: + print(b*d) + # print(""-+-+"") +elif b*d>=0: + # print(""b:d>0"") + print(b*d) +elif b<0: + # print(""b<0"") + print(b*c) +else: + # print(""b>0"") + print(a*d) +" +p02553,s642435273,Wrong Answer,"a, b, c, d = map(int, input().split()) +if b >= 0 and d >= 0: + if abs(a) >= b and abs(c) >= d: + print(a * c) + else: + print(b * d) +elif b < 0 and d < 0: + print(a * c) +elif b < 0 and d >= 0: + if c <= 0: + print(0) + else: + print(b * c) +elif b >= 0 and d < 0: + if a <= 0: + print(0) + else: + print(a * d) + +" +p02553,s594789272,Wrong Answer,"a,b,c,d=input().split() +a=int(a) +b=int(b) +c=int(c) +d=int(d) +if a>0: + print(b*d) +else: + if a*c>b*d: + print(a*c) + else: + print(b*d)" +p02553,s975705635,Wrong Answer,"a,b,c,d=list(map(int,input().split())) +if (b and d)<0: + print(a*c) +elif b<0: + if c<0: + print(a*c) + else : + print(b*c) +elif d<0: + if a<0: + print(a*c) + else : + print(d*a) + +else: + print(d*b)" +p02623,s188678966,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b=[0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +ans,j=0,m +for i in range(n+1): + if a[i]>k: + break + while b[j]>k-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s734233995,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b=[0],[0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + + +ans,j=0,M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans =max(ans,i+j) + +print(ans)" +p02623,s291210312,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(n): + a += [a[i]+A[i]] +for i in range(m): + b += [b[i]+B[i]] + +ans, i = 0, m +for j in range(n+1): + if a[j] > k: + break + while b[i] > k-a[j]: + i -= 1 + ans = max(ans, i+j) +print(ans) + +" +p02623,s686189652,Accepted,"n,m,k = map(int, input().split()) +a = [int(_) for _ in input().split()] +b = [int(_) for _ in input().split()] + +t = sum(b) +j = m +ans = 0 +for i in range(n+1): + while j > 0 and t > k: + j -= 1 + t -= b[j] + if t > k: break + ans = max(ans, i + j) + if i==n:break + t+=a[i] + +print(ans)" +p02623,s692101328,Accepted,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +Asum = [0] +Bsum = [0] +a = 0 +b = 0 +for i in range(N): + a += A[i] + Asum.append(a) +for i in range(M): + b += B[i] + Bsum.append(b) +Asum.append(0) +Bsum.append(0) +res, j = 0, M +for i in range(N+1): + if Asum[i] > K: + break + while Asum[i] + Bsum[j] > K: + j -= 1 + res = max(res,i+j) +print(res)" +p02623,s990786808,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +asum = [0]*(n+1) +bsum = [0]*(m+1) +for i in range(n): + asum[i+1] = a[i] + asum[i] +for j in range(m): + bsum[j+1] = b[j] + bsum[j] +j = m +res = 0 +for i in range(n+1): + if asum[i] > k: + break + while asum[i] + bsum[j] > k: + j-=1 + res = max(res,i+j) +print(res) + +" +p02623,s413115783,Accepted,"import sys +import math +from collections import deque + +n,m,k=map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a=[0] +b=[0] + +for i in range(n): + a.append(A[i]+a[i]) +for i in range(m): + b.append(B[i]+b[i]) + +ans,j=0,m + +for i in range(n+1): + if a[i] > k : + break + while b[j] > k-a[i] : + j-=1 + ans = max(ans, i+j) + +print(ans) + +" +p02623,s023023114,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b=[0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) + +j,ans=m,0 +for i in range(n+1): + if a[i]>k: + break + while b[j] > k-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s698262423,Accepted,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s934920686,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s364222525,Accepted,"N,M,K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +for i in range(N): + A[i+1] += A[i] +for i in range(M): + B[i+1] += B[i] + +b = M +r = 0 +for i,a in enumerate(A): + if a > K: + break + while a+B[b]>K and b>=0: + b -= 1 + r = max(r, i+b) + +print(r)" +p02623,s824598378,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +ma = [0] * (N + 1) +mb = [0]*(M+1) + + +for i in range(N): + ma[i + 1] = ma[i] + A[i] + +for i in range(M): + mb[i + 1] = mb[i] + B[i] + +j = M +max_num = 0 + +for i in range(N+1): + if ma[i] > K: + break + while ma[i] + mb[j] > K: + j -= 1 + max_num = max(max_num, i + j) +print(max_num) +" +p02623,s613516729,Accepted,"#!/usr/bin/env python3 +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +A = [0] +B = [0] +for i in range(n): + A.append(A[i] + a[i]) +for i in range(m): + B.append(B[i] + b[i]) +ans = 0 +j = m +for i in range(n + 1): + if A[i] > k: + break + while j > 0 and k - A[i] < B[j]: + j -= 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s769103397,Accepted,"N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +res = 0 +j = M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + res = max(res, i+j) +print(res)" +p02623,s223858063,Accepted,"nums=[int(e) for e in input().split()] +A=[int(e) for e in input().split()] +B=[int(e) for e in input().split()] + +a, b = [0], [0] +for i in range(nums[0]): + a.append(a[i]+A[i]) +for i in range(nums[1]): + b.append(b[i]+B[i]) + +ans, j = 0, nums[1] +for i in range(nums[0]+1): + if a[i] > nums[2]: + break + while b[j] > nums[2] - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans) +" +p02623,s616365723,Accepted,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a = [0] +b = [0] + +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans = 0 +j = m +for i in range(0, n+1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s827008329,Accepted,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a,b = [0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) + +ans,j = 0,m +for i in range(n+1): + if a[i]>k: + break + while b[j]+a[i]>k: + j -= 1 + ans = max(ans,i+j) + +print(ans)" +p02623,s630005480,Accepted,"N, M, K = map(int, input().split()) +A = [0] + [int(i) for i in input().split()] +B = [0] + [int(i) for i in input().split()] + +N += 1 +M += 1 +for i in range(1, N) : + A[i] += A[i - 1] +for i in range(1, M) : + B[i] += B[i - 1] + +ret = 0 +a = N - 1 +b = 0 +while b < M : + while a >= 0 and A[a] + B[b] > K : + a -= 1 + if a >= 0 and A[a] + B[b] <= K : + ret = max(ret, a + b) + b += 1 + +print(ret)" +p02623,s671040871,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +sum_a = sum(A) +sum_b = 0 +b_next_ind = 0 +ans = 0 + +# 下からi冊減らす; i=0..N +for i in range(N + 1): + sum_b_max = K - sum_a + if sum_b_max >= 0: + while b_next_ind < M and sum_b + B[b_next_ind] <= sum_b_max: + sum_b += B[b_next_ind] + b_next_ind += 1 + ans = max(ans, (N - i) + b_next_ind) + sum_a -= A[N - 1 - i] + +print(ans) +" +p02623,s812619265,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ea=[0] +for i in range(n): + ea.append(ea[i]+a[i]) +eb=[0] +for i in range(m): + eb.append(eb[i]+b[i]) +tb=m +p=0 +for i in range(n+1): + while ea[i]+eb[tb]>k: + if tb==0: + break + tb-=1 + if ea[i]+eb[tb]<=k: + p=max(i+tb,p) +print(p)" +p02623,s152146486,Accepted,"import sys +input = lambda: sys.stdin.readline().rstrip() +import bisect + +def cumsum(a): + r = [0] + for v in a: + r.append(r[-1] + v) + return r + +n, m, k = map(int, input().split()) +a = cumsum(list(map(int, input().split()))) +b = cumsum(list(map(int, input().split()))) + +ans = 0 +for a_num, v in enumerate(a): + tmp = 0 + if k >= v: + b_num = bisect.bisect_right(b, k - v) - 1 + tmp = a_num + b_num + ans = max(ans, tmp) +print(ans) + + +" +p02623,s834362986,Accepted,"import bisect +import itertools +n,m,k=map(int,input().split()) +A=list(itertools.accumulate([0]+list(map(int,input().split())))) +B=list(itertools.accumulate([0]+list(map(int,input().split())))) + +ans=0 +for i,a in enumerate(A): + if a>k: + break + cnt=bisect.bisect_right(B,k-a)-1 + ans=max(ans,i+cnt) +print(ans)" +p02623,s672481342,Accepted,"import sys +readline = sys.stdin.readline + +N,M,K = map(int,readline().split()) +A = [0] + list(map(int,readline().split())) +B = [0] + list(map(int,readline().split())) + +for i in range(1,len(A)): + A[i] += A[i - 1] + +for i in range(1,len(B)): + B[i] += B[i - 1] + +ans = 0 +b_ind = len(B) - 1 +for i in range(len(A)): + if A[i] > K: + break + while b_ind >= 0 and A[i] + B[b_ind] > K: + b_ind -= 1 + + if ans < i + b_ind: + ans = i + b_ind + +print(ans) + + " +p02623,s581520167,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +ans = 0 +t = sum(B) +j = M +for i in range(N+1): + while j > 0 and t > K: + j -= 1 + t -= B[j] + if t > K: + break + ans = max(ans, i+j) + if i == N: + break + t += A[i] +print(ans)" +p02623,s670298124,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +a_, b_ = [0], [0] + +for i in range(n): + a_.append(a_[i] + a[i]) +for i in range(m): + b_.append(b_[i] + b[i]) + +ans, j = 0, m + +for i in range(n + 1): + if a_[i] > k: + break + while b_[j] > k - a_[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s018238497,Accepted,"import itertools +def main(): + n,m,k=map(int, input().split()) + a=[int(i) for i in input().split()] + b=[int(i) for i in input().split()] + a = [0]+list(itertools.accumulate(a)) + b = [0]+list(itertools.accumulate(b)) + res = 0 + j = m + best=0 + for i in range(n+1): + if(a[i]>k): + break + while(b[j] > k-a[i]): + j-=1 + res = max(res,i+j) + print(res) + + +if __name__ == '__main__': + main() +" +p02623,s390804738,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=0 +asum=0 +bsum=0 +pointer=0 +while pointerk and pointer>=0: + pointer-=1 + bsum-=b[pointer] + if asum+bsum>k: + break + ans=max(ans,(i+1)+pointer) +print(ans)" +p02623,s685555472,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +tot_a=0 +tot_b=0 +#Aだけでどこまでいけるか +a=[0] +b=[0] +for i in range(n): + a.append(a[-1]+A[i]) +for j in range(m): + b.append(b[-1]+B[j]) +#print(a,b) +ans=0 +j=m +for i in range(n+1): + if a[i]>k: + break + while a[i]+b[j]>k: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s379209264,Accepted,"from itertools import accumulate + +N, M, K = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) +cumsum_A, cumsum_B = [0] + list(accumulate(A)), [0] + list(accumulate(B)) +ans = 0 +j = M +for i in range(N+1): + if cumsum_A[i] > K: break + while cumsum_A[i] + cumsum_B[j] > K: j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s931894960,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K-a[i]: + j -= 1 + + ans = max(ans, i+j) + +print(ans)" +p02623,s274848202,Accepted,"n,m,k=map(int,input().split()) +arr1=list(map(int,input().split())) +arr2=list(map(int,input().split())) +acum1=[0] +for i in range(n): + acum1.append(acum1[-1]+arr1[i]) +acum2=[0] +for i in range(m): + acum2.append(acum2[-1]+arr2[i]) +ans=0 +j=m +for i in range(n+1): + if acum1[i]>k: + break + while acum2[j]>k-acum1[i] and j>0: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s847064019,Accepted,"import bisect + +def Csum(a): + b,c=[0],0 + for i in range(len(a)): + c+=a[i] + b.append(c) + return b + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +c,d=Csum(a),Csum(b) +d.pop(0) +ans=0 +for i in range(n+1): + if k-c[i]<0: + break + ans=max(ans,i+bisect.bisect_right(d,k-c[i])) +print(ans)" +p02623,s506792816,Accepted,"N,M,K=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=[0]+list(map(int,input().split())) +import itertools +A = list(itertools.accumulate(A)) +B = list(itertools.accumulate(B)) +ans=0 +b=M +for a in range(N+1): + if A[a]>K: + break + while A[a]+B[b]>K: + b-=1 + ans=max(ans,a+b) +print(ans)" +p02623,s881077578,Accepted,"from bisect import bisect_left, bisect_right + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +for i in range(n-1): a[i+1] = a[i] + a[i+1] +for i in range(m-1): b[i+1] = b[i] + b[i+1] +a = [0] + a; b = [0] + b + +c = bisect_right(a, k)-1 +ans = 0 + +for i in range(c+1)[::-1]: + r = k-a[i] + j = bisect_right(b, r)-1 + ans = max(ans, i+j) + +print(ans) +" +p02623,s251119491,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +c = [0] +d = [0] +for i in range(n): + c.append(c[i] + a[i]) +for i in range(m): + d.append(d[i] + b[i]) + +ans = 0 +j = m +for i in range(n + 1): + if c[i] > k: + break + while c[i] + d[j] > k: + j -= 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s638384170,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a,b=[0],[0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) +ans,j=0,M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans) +" +p02623,s449897171,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s546890530,Accepted,"import sys +import numpy as np +from numba import jit, njit +input = lambda: sys.stdin.buffer.readline().rstrip() + +@njit +def main(n,m,k,sa,sb): + rx = 0 + rb = m + for ra in range(0,n+1): + while (sb[rb] + sa[ra]) > k and rb>0 : + rb-=1 + if (sb[rb] + sa[ra]) <= k: + rx = max(rx,ra+rb) + return(rx) + +n,m,k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +sa = np.cumsum([0]+a) +sb = np.cumsum([0]+b) +print(main(n,m,k,sa,sb))" +p02623,s215723238,Accepted,"import bisect +from itertools import accumulate + +N, M, K = map(int, input().split()) +A = map(int, input().split()) +B = map(int, input().split()) + +A_cumsum = list(accumulate(A)) +B_cumsum = list(accumulate(B)) + +max_books = 0 +for a, A_sum in enumerate([0] + A_cumsum): + if A_sum > K: + break + else: + b = bisect.bisect(B_cumsum, K - A_sum) + max_books = max(a + b, max_books) + +print(max_books) +" +p02623,s370090702,Accepted,"from sys import stdin + +n, m, k = map(int, stdin.readline().rstrip().split()) + +a = list(map(int, stdin.readline().rstrip().split())) +b = list(map(int, stdin.readline().rstrip().split())) + +A,B = [0],[0] + +for i in range(n): + A.append(A[i]+a[i]) + +for i in range(m): + B.append(B[i]+b[i]) + +ans = 0 +j = m +for i in range(n + 1): + if A[i] > k: + break + while A[i] > k- B[j]: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s744362938,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans,j = 0 , M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans,i + j) +print(ans)" +p02623,s815614637,Accepted,"from bisect import bisect_right +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +accu = 0 +aa = [0] +for i in a: + accu += i + aa.append(accu) +accu = 0 +bb = [0] +for i in b: + accu += i + bb.append(accu) +ans = 0 +for i in range(n+1): + if aa[i]>k: + break + tmp = i+bisect_right(bb, k-aa[i])-1 + ans = max(tmp, ans) +print(ans)" +p02623,s029920660,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +x = [0] +y = [0] +for i in range(n): + x.append(x[i] + a[i]) + +for i in range(m): + y.append(y[i] + b[i]) + +i = 0 +j = m +ans = 0 +while i <= n and 0 <= j: + if x[i] + y[j] <= k: + ans = max(ans, i + j) + i += 1 + else: + j -= 1 + +print(ans)" +p02623,s641527347,Accepted,"n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a_time = [0] +b_time = [0] + +for i in range(n): + a_time.append(a_time[-1] + a[i]) +for j in range(m): + b_time.append(b_time[-1] + b[j]) + +j = m +cnt = 0 + +for i in range(n+1): + if a_time[i] > k: + continue + + while j > 0 and a_time[i] + b_time[j] > k: + j -= 1 + cnt = max(cnt, i + j) + +print(cnt) +" +p02623,s582338673,Accepted,"n, m, k = map(int, input().split(' ')) +a_list = list(map(int, input().split(' '))) +b_list = list(map(int, input().split(' '))) +sa = [0] * (n+1) +sb = [0] * (m+1) + +for i in range(n): + sa[i+1] = a_list[i] + sa[i] +for j in range(m): + sb[j+1] = b_list[j] + sb[j] + +best=0 +r = m +for i, a in enumerate(sa): + if a>k: + break + while ((a + sb[r]) > k) & (r>=0): + r-=1 + + best = max(best,i+r) + + + +print(best)" +p02623,s521591824,Accepted,"from bisect import bisect_right as br +from itertools import accumulate as ac +n,m,k=map(int,input().split()) +a=list(ac([0]+list(map(int,input().split())))) +b=list(ac([0]+list(map(int,input().split())))) +l=0 +for i in range(n+1): + if k K: + break + while b[l] > K - a[k]: + l -= 1 + ans = max(ans,k+l) +print(ans) +" +p02623,s185461668,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s074904557,Accepted,"import sys +input = sys.stdin.readline + +def main(): + N, M, K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + + import itertools + ac = [0] + list(itertools.accumulate(A)) + bc = [0] + list(itertools.accumulate(B)) + ans, j = 0, M + for i, a in enumerate(ac): + if a > K: + break + while a + bc[j] > K: + j -= 1 + ans = max(ans, i+j) + print(ans) + +if __name__ == '__main__': + main() +" +p02623,s667412725,Accepted,"N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +arui = [0] * (N + 1) +brui = [0] * (M + 1) +for i in range(N): + arui[i + 1] = a[i] + arui[i] +for i in range(M): + brui[i + 1] = b[i] + brui[i] + + +ans, j = 0, M +for i in range(N + 1): + if arui[i] > K: + break + while brui[j] > K - arui[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s945377615,Accepted,"import sys +import numpy as np +input = lambda: sys.stdin.readline().rstrip() + +def main(): + n,m,k = map(int, input().split()) + a = list(map(int, input().split())) + b = list(map(int, input().split())) + sa = np.cumsum([0]+a) + sb = np.cumsum([0]+b) + rx = 0 + rb = m + for ra in range(0,n+1): + while (sb[rb] + sa[ra]) > k and rb>0 : + rb-=1 + if (sb[rb] + sa[ra]) <= k: + rx = max(rx,ra+rb) + print(rx) + +if __name__ == '__main__': + main()" +p02623,s458966175,Accepted,"import sys +input = sys.stdin.buffer.readline + +import bisect +N, M, K = map(int, input().split()) +A = list(map(int, (input().split()))) +B = list(map(int, (input().split()))) +cumA, cumB = [0], [0] +for a in A: + cumA.append(cumA[-1]+a) +for b in B: + cumB.append(cumB[-1]+b) +ans = 0 +for i in range(N, -1, -1): + if cumA[i] > K: continue + j = bisect.bisect_right(cumB, K-cumA[i]) + ans = max(ans, i+j-1) +print(ans)" +p02623,s702196928,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] +T = 0 +ans = 0 + +for i in range(N): + a.append(a[i] + A[i]) + +for i in range(M): + b.append(b[i] + B[i]) + +j = M + +for i in range(N+1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i + j) + + +print(ans)" +p02623,s894461020,Accepted,"from bisect import bisect_right +from itertools import accumulate + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +a_ac=[0]+list(accumulate(a)) +b_ac=[0]+list(accumulate(b)) + +ans=0 +for i in range(n+1): + remain=k-a_ac[i] + if remain<0: + continue + t_ans=i + t_ans+=bisect_right(b_ac,remain)-1 + ans=max(ans,t_ans) + +print(ans)" +p02623,s034061097,Accepted,"N,M,K = map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b = [0],[0] + +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans = 0 +j = M + +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans,i+j) + +print(ans)" +p02623,s639248429,Accepted,"from bisect import bisect_right +from numpy import cumsum + +n, m, k = map(int, input().split()) +alst = list(map(int, input().split())) +blst = list(map(int, input().split())) +a_cum = cumsum(alst) +b_cum = cumsum(blst) +ans = bisect_right(b_cum, k) +for i, num in enumerate(a_cum, start = 1): + if num > k: + break + tmp = k - num + ans = max(ans, bisect_right(b_cum, tmp) + i) +print(ans)" +p02623,s957665070,Accepted,"n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a_time = [0] +b_time = [0] + +for i in range(n): + a_time.append(a_time[-1] + a[i]) +for j in range(m): + b_time.append(b_time[-1] + b[j]) + +j = m +cnt = 0 + +for i in range(n+1): + if a_time[i] > k: + continue + + while j > 0 and a_time[i] + b_time[j] > k: + j -= 1 + cnt = max(cnt, i + j) + +print(cnt)" +p02623,s778573873,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ans = 0 + +A = [0]*(n+1) + +for i in range(n): + A[i+1] = A[i] + a[i] + +B = [0]*(m+1) + +for i in range(m): + B[i+1] = B[i] + b[i] + +j = m + +for i in range(n+1): + if A[i] > k : + break + while B[j] > k-A[i]: + j -= 1 + + ans = max(ans,i+j) + + +print(ans) +" +p02623,s235553753,Accepted,"N, M, K =map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + + +a = [0] +b = [0] + +for i in range(N): + a.append(a[i] + A[i]) +for j in range(M): + b.append(b[j] + B[j]) + +ans = 0 +j = M + +for i in range(N+1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i+j) + + +print(ans) +" +p02623,s572102108,Accepted,"from itertools import accumulate +from bisect import bisect_right +n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A = list(filter(lambda x: x <= k, accumulate(A))) +B = list(filter(lambda x: x <= k, accumulate(B))) +ans = 0 +for i, a in enumerate(A): + j = bisect_right(B, k-a) + ans = max(ans, i+j+1) +ans = max(ans, len(B)) +print(ans)" +p02623,s886495034,Accepted,"import numpy as np +import sys +input = sys.stdin.buffer.readline + +N, M, K = map(int, input().split()) +cumA = np.zeros(N+1, dtype=np.int64) +cumA[1:] = np.array(input().split(), dtype=np.int64).cumsum() +cumB = np.zeros(M+1, dtype=np.int64) +cumB[1:] = np.array(input().split(), dtype=np.int64).cumsum() +# print(cumA) +# print(cumB) + +ans = 0 +for i in range(N, -1, -1): + if cumA[i] > K: continue + j = np.searchsorted(cumB, K-cumA[i], side='right') + ans = max(ans, i+j-1) +print(ans)" +p02623,s614050269,Accepted,"from sys import stdin +input = lambda: stdin.readline().rstrip(""\r\n"") +from collections import defaultdict as vector, deque as que +read = lambda: list(map(int,input().split())) +from bisect import bisect +from heapq import heappush as hpush,heappop as hpop + +n,m,k=read() +A=read() +B=read() +a,b=[0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +ans=0;j=m +for i in range(0,n+1): + curr=a[i] + if curr>k: + break + while(b[j]>k-curr): + j-=1 + ans=max(ans,i+j) +print(ans) + +" +p02623,s023043820,Accepted,"from itertools import accumulate +N, M, K = map(int, input().split()) +As = [0] + list(map(int, input().split())) +Bs = [0] + list(map(int, input().split())) +csum_A = list(accumulate(As)) +csum_B = list(accumulate(Bs)) + +ok = 0 +ng = N + M + 2 +while ng - ok > 1: + mid = (ng + ok) // 2 + min_time = 10 ** 9 + 10 + for t in range(max(0, mid-M), min(mid+1, N+1)): + min_time = min(min_time, csum_A[t] + csum_B[mid - t]) + + if K >= min_time: + ok = mid + else: + ng = mid + +print(ok) + " +p02623,s126147278,Accepted,"# Begin Header {{{ +from math import gcd +from collections import Counter, deque, defaultdict +from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge +from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort +from itertools import accumulate, product, permutations, combinations, combinations_with_replacement +# }}} End Header +# _________コーディングはここから!!___________ + +n, m, k = map(int, input().split()) +a = [0]+list(accumulate(map(int, input().split()))) +b = [0]+list(accumulate(map(int, input().split()))) +ans = [0] +for i in range(n+1): + c = bisect_right(b, k-a[i])-1 + if c!=-1: ans.append(c+i) +print(max(ans))" +p02623,s535705159,Accepted,"n, m, k = map(int, input().split()) + +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +a_, b_ = [0], [0] + +for i in range(n): + a_.append(a_[i] + a[i]) +for i in range(m): + b_.append(b_[i] + b[i]) + +ans = 0 +j = m + +for i in range(n+1): + + if a_[i] > k: + break + while b_[j] > k - a_[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s633261542,Accepted,"N, M, K = [int(_) for _ in input().split()] +A = [int(_) for _ in input().split()] +B = [int(_) for _ in input().split()] + +v = 0 +for i in range(N): + if v + A[i] <= K: + v += A[i] + else: + mi = i-1 + break +else: + mi = N-1 + +ans = mi+1 + +for j in range(M): + while mi > -1 and v + B[j] > K: + v -= A[mi] + mi -= 1 + v += B[j] + if v <= K: + ans = max(ans, mi+1+ j+1) + +print(ans) +" +p02623,s072395722,Accepted,"N, M, K = map(int, input().split()) + +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +AD = [0] +for i in range(N): + AD.append(AD[i]+A[i]) +BD = [0] +for i in range(M): + BD.append(BD[i]+B[i]) + +ans = 0 +for i in range(N+1): + if K < AD[i]: + break + else: + while BD[M] > K - AD[i]: + M -= 1 + ans = max(ans, i + M) + +print(ans) +" +p02623,s066640017,Accepted,"N, M, K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b=[0] ,[0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j=0, M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans=max(ans, i+j) +print(ans) +" +p02623,s605665091,Accepted,"from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +for i in range(1, N+1): + A[i] += A[i-1] + +for i in range(1, M+1): + B[i] += B[i-1] + +b_cnt = M + +ans = 0 +for a_cnt in range(N+1): + if A[a_cnt] > K: + continue + + rest = K - A[a_cnt] + + while A[a_cnt] + B[b_cnt] > K: + b_cnt -= 1 + + ans = max(ans, a_cnt + b_cnt) + +print(ans) +" +p02623,s124020856,Accepted,"#ABC172 C Tsundoku 22:34 +from itertools import accumulate + +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +s_A = [0]+list(accumulate(A)) +s_B = [0]+list(accumulate(B)) + +ans,j = 0, m +for i in range(n+1): + if s_A[i] > k: break + while s_B[j] > k - s_A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s420629182,Accepted,"import sys +from collections import deque +import copy +sys.setrecursionlimit(2147483647) +input = sys.stdin.readline + +if __name__ == '__main__': + n,m,k=map(int,input().strip(""\n"").split()) + A=list(map(int,input().strip(""\n"").split())) + B=list(map(int,input().strip(""\n"").split())) + t=sum(B) + j=m + ans=0 + for i in range(n+1): + while j>0 and t>k: + j-=1 + t-=B[j] + if t>k: + break + ans=max(ans,i+j) + if i==n: + break + t+=A[i] + print(ans) +" +p02623,s530490406,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +index = 0 +index2 = 0 +stackedTime = 0 + +while(index K: + break + id = bisect.bisect_right(SB, K - SA[i]) - 1 + ans = max(ans, i + id) + + +print(ans) +" +p02623,s338217854,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +aa = [0] +bb = [0] +for i in range(n): + aa.append(a[i]+aa[-1]) +for i in range(m): + bb.append(b[i]+bb[-1]) +ans = 0 +j = m +for i in range(n+1): + r = k - aa[i] + while bb[j] > r and j >= 0: + j -= 1 + if j >= 0: + ans = max(ans, i+j) +print(ans)" +p02623,s682978443,Accepted,"from itertools import accumulate, permutations + +import bisect +# ---------- + +INF = float(""inf"") +MOD = 10 ** 9 + 7 +# ---------- + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A = [0] + list(accumulate(A)) +B = [0] + list(accumulate(B)) + +ans = 0 +for i in range(N+1): + a = A[i] + if a > K: + break + r = K - a + j = bisect.bisect(B, r) - 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s476252625,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s582468771,Accepted,"import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline + +N, M, K = map(int, readline().split()) +A = list(map(int, readline().split())) +B = list(map(int, readline().split())) + +ac = [0] +bc = [0] + +for i in range(N): + ac.append(ac[i] + A[i]) +for i in range(M): + bc.append(bc[i] + B[i]) + +ans = 0 +j = M + +for i in range(N+1): + if ac[i] > K: + break + while bc[j] > K - ac[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans) +" +p02623,s788492995,Accepted,"import bisect + +n,m,k=map(int,input().split()) +arr1=list(map(int,input().split())) +arr2=list(map(int,input().split())) +acum1=[0] +for i in range(n): + acum1.append(acum1[-1]+arr1[i]) +acum2=[0] +for i in range(m): + acum2.append(acum2[-1]+arr2[i]) +ans=0 +for i in range(n+1): + if acum1[i]>k: + break + ans=max(ans,i+bisect.bisect_right(acum2,k-acum1[i])-1) +print(ans)" +p02623,s056487189,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a,b=[0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) + +ans=0 +j=m +for i in range(n+1): + if a[i]>k: + break + time=a[i]+b[j] + while time>k: + j-=1 + time=a[i]+b[j] + ans=max(ans,i+j) +print(ans)" +p02623,s749520665,Accepted,"'''ABC172 C''' +import numpy as np +n,m,k = map(int,input().split()) +a = np.array([int(i) for i in input().split()], dtype='int64') +b = np.array([int(i) for i in input().split()], dtype='int64') + +a_c = np.zeros(n+1,dtype='int64') +a_c[1:] = np.cumsum(a) + +b_c = np.zeros(m+1,dtype='int64') +b_c[1:] = np.cumsum(b) + +a_c = a_c[a_c <= k] +b_c = b_c[b_c <= k] +ans = 0 +for i,ai in enumerate(a_c): + n = np.searchsorted(b_c, k - ai, side = 'right') + ans = max(i + n-1, ans) +print(ans)" +p02623,s064366863,Accepted,"n,m,k = list(map(int,input().split("" ""))) +a = list(map(int,input().split("" ""))) +b = list(map(int,input().split("" ""))) +cnt = 0 +ans = 0 +j = m +t = sum(b) + +for i in range(n+1): + while j>0: + if t>k: #aのみの場合の処理が足りない(常にjでスキップされてしまう) + j -= 1 + t -= b[j] + else:break + if t<=k:ans = max(ans,i+j) + if i==n:break + t += a[i] +print(ans)" +p02623,s232903070,Accepted,"from bisect import bisect_right +from itertools import accumulate + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +a_ac=[0]+list(accumulate(a)) +b_ac=[0]+list(accumulate(b)) + +ans=0 +for i in range(n+1): + remain=k-a_ac[i] + if remain<0: + break + t_ans=i + t_ans+=bisect_right(b_ac,remain)-1 + ans=max(ans,t_ans) + +print(ans)" +p02623,s242703658,Accepted,"import bisect +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +a_sum=[] +b_sum=[] +a_sum.append(0) +b_sum.append(0) +for i in range(n): + a_sum.append(a_sum[i]+a[i]) +for j in range(m): + b_sum.append(b_sum[j]+b[j]) +ans=0 +for x in range(n+1): + timecount=k-a_sum[x] + if timecount>=0: + y=bisect.bisect_right(b_sum,k-a_sum[x])-1 + ans=max(x+y,ans) + else: + break +print(ans) + " +p02623,s913368748,Accepted,"n, m, k = map(int, input().split()) +a_list = list(map(int, input().split())) +b_list = list(map(int, input().split())) + +a = [] +a.append(0) +for i in range(n): + a.append(a[i]+a_list[i]) + +b = [] +b.append(0) +for i in range(m): + b.append(b[i]+b_list[i]) + + +ans = 0 +for i in range(n+1): + if a[i]>k: + break + while a[i] + b[m] > k: + m -= 1 + ans = max(ans, i+m) + +print(ans) + + + + + " +p02623,s381701396,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +ri,sum=-1,0 +for i in range(M): + if sum+B[i]<=K: + ri=i + sum+=B[i] + else : + break + +sum2,ans=0,ri+1 +for i in range(N): + sum2+=A[i] + if sum2>K: + break + while ri>=0 and sum2+sum>K: + sum-=B[ri] + ri-=1 + ans=max(ans,i+1+ri+1) +print(ans)" +p02623,s165019156,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +t = sum(B) + +# しゃくとり法 +res = 0 +j = m +for i in range(n + 1): + while j > 0 and t > k: + j -= 1 + t -= B[j] + if t > k: + break + res = max(res, i + j) + if i == n: break + t += A[i] + +print(res)" +p02623,s698182909,Accepted,"from bisect import bisect_right + +N,M,K = map(int,input().split()) +A = [0]+list(map(int,input().split())) +B = [0]+list(map(int,input().split())) +for i in range(1,N+1,1): + A[i]=A[i-1]+A[i] +for i in range(1,M+1,1): + B[i]=B[i-1]+B[i] + +ans = 0 +for i in range(0,N+1,1): + j = bisect_right(B,K-A[i])-1 + if K-A[i]>=0: + ans = max(ans,i+j) +print(ans)" +p02623,s904640539,Accepted,"import bisect + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ra = [0] * (n + 1) +rb = [0] * (m + 1) +for i in range(n): + ra[i + 1] = a[i] + ra[i] + +for j in range(m): + rb[j + 1] = b[j] + rb[j] + +ans = 0 +for i in range(n + 1): + zan = k - ra[i] + if zan < 0: + break + rbi = bisect.bisect_right(rb, zan) - 1 + if rbi < 0: + rbi = 0 + ans = max(ans, i + rbi) +print(ans) +" +p02623,s654078614,Accepted,"import itertools +import bisect + +n,m,k=map(int,input().split()) +a=[0]+list(map(int,input().split())) +b=list(map(int,input().split())) +aa=list(itertools.accumulate(a)) +bb=list(itertools.accumulate(b)) +r=0 +for i,ax in enumerate(aa): + bis=bisect.bisect_right(bb,k-ax) + if bis==0 and ax>k:continue + r=max(r,i+bis) +print(r)" +p02623,s996739049,Accepted,"N, M , K = map(int, input().split()) +X = [0] + list(map(int, input().split())) +Y = list(map(int, input().split())) +R,sY,j,t= 0,sum(Y),M,0 +for i in range(N+1): + t += X[i] + if t > K: break + while j and sY+t > K: + j-=1 + sY -= Y[j] + R = max(R, j+i) +print(R) +" +p02623,s799895310,Accepted,"N,M,K = map(int,input().split("" "")) +A = list(map(int,input().split("" ""))) +B = list(map(int,input().split("" ""))) + +time_A = [0]*(N+1) +time_B = [0]*(M+1) + +for i in range(N): + time_A[i+1] = time_A[i] + A[i] +for j in range(M): + time_B[j+1] = time_B[j] + B[j] + +ans = 0 +l = M + +for k in range(N+1): + if time_A[k] > K: + break + while time_A[k] + time_B[l] > K: + l -= 1 + ans = max(ans,k+l) + +print(ans)" +p02623,s803895544,Accepted,"import numpy as np +import bisect +N,M,K= map(int, input().split()) +A=list(map(int, input().split())) +B=list(map(int, input().split())) +if A[0]>K and B[0]>K:print(0);exit() + +Asum=[0] +for i in range(N): + if Asum[-1]+A[i]<=K: + Asum.append(Asum[-1]+A[i]) + else:break +Bsum=[0] +for j in range(M): + if Bsum[-1]+B[j]<=K: + Bsum.append(Bsum[-1]+B[j]) + else:break + +C=[] +for i in range(len(Asum)): + C.append(bisect.bisect(Bsum,K-Asum[i])+i-1) +print(max(C))" +p02623,s928135061,Accepted,"from bisect import bisect_right +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a=[0]*N +b=[0]*M +a[0]=A[0] +b[0]=B[0] +for i in range(N-1): + a[i+1]=a[i]+A[i+1] +for i in range(M-1): + b[i+1]=b[i]+B[i+1] +book=bisect_right(b,K) +for i in range(N): + if a[i]>K: + break + j=bisect_right(b,K-a[i]) + book=max(book,(i+1)+j) +print(book)" +p02623,s227694669,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0]*(N+1), [0]*(M+1) +for i in range(N): + a[i+1] = a[i] + A[i] +for i in range(M): + b[i+1] = b[i] + B[i] + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s976560066,Accepted,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a,b = [0],[0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans,j = 0,M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s237837643,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a=[0] +b=[0] + +for i in range(N): + a.append(a[i] + A[i]) + +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s827455501,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +AS=[0] +BS=[0] +r=0 +for i in A: + if i+AS[-1]<=k: + AS.append(i+AS[-1]) + else: + break + +for i in B: + if i+BS[-1]<=k: + BS.append(i+BS[-1]) + else: + break + +j=len(BS)-1 +for i in range(len(AS)): + while AS[i]+BS[j]>k: + j-=1 + r=max(r,i+j) +print(r)" +p02623,s662313916,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a,b = [0],[0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans = 0 +j = M +for i in range(N + 1): + if(a[i] > K): + break + while(a[i] + b[j] > K): + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s879019483,Accepted,"from itertools import accumulate +from bisect import bisect + +n, m, k = map(int, input().split()) +a = [*accumulate(map(int, input().split()), initial=0)] +b = [*accumulate(map(int, input().split()), initial=0)] +print(max(i - 1 + bisect(b, k - x) for i, x in enumerate(a) if x <= k)) +" +p02623,s768215267,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s465966417,Accepted,"import bisect + +N, M, K = map(int, input().split()) + +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +WA = [0] * (N + 1) +WB = [0] * (M + 1) +for i in range(N): + WA[i + 1] = WA[i] + A[i] +for j in range(M): + WB[j + 1] = WB[j] + B[j] +ma = 0 +last = False +for i in range(0, N + 1): + if WA[i] > K: + break + t = K - WA[i] + j = bisect.bisect(WB, t) + ma = max(ma, i + j - 1) + +print(ma) +" +p02623,s377968651,Accepted,"n,m,k,*a=map(int,open(0).read().split()) +s=sum(a[:n]) +x=i=j=n +a+=k, +while~i: + while s+a[j]<=k:s+=a[j];j+=1 + if s<=k:x=max(x,i+j) + i-=1;s-=a[i] +print(x-n)" +p02623,s914294866,Accepted,"n,m,k=map(int,input().split()) +a=[int(i) for i in input().split()] +b=[int(i) for i in input().split()] +ca=[0]*(n+1) +ca[1]=a[0] +for i in range(n): + ca[i+1]=ca[i]+a[i] +cb=[0]*(m+1) +cb[1]=b[0] +for i in range(m): + cb[i+1]=cb[i]+b[i] +j=m +ans=0 +for i in range(n+1): + t=ca[i] + while j>=0: + if t+cb[j]>k: + j-=1 + else: + ans=max(ans,i+j) + break +print(ans)" +p02623,s749969142,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] + +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M + +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s538532502,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s829459398,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a , b = [0] , [0] +for i in range(N): + a.append(a[i]+A[i]) +for j in range(M): + b.append(b[j]+B[j]) + +ans , j = 0 , M +for i in range(N+1): + if(a[i]>K): + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans , i+j) + +print(ans)" +p02623,s920147380,Accepted,"import bisect +N,M,K= map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +dpA = [0]*(N+1) +dpB = [0]*(M+1) + +for i in range(1,N+1): + dpA[i] = dpA[i-1] + A[i-1] + +for i in range(1,M+1): + dpB[i] = dpB[i-1] + B[i-1] + +ans = 0 +for i in range(N+1): + if dpA[i] > K: + continue + indexB = bisect.bisect_right(dpB, K - dpA[i]) + ans = max(ans, i + indexB - 1) + +print(ans)" +p02623,s754392288,Accepted,"import bisect +N,M,K = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +A = [0]*(N+1) +B = [0]*(M+1) +for i in range(N): + A[i+1] = A[i] + a[i] +for i in range(M): + B[i+1] = B[i] + b[i] + +possible = [0] +for i in range(N+1): + ans = i + nokori = K - A[i] + if nokori < 0: + break + else: + j = bisect.bisect_right(B,nokori) + ans += j-1 + possible.append(ans) + +print(max(possible))" +p02623,s424575913,Accepted,"n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +for i in range(1, n+1): + a[i] += a[i-1] +for i in range(1, m+1): + b[i] += b[i - 1] + +ans = 0 +b_cnt = m +for a_cnt in range(n+1): + if a[a_cnt] > k: + continue + while a[a_cnt] + b[b_cnt] > k: + b_cnt -= 1 + ans = max(ans, a_cnt + b_cnt) +print(ans) +" +p02623,s426603356,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +c=0 +A.insert(0,0) +B.insert(0,0) +import numpy as np +A=np.array(A).cumsum() +B=np.array(B).cumsum() + +for i in range(N+1): + d=K-A[i] + for j in reversed(range(M+1)): + if d-B[j]>=0: + if c k: + break + j = bisect_right(brui, k - arui[i]) + ans = max(ans, i + j - 1) +print(ans)" +p02623,s440863936,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +import bisect + +cum_a = [0] +for a in A: + cum_a.append(cum_a[-1] + a) + +cum = [0] +for b in B: + cum.append(cum[-1] + b) + +ans = 0 +for i in range(n + 1): + t = cum_a[i] + if t <= k: + bnum = i + else: + bnum = 0 + if t <= k: + idx = bisect.bisect_right(cum, k - t) + bnum += idx - 1 + ans = max(ans, bnum) +print(ans) +" +p02623,s116591875,Accepted,"import bisect +def LI(): + return list(map(int,input().split())) + +N,M,K = map(int,input().split()) +A = LI() +B = LI() + +cumA = [0] +for a in A: + cumA.append(cumA[-1]+a) + +cumB = [0] +for b in B: + cumB.append(cumB[-1]+b) + +res = 0 +for i in range(N+1): + cuma = cumA[i] + if cuma > K: continue + rem = K-cuma + deskb = bisect.bisect_right(cumB, rem)-1 + + res = max(res, i+deskb) + +print(res)" +p02623,s644121068,Accepted,"from itertools import accumulate +import bisect + +N,M,K = map(int,input().split()) + +A = list(map(int,input().split())) +B = list(map(int,input().split())) + + +#累積和 +a_acc =[0] + list(accumulate(A)) +b_acc =list(accumulate(B)) + +ans = 0 + +for an in range(len(a_acc)): + rem = K - a_acc[an] + if rem < 0: + break + + bn = bisect.bisect_right(b_acc, rem) + + ans = max(ans, an+bn) + + +print(ans)" +p02623,s380143307,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +A,B=[0],[0] +for i in range(n): + A.append(A[i]+a[i]) +for i in range(m): + B.append(B[i]+b[i]) +ans,j = 0,m +for i in range(n+1): + if A[i]>k: + break + while B[j] >k-A[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s416053839,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s368518773,Accepted,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +sa = [0] * (n+1) +for i in range(n): + sa[i+1] = sa[i] + a[i] +sb = [0] * (m+1) +for i in range(m): + sb[i+1] = sb[i] + b[i] + +ans = 0 +for i in range(n+1): + if sa[i] > k: + break + bi = bisect.bisect_right(sb, k-sa[i])-1 + ans = max(ans, i + bi) +print(ans)" +p02623,s456356589,Accepted,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a = [0] +b = [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans = 0 +j = M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s715177690,Accepted,"N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s683159295,Accepted,"n,m,k=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=[0]+list(map(int,input().split())) + +ans=0 +for i in range(1,n+1): + A[i]+=A[i-1] + + +for j in range(1,m+1): + B[j]+=B[j-1] + + +b_cnt=m +for a_cnt in range(n+1): + if A[a_cnt]>k: + continue + while A[a_cnt]+B[b_cnt]>k: + b_cnt-=1 + + ans=max(ans,a_cnt+b_cnt) +print(ans)" +p02623,s171522247,Accepted,"import sys +def input(): return sys.stdin.readline().strip() +def mapint(): return map(int, input().split()) +sys.setrecursionlimit(10**9) + +N, M, K = mapint() +As = [0]+list(mapint()) +Bs = [0]+list(mapint()) +from itertools import accumulate +from bisect import bisect_right +ac = list(accumulate(As)) +bc = list(accumulate(Bs)) + +ans = 0 +for i in range(N+1): + now = ac[i] + rest = K-now + if rest<0: + break + idx = bisect_right(bc, rest) + ans = max(ans, i+idx-1) +print(ans) + " +p02623,s706819293,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +As = [0] * (n + 1) +Bs = [0] * (m + 1) +for i in range(n): + As[i + 1] = A[i] + As[i] +for i in range(m): + Bs[i + 1] = B[i] + Bs[i] + +l = 0 +r = n + m + 1 +while r - l > 1: + p = (l + r) // 2 + best = k + 1 + for i in range(p + 1): + if min(i, n) + min(p - i, m) < p: + continue + best = min(best, As[i] + Bs[p - i]) + if best <= k: + l = p + else: + r = p +print(l)" +p02623,s563144964,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0]*(N+1) +b = [0]*(M+1) +for i in range(1, N+1): + a[i] = a[i-1] + A[i-1] +for j in range(1, M+1): + b[j] = b[j-1] + B[j-1] + +ans = 0 +j = M +for i in range(N+1): + if K - a[i] < 0: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s977388778,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0] +b = [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) +ans = 0 +j = m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s473021553,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +ans = 0 + +a, b = [0], [0] +for i in range(N): + a.append(A[i]+a[i]) +for i in range(M): + b.append(B[i]+b[i]) + +j = M + +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans = max(ans, i+j) +print(ans)" +p02623,s612405560,Accepted,"import numpy as np + +n, m, k = map(int, input().split()) +A = [int(x) for x in input().split()] +B = [int(x) for x in input().split()] + +a = [0] +b = [0] + +a = np.append(a, np.cumsum(A)) +b = np.append(b, np.cumsum(B)) + +j = m +ans = 0 +for i in range(n + 1): + if a[i] > k: + break + while a[i] + b[j] > k: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s006758321,Accepted,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +sa = [0 for i in range(n+1)] +sb = [0 for i in range(m+1)] + +c = 0 + +for i in range(n): + c += a[i] + sa[i+1] = c +c = 0 +for i in range(m): + c += b[i] + sb[i+1] = c +ans = 0 +# if k >= sum(a)+sum(b): +# print (n+m) +# exit() +for i in range(n+1): + x = k - sa[i] + if x < 0: + continue + y = bisect.bisect_right(sb,x) + y += i + ans = max(ans, y-1) +print (ans)" +p02623,s773102744,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0] +b = [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans = 0 + +for i in range(n + 1): + if a[i] > k: + break + while a[i] + b[m] > k: + m -= 1 + ans = max(ans, i + m) + +print(ans)" +p02623,s760784425,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +cuma = [0] +cumb = [0] +for a in A: + cuma.append(cuma[-1] + a) +for b in B: + cumb.append(cumb[-1] + b) +from bisect import bisect_left +ans = 0 +for i in range(n+1): + if k < cuma[i]: continue + idx = bisect_left(cumb, k - cuma[i] + 1) + ans = max(ans, i + idx - 1) +for j in range(m+1): + if k < cumb[j]: continue + idx = bisect_left(cuma, k - cumb[j] + 1) + ans = max(ans, j + idx - 1) +print(ans)" +p02623,s095490390,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] + +for i in range(N): + a.append(a[i] + A[i]) + +for j in range(M): + b.append(b[j] + B[j]) + +ans = 0 +j = M + +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(i + j, ans) + +print(ans)" +p02623,s559569783,Accepted,"from bisect import bisect +N, M, K = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) +a = [0] * (N+1) +b = [0] * (M+1) +for i in range(N): + a[i+1] = a[i] + A[i] +for i in range(M): + b[i+1] = b[i] + B[i] +ans = 0 +for i in range(N+1): + tmp = K - a[i] + if tmp < 0: + break + ans = max(ans, i + bisect(b, tmp) - 1) +print(ans)" +p02623,s776742469,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for idx, num in enumerate(A): + a.append(a[idx] + num) +for idx, num in enumerate(B): + b.append(b[idx] + num) + +ans = 0 +j = M + +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s375272098,Accepted,"import numpy as np +import bisect +n,m,k=map(int,input().split()) +a=list(map(int, input().split())) +b=list(map(int, input().split())) +A=np.cumsum(np.array([0]+a)) +B=np.cumsum(np.array(b)) +ans=0 +for i in range(n+1): + if A[i]>k: + break + t=k-A[i] + tmp=bisect.bisect_right(B,t) + ans=max(ans, i+tmp) +print(ans)" +p02623,s448304299,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +arr1, arr2 = [0], [0] +for i in range(n): + arr1.append(arr1[i] + A[i]) +for i in range(m): + arr2.append(arr2[i] + B[i]) + +count = 0 +j = m +for i in range(n + 1): + if arr1[i] > k: + break + while arr2[j] > k - arr1[i]: + j -= 1 + count = max(count, i + j) +print(count)" +p02623,s570035447,Accepted,"from bisect import * + +N,M,K,*f = map(int, open(0).read().split()) +A = f[:N] +B = f[N:] +csa = [0] +ans = 0 +for i in range(N): + csa.append(csa[i]+A[i]) +csb = [0] +for i in range(M): + csb.append(csb[i]+B[i]) +for i in range(N+1): + if csa[i] <= K: + bs = bisect_right(csb,K-csa[i]) + ans = max(ans,i+bs-1) + else: + break +print(ans)" +p02623,s151154904,Accepted,"import sys +from bisect import bisect +from itertools import accumulate + +n, m, k, *ab = map(int, sys.stdin.buffer.read().split()) +aaa = [0] + ab[:n] +bbb = [0] + ab[n:] +acc = list(accumulate(aaa)) +bcc = list(accumulate(bbb)) + +ans = 0 +for i in range(n + 1): + r = k - acc[i] + if r < 0: + break + j = bisect(bcc, r) - 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s538227538,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +s_a = [0] +s_b = [0] +for i in range(n): + s_a.append(s_a[i] + a[i]) +for i in range(m): + s_b.append(s_b[i] + b[i]) + +ans = 0 +tmp = m +for i in range(n+1): + for j in range(tmp+1)[::-1]: + if s_a[i] + s_b[j] <= k: + ans = max(ans, i+j) + tmp = j + break +print(ans)" +p02623,s059428365,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s517141440,Accepted,"import sys +readline = sys.stdin.readline + +N,M,K = map(int,readline().split()) + +A = [0] + list(map(int,readline().split())) +B = [0] + list(map(int,readline().split())) + +for i in range(1, len(A)): + A[i] += A[i - 1] + +for i in range(1, len(B)): + B[i] += B[i - 1] + +import bisect + +ans = 0 +for i in range(len(A)): + rest = K - A[i] + if rest < 0: + continue + if ans < i: + ans = i + b_read = bisect.bisect_right(B, rest) + if ans < i + b_read - 1: + ans = i + b_read - 1 + +print(ans)" +p02623,s533228659,Accepted,"from sys import stdin, stdout +input = stdin.readline +print = stdout.write +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) +for i in range(1, n + 1): + a[i] += a[i - 1] +for i in range(1, m + 1): + b[i] += b[i - 1] +i, j, z = 0, m, 0 +while i <= n and a[i] <= k: + while b[j] > k - a[i]: + j -= 1 + z = max(z, i + j) + i += 1 +print(str(z))" +p02623,s195932782,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s031737516,Accepted,"from itertools import accumulate +from bisect import bisect_left + +n,m,k=map(int,input().split()) +a=list(accumulate([0]+list(map(int,input().split())))) +b=list(accumulate([0]+list(map(int,input().split())))) +#print(b) +mx=0 +for i in range(n+1): + if a[i]>k:continue + #print('a[i];'+str(a[i])) + idx=min(bisect_left(b,k-a[i]),m) + #print(idx) + if b[idx]>k-a[i]:idx-=1 + if a[i]+b[idx]>k:continue + mx=max(mx,i+idx) +print(mx) + " +p02623,s178347885,Accepted,"import bisect + +n, m, k = map(int, input().split()) +a = [int(_) for _ in input().split()] +b = [int(_) for _ in input().split()] + +for i in range(1, n): + a[i] += a[i-1] +for i in range(1, m): + b[i] += b[i-1] + +a = [0] + a +b = [0] + b + +ans = 0 + +for i in range(n+1): + can = k - a[i] + if can < 0: + break + j = bisect.bisect_right(b, can) + ans = max(ans, i+j-1) +print(ans)" +p02623,s698452031,Accepted,"import bisect +N,M,K=[int(s) for s in input().split()] +A=[int(s) for s in input().split()] +B=[int(s) for s in input().split()] +Asum=[0 for i in range(N+1)] +Bsum=[0 for i in range(M+1)] +for i in range(N): + Asum[i+1]=Asum[i]+A[i] +for i in range(M): + Bsum[i+1]=Bsum[i]+B[i] +ans=[0 for i in range(N+1)] +t=bisect.bisect_right(Bsum,K)-1 +ans[0]=t +for i in range(1,N+1): + if Asum[i]>K: + break + while Bsum[t]+Asum[i]>K: + t-=1 + ans[i]=i+t +print(max(ans)) + + +" +p02623,s215704712,Accepted,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +tmpA = [0]*(N+1) +tmpB = [0]*(M+1) +ans = 0 + +import bisect +for i in range(1,N+1): + tmpA[i] = tmpA[i-1] + A[i-1] +for i in range(1,M+1): + tmpB[i] = tmpB[i-1] + B[i-1] +for i in range(N+1): + tmp = tmpA[i] + if tmp > K: + break + index = bisect.bisect_right(tmpB,K-tmp) + ans = max(i+index-1,ans) +print(ans)" +p02623,s771817667,Accepted,"from itertools import accumulate + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +a = [0] + list(accumulate(a)) +b = [0] + list(accumulate(b)) + +ans = 0 +j = m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s113274148,Accepted,"import itertools + +n, m, k = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +A = list(itertools.accumulate(A)) +B = list(itertools.accumulate(B)) + +count = 0 +j = m +for i in range(n+1): + if A[i] > k: + break + + while A[i]+B[j] > k: + j -= 1 + + count = max(count, i+j) + +print(count) +" +p02623,s055910677,Accepted,"from itertools import accumulate +from bisect import bisect_left,bisect_right + +def main(): + n,m,k=map(int,input().split()) + a=[0]+list(accumulate(map(int,input().split()))) + b=[0]+list(accumulate(map(int,input().split()))) + + result = 0 + for i in range(n+1): + tmp = k - a[i] + if tmp < 0: + continue + tmpNum = i + bisect_right(b, tmp) - 1 + if tmpNum > result: + result = tmpNum + + print(result) + + +if __name__ == ""__main__"": + main()" +p02623,s931973124,Accepted,"import bisect +N, M, K = [int(_) for _ in input().split()] +A = [int(_) for _ in input().split()] +B = [int(_) for _ in input().split()] + +A_sum = [0] +a_sum = 0 +for a in A: + a_sum += a + A_sum.append(a_sum) +B_sum = [0] +b_sum = 0 +for b in B: + b_sum += b + B_sum.append(b_sum) + +ans = 0 +for i in range(N+1): + b_time = K - A_sum[i] + if b_time < 0: + break + idx = bisect.bisect_right(B_sum, b_time) + ans = max(ans, i + idx-1) +print(ans) +" +p02623,s042678217,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +t, ans = sum(B), 0 +j = M +for i in range(N+1): + while j>0 and t>K: + j -= 1 + t -= B[j] + if t>K: break + ans = max(ans, i+j) + if i==N: break + t += A[i] + +print(ans)" +p02623,s460552931,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +At = [0]*(N+1) +Bt = [0]*(M+1) + +for i in range(N): + At[i+1] = At[i] + A[i] +for i in range(M): + Bt[i+1] = Bt[i] + B[i] + +j = M +ans = 0 +for i in range(N+1): + if At[i] > K: + break + while At[i] + Bt[j] > K: + j = j - 1 + if ans < i + j: + ans = i+j + +print(ans)" +p02623,s791156592,Accepted,"# coding: utf-8 +# Your code here! +import bisect + +N,M,K=map(int,input().split()) + +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +sum_A=[0] +for i in range(N): + sum_A.append(sum_A[-1]+A[i]) + + +sum_B=[0] +for i in range(M): + sum_B.append(sum_B[-1]+B[i]) + +ans=0 +for i in range(N+1): + target=K-sum_A[i] + if target>=0: + j=bisect.bisect(sum_B,target) + ans=max(ans,i+j-1) + +print(ans) + " +p02623,s356751265,Accepted,"from bisect import bisect_right +from itertools import accumulate + +N,M,K=map(int,input().split()) +A=list(accumulate([0]+[int(x) for x in input().split()])) +B=list(accumulate([0]+[int(x) for x in input().split()])) + +m=0 +for i in range(0,N+1): + if KK: + break + while b[j] > K-a[i]: + j-=1 + ans=max(ans, i+j) +print(ans)" +p02623,s656098789,Accepted,"from itertools import accumulate +from bisect import bisect + +n, m, k = map(int, input().split()) +(*a,) = accumulate(map(int, input().split())) +(*b,) = accumulate(map(int, input().split())) +a = (0,) + tuple(i for i in a if i <= k) +b = tuple(i for i in b if i <= k) +print(max(i + bisect(b, k - a[i]) for i in range(len(a))))" +p02623,s577208086,Accepted,"import bisect +N,M,K = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ac = [0]*(N+1) +bc = [0]*(M) +bc[0] = b[0] +for i,val in enumerate(a): + ac[i+1] = ac[i] + val +for i,val in enumerate(b[1:]): + bc[i+1] = bc[i] + val +res = 0 +for i,val in enumerate(ac): + if val > K: + break + rest = K-val + idx = bisect.bisect_right(bc, rest) + if idx+i > res: + res = idx+i +print(res) +" +p02623,s231188989,Accepted,"import numpy as numpy +import bisect as bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +a.insert(0,0) +ali = numpy.cumsum(a) +bli = numpy.cumsum(list(map(int,input().split()))) +a = [0] +for i in range(n+1): + if ali[i] > k: + break + b = bisect.bisect_right(bli,k-ali[i]) + a.append(i+b) +print(max(a))" +p02623,s974786411,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +#total = 0 +books = 0 +#i = 0 +A,B = [0],[0] +for i in range(n): + A.append(A[i]+a[i]) +for j in range(m): + B.append(B[j]+b[j]) + +l = m + +for i in range(n+1): + if A[i]>k: + break + while B[l]>k-A[i]: + l -= 1 + books = max(books,i+l) + +print(books)" +p02623,s872388401,Accepted,"n,m,k = map(int,input().split()) + +a = list(map(int,input().split())) + +b = list(map(int,input().split())) + + +c = [0] +d = 0 +for i in range(n): + d += a[i] + c.append(d) + +e = [0] +f = 0 +for i in range(m): + f += b[i] + e.append(f) + + +ans = 0 +j = m +for i in range(n+1): + if c[i] > k: + break + else: + while c[i] + e[j] > k: + j -= 1 + ans = max(i + j,ans) + +print(ans)" +p02623,s889044841,Accepted,"from sys import stdin +from sys import setrecursionlimit +from itertools import accumulate +import bisect + +n,m,k = map(int,stdin.readline().rstrip().split()) +a = list(map(int,stdin.readline().rstrip().split())) +b = list(map(int,stdin.readline().rstrip().split())) + +aa = [0]+list(accumulate(a)) +bb = [0]+list(accumulate(b)) +ma = 0 + +for i,j in enumerate(aa): + if j > k: + break + nowa = i + nowb = bisect.bisect(bb,k-j)-1 + ma = max(ma,nowa+nowb) + +print(ma)" +p02623,s266673299,Accepted,"a,b,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +from itertools import accumulate + +A = list(accumulate(A)) +B = list(accumulate(B)) +A = [0] + A +B = [0] + B + +ans = 0 +num = b +for i in range(a+1): + if A[i] > k: + continue + while True : + if A[i] + B[num] > k: + num -=1 + else: + ans = max(ans,i+num) + break +print(ans)" +p02623,s116380340,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + + +ans, j = 0, M +anss = [] +for i in range(1+N): + if a[i] > K: + break + while 1: + if a[i] + b[j] <= K: + break + j -= 1 + + ans = max(ans, i+j) + + +print(ans) +" +p02623,s313255711,Accepted,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.insert(0, 0) +B.insert(0, 0) +for i in range(1, N+1): + A[i] += A[i-1] +for i in range(1, M+1): + B[i] += B[i-1] +ans = 0 +for i in range(N+1): + sub = 0 + if A[i] <= K: + sub += i + sub += bisect.bisect_right(B, K-A[i])-1 + ans = max(sub, ans) +print(ans)" +p02623,s306048827,Accepted,"n,m,k = map(int,input().split()) +arr1 = list(map(int,input().split())) +arr2 = list(map(int,input().split())) + +acum1 = [0] +for i in range(n): + acum1.append( acum1[-1] + arr1[i]) + +acum2 = [0] +for i in range(m): + acum2.append(acum2[-1] + arr2[i]) + +ans = 0 +j = m +for i in range(n+1): + if acum1[i]>k: + break + while acum2[j]>k-acum1[i] and j>0: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s600380507,Accepted,"n,m,k = map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +aa = [0] +bb = [0] + +for i in range(n): + aa.append(a[i]+aa[i]) + +for i in range(m): + bb.append(b[i]+bb[i]) + +ans=0 +j=m +for i in range(n+1): + if aa[i]>k: + break + while bb[j]>k-aa[i]: + j-=1 + ans=max(i+j,ans) +print(ans)" +p02623,s318998553,Accepted,"n,m,k=map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a, b = [0], [0] + +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m + +for i in range(n+1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s141034461,Accepted,"# 尺取法ver + +n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +asum, bsum = [0], [0] +for i in range(n): + if k < a[i] + asum[i]: + break + asum.append(a[i] + asum[i]) +for i in range(m): + if k < b[i] + bsum[i]: + break + bsum.append(b[i] + bsum[i]) + +ans = 0 +b_count = len(bsum)-1 +for a_count in range(len(asum)): + while asum[a_count] + bsum[b_count] > k: + b_count -= 1 + ans = max(ans, a_count + b_count) +print(ans) +" +p02623,s586066068,Accepted,"from itertools import accumulate +n, m, k = map(int, input().split()) +Acum = [0]+list(accumulate(map(int, input().split()))) +Bcum = [0]+list(accumulate(map(int, input().split()))) + +ans = 0 +b = m +for a in range(n+1): + if k < Acum[a]: + break + while k < Acum[a]+Bcum[b]: + b -= 1 + if ans < a+b: + ans = a+b +print(ans) +" +p02623,s768700250,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +C = A[::-1] + B + +right = 0 +size = 0 +ans = 0 +for left in range(N+M): + while right < (N+M) and size+C[right] <= K: + size += C[right] + right += 1 + if left <= N and N <= right: + ans = max(ans, (right-left)) + if left == right: + right += 1 + else: + size -= C[left] + +print(ans) +" +p02623,s366792583,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a=[0] +b=[0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s698370335,Accepted,"from itertools import accumulate +from bisect import bisect_right +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = list(accumulate(A)) +b = list(accumulate(B)) + +ans = 0 +for i in range(N): + tmp = a[i] + if tmp <= K: + j = bisect_right(b, K-tmp) + ans = max(ans, i+j+1) +ans = max(ans, bisect_right(b, K)) +print(ans) +" +p02623,s329800614,Accepted,"from itertools import accumulate +from bisect import bisect + +n, m, k = map(int, input().split()) +a = accumulate(map(int, input().split()), initial=0) +b = [*accumulate(map(int, input().split()))] +print(max(i + bisect(b, k - x) for i, x in enumerate(a) if x <= k)) +" +p02623,s654435280,Accepted,"N, M, K= map(int, input().split()) +A=list(map(int, input().split())) +B=list(map(int, input().split())) + +Asum=[0] +Bsum=[0] + +for i in range(N): + Asum.append(Asum[-1]+A[i]) + +for i in range(M): + Bsum.append(Bsum[-1]+B[i]) + +m=0 +j=M + +for i in range(len(Asum)): + if Asum[i]>K: + break + while Asum[i]+Bsum[j]>K: + j-=1 + if m= 0): + if A_cs[i] + B_cs[j] <= K: + total = max(total,i + j) + break + j -= 1 + +print(total) +" +p02623,s838123631,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s667901107,Accepted,"#!/usr/bin/env python3 +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0] +b = [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans = 0 +j = M +for i in range(N+1): + if a[i] > K: + break + while b[j] + a[i] > K: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s435954364,Accepted,"def resolve(): + import numpy as np + + N, M, K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + + A = np.insert(np.cumsum(A), 0, 0) + B = np.insert(np.cumsum(B), 0, 0) + + ans = 0 + j = M + for i in range(N + 1): + if A[i] > K: + break + while A[i] + B[j] > K: + j -= 1 + + ans = max(ans, i + j) + + print(ans) + +resolve() +" +p02623,s274652384,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +As = [0] * (n + 1) +Bs = [0] * (m + 1) +for i in range(n): + As[i + 1] = A[i] + As[i] +for i in range(m): + Bs[i + 1] = B[i] + Bs[i] + +l = 0 +r = n + m + 1 +while r - l > 1: + p = (l + r) // 2 + best = min( + As[i] + Bs[p - i] for i in range(p + 1) + if min(i, n) + min(p - i, m) == p + ) + if best <= k: + l = p + else: + r = p +print(l)" +p02623,s637417957,Accepted,"N, M, K = map(int, input().split()) + +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b = [0], [0] + +for i in range(N): + a.append(a[i] + A[i]) + +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M + +for i in range(N+1): + if a[i] > K: + break + + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s301070494,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +aa,bb=[0],[0] +for i in range(n): + aa.append(aa[i]+a[i]) +for i in range(m): + bb.append(bb[i]+b[i]) +ans,j=0,m +for i in range(n+1): + if aa[i]>k: + break + while bb[j] > k-aa[i]: + j -= 1 + ans=max(ans,i+j) +print(ans)" +p02623,s204950520,Accepted," +import bisect +import numpy + +n, m, k = map(int, input().split("" "")) +a = list(map(int, input().split("" ""))) +b = list(map(int, input().split("" ""))) + +cost_a = numpy.insert(numpy.cumsum(a), 0, 0) +cost_b = numpy.insert(numpy.cumsum(b), 0, 0) + +ans = 0 +j = len(cost_b) -1 +for i in range(len(cost_a)): + for j in range(j, -1, -1): + if cost_a[i] + cost_b[j] <= k: + ans = i + j if ans < i + j else ans + break +print(ans)" +p02623,s288093575,Accepted,"N,M,K=map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +import bisect +for i in range(1,N): + A[i] += A[i-1] +for i in range(1,M): + B[i] += B[i-1] + + +res = bisect.bisect_right(B,K) + +for i in range(N): + if K >= A[i]: + j=bisect.bisect_right(B,K-A[i]) + res=max(res, i+1+j) + +print(res) +" +p02623,s516653344,Accepted,"from bisect import bisect_right + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +a_ac=[0] +for i in range(1,n+1): + a_ac.append(a_ac[i-1]+a[i-1]) + +b_ac=[0] +for i in range(1,m+1): + b_ac.append(b_ac[i-1]+b[i-1]) + +#print(a_ac) +#print(b_ac) + +ans=0 +for i in range(n+1): + remain=k-a_ac[i] + if remain<0: + continue + t_ans=i + t_ans+=bisect_right(b_ac,remain)-1 + ans=max(ans,t_ans) + +print(ans)" +p02623,s420629267,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +aa = [0] +bb = [0] +for i in range(n): + aa.append(aa[-1]+a[i]) +for i in range(m): + bb.append(bb[-1]+b[i]) +c = m +ans = 0 +for i in range(n+1): + u = k - aa[i] + for j in range(c, -1, -1): + if bb[j] <= u: + ans = max(ans, i+j) + c = j + break +print(ans)" +p02623,s744289514,Accepted,"import sys +input = sys.stdin.buffer.readline + +import bisect +N, M, K = map(int, input().split()) +A = list(map(int, (input().split()))) +B = list(map(int, (input().split()))) +cumA, cumB = [0], [0] +for a in A: + cumA.append(cumA[-1]+a) +for b in B: + cumB.append(cumB[-1]+b) +ans = 0 +for i in range(N, -1, -1): + if cumA[i] > K: continue + j = bisect.bisect_right(cumB, K-cumA[i]) + ans = max(ans, i+j-1) +print(ans)" +p02623,s181382490,Accepted,"import itertools + +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +acc_A = [0]+list(itertools.accumulate(A)) +acc_B = [0]+list(itertools.accumulate(B)) + +ans, j = 0, m +for i in range(n+1): + if acc_A[i] > k: + break + while acc_A[i] + acc_B[j] > k: + j -= 1 + ans = max(ans, i+j) +print(ans) + " +p02623,s088961515,Accepted,"import bisect +N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +S = [0]*N +T = [0]*M +S[0] = A[0] +for k in range(1,N): + S[k] = S[k-1] + A[k] +T[0] = B[0] +for k in range(1,M): + T[k] = T[k-1] + B[k] + +ans = bisect.bisect_right(T,K) +for k in range(N): + if K-S[k] >= 0: + ans = max(ans,k+1+bisect.bisect_right(T,K-S[k])) +print(ans) +" +p02623,s794823973,Accepted,"n, m, k = map(int, input().split()) +an = list(map(int, input().split())) +bn = list(map(int, input().split())) + +a_sum = [0] +b_sum = [0] +for i in range(1, n+1): + a_sum.append(a_sum[i-1] + an[i-1]) +for j in range(1, m+1): + b_sum.append(b_sum[j-1] + bn[j-1]) + +idx = len(bn) +ans = 0 +for i in range(n+1): + while a_sum[i] + b_sum[idx] > k: + idx -= 1 + if idx == -1: + break + if idx == -1: + break + ans = max(ans, i + idx) + +print(ans) + +" +p02623,s425238941,Accepted,"N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +for i in range(1, N+1): + A[i] += A[i-1] + +for i in range(1, M+1): + B[i] += B[i-1] + + +ans = 0 +b_count = M +for a_count in range(N+1): + if A[a_count] > K: + continue + + while A[a_count] + B[b_count] > K: + b_count -= 1 + + ans = max(ans, a_count + b_count) +print(ans) +" +p02623,s150939286,Accepted,"N, M, K = map(int, input().split()) +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) + +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(len(a)): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s385908381,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] + +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M + +for i in range(N+1): + if a[i] > K: + break + while b[j] > K-a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans) " +p02623,s325716883,Accepted,"import bisect +import itertools +N, M, K = [int(_) for _ in input().split()] +A = list(itertools.accumulate([0] + [int(_) for _ in input().split()])) +B = list(itertools.accumulate([0] + [int(_) for _ in input().split()])) +ans = 0 +for i, a in enumerate(A): + if a > K: + break + ans = max(ans, i + bisect.bisect(B, K - a) - 1) +print(ans) +" +p02623,s533036608,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s687445397,Accepted,"n, m, k = map(int, input().split()) +a_ = list(map(int, input().split())) +b_ = list(map(int, input().split())) + +a = [0] +for i in range(n): + a.append(a[i]+a_[i]) + +b = [0] +for i in range(m): + b.append(b[i]+b_[i]) + +j = m +ans = 0 +for i in range(n+1): + if a[i] > k: + break + while 1:#b[j] > k - a[i]: + if b[j] <= k - a[i]: + break + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s259528070,Accepted,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +Asum = [0] +Bsum = [0] +a = 0 +b = 0 +for i in range(N): + a += A[i] + Asum.append(a) +for i in range(M): + b += B[i] + Bsum.append(b) +Asum.append(0) +Bsum.append(0) +res, j = 0, M +for i in range(N+1): + if Asum[i] > K: + break + while Asum[i] + Bsum[j] > K: + j -= 1 + res = max(res,i+j) +print(res)" +p02623,s448804674,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a,b=[0],[0] +for i in range(N): + a.append(a[i] + A[i]) + + +for i in range(M): + b.append(b[i] + B[i]) +count = 0 +j = M +for i in range(N + 1): + if a[i]>K: + break + while b[j]+a[i]> K : + j -= 1 + count = max(count, i+j) +print(count)" +p02623,s074743040,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] + +for i in range(n): + a.append(a[i] + A[i]) + +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m + +for i in range(n+1): + if a[i] > k: + break + while a[i] + b[j] > k: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s860249892,Accepted,"def MI(): return map(int, input().split()) +def LI(): return list(map(int, input().split())) +import itertools +N,M,K=MI() +A=[0]+LI() +B=[0]+LI() +A=list(itertools.accumulate(A)) +B=list(itertools.accumulate(B)) +j=M +ans=0 +for i in range(N+1): + if A[i]>K: + break + while A[i]+B[j]>K: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s755127967,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +from bisect import bisect_right +if n>m: + a, b = b, a + n, m = m, n +c = [b[0]] +for i in range(1, m): + c.append(c[-1]+b[i]) +a.insert(0,0) +x = 0 +result = [0] +for i in range(n+1): + x += a[i] + if x > k: + break + y = k - x + z = bisect_right(c, y) + result.append(z+i) +print(max(result))" +p02623,s743698852,Accepted,"m, n, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +asum = [0] +bsum = [0] +for i in range(m): + asum.append(asum[i]+a[i]) +for i in range(n): + bsum.append(bsum[i]+b[i]) +j = n +max = 0 +for i in range(m+1): + if asum[i] > k: + break + while asum[i] + bsum[j] > k: + j-=1 + if i+j > max: + max = i+j +print(max)" +p02623,s141408692,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +sum_a = [0] +sum_b = [0] +ans = 0 +for i in range(1,len(A)+1): + sum_a.append(sum_a[i - 1] + A[i - 1]) +for i in range(1,len(B)+1): + sum_b.append(sum_b[i - 1] + B[i - 1]) + + +j = len(sum_b)-1 +for i in range(len(sum_a)): + if sum_a[i] > K: break + while (sum_b[j] + sum_a[i] > K): + j -= 1 + ans = max(ans, i + j) + + +print(ans)" +p02623,s541130571,Accepted,"N, M, K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a, b=[0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) +ans, j=0, M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans=max(ans, i+j) +print(ans)" +p02623,s889630647,Accepted," +from itertools import * +from bisect import bisect_right +n,m,time = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +A = [0]+list(accumulate(a)) +B = [0]+list(accumulate(b)) + +ans = 0 +for i in range(bisect_right(A, time)-1,-1,-1): + ans = max(ans,i+bisect_right(B, time-A[i])-1) +print(ans) +" +p02623,s733166229,Accepted,"from bisect import bisect_right +from itertools import accumulate +N, M, K = map(int, input().split()) +As = list(map(int, input().split())) +Bs = list(map(int, input().split())) + +accA = list(accumulate(As)) + [0] +accB = list(accumulate(Bs)) + +ans = 0 +for numA in range(N+1): + t = accA[numA-1] + if t > K: + break + numB = bisect_right(accB, K-t) + tmp = numA + numB + ans = ans if ans > tmp else tmp +print(ans) +" +p02623,s510587261,Accepted,"import bisect +n,m,k = map(int,input().split()) +*a, = map(int,input().split()) +*b, = map(int,input().split()) + +sa = [0] * (n+1) +sa[0] = 0 +for i in range(1,n+1): + sa[i] = sa[i-1] + a[i-1] +sb = [0] * m +sb[0] = b[0] +for i in range(1,m): + sb[i] = sb[i-1] + b[i] + +ans = 0 +for i in range(n+1): + rest = k - sa[i] + if rest < 0:break + a_s = i + b_s = bisect.bisect(sb,rest) + ans = max(ans, a_s + b_s) +print(ans) +" +p02623,s512402240,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A, B = [0], [0] +for i in range(n): + A.append(a[i]+A[i]) +for i in range(m): + B.append(b[i]+B[i]) + +ans, j = 0, m +for i in range(n+1): + if A[i] > k: + break + while B[j] > k - A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans) +" +p02623,s964107106,Accepted,"N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) +A_sum = sum(A) +B_sum = 0 +n, m = N, 0 +ans= 0 +while m != M: + if A_sum + B_sum <= K: + ans = max(ans, n+m) + m += 1 + B_sum += B[m] + elif A_sum + B_sum > K and n >= 0: + A_sum -= A[n] + n -= 1 + else: + break +if A_sum + B_sum <= K: + ans = max(ans, n+m) +print(ans)" +p02623,s408455552,Accepted,"from bisect import bisect_right as br +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +time=0 +allB=0 +AA=[0] +BB=[0] +for i in range(N): + AA.append(A[i]+AA[-1]) +for i in range(M): + BB.append(B[i]+BB[-1]) + +allB=br(BB,K)-1 +ans=0 +for i in range(allB,-1,-1): + #print(i) + ans=max(ans,i+br(AA,K-BB[i])-1) +print(ans) + + +" +p02623,s792034564,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +best = 0 + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for j in range(M): + b.append(b[j] + B[j]) + +ans , j = 0, M + +for i in range(N +1): + if a[i] > K: + break + while b[j] > K -a[i]: + j -= 1 + ans = max(ans, i +j) +print(ans)" +p02623,s547748760,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +totalA = [0] +totalB = [0] +sumA = 0 +for i in range(N): + sumA += A[i] + totalA.append(sumA) +sumB = 0 +for i in range(M): + sumB += B[i] + totalB.append(sumB) + +iB = M +countMax = 0 +for iA in range(N+1): + if totalA[iA]>K: + break + else: + while totalA[iA] + totalB[iB] > K: + iB -= 1 + countMax = max(countMax,iA+iB) + +print(countMax) + +" +p02623,s647098455,Accepted,"n, m, x = map(int, input().split(' ')) +a = list(map(int, input().split(' '))) +b = list(map(int, input().split(' '))) +A = [0] +B = [0] + +for i in range(len(a)): + A.append(A[-1] + a[i]) +for i in range(len(b)): + B.append(B[-1] + b[i]) + +y = len(B) - 1 +ans = 0 +for i in range(len(A)): + while A[i] + B[y] > x: + y -= 1 + if y == -1: + break + if y == -1: + break + if i + y > ans: + ans = i + y + +print(ans) +" +p02623,s261049387,Accepted,"N, M, K = map(int, input().split(' ')) +A_ls = [0] + list(map(int, input().split(' '))) +for i in range(N): + A_ls[i + 1] += A_ls[i] +B_ls = [0] + list(map(int, input().split(' '))) +for i in range(M): + B_ls[i + 1] += B_ls[i] +b_cnt, rst = M, 0 +for a_cnt in range(N + 1): + if A_ls[a_cnt] > K: + break + while A_ls[a_cnt] + B_ls[b_cnt] > K and b_cnt >= 0: + b_cnt -= 1 + rst = max(rst, a_cnt + b_cnt) +print(rst)" +p02623,s602242519,Accepted,"import numpy as np +import bisect +N,M,K = map(int,input().split()) +a_list = np.array([0]+list(map(int,input().split()))) +b_list = np.array(list(map(int,input().split()))) + + +a_list = a_list.cumsum() +b_list = b_list.cumsum() + +max_cnt = 0 +for i in range(N+1): + if a_list[i]>K: + continue + cnt = i + bT = K - a_list[i] + 1 + cnt += bisect.bisect_left(b_list,bT) + if cnt >max_cnt: + max_cnt = cnt + +print(max_cnt) + + +" +p02623,s841699513,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s146867275,Accepted,"n,m,k=map(int, input().split()) +a=list(map(int, input().split())) +b=list(map(int, input().split())) + +from itertools import accumulate +a_acc=list(accumulate(a)) +b_acc=list(accumulate(b)) +a_acc.insert(0,0) +b_acc.insert(0,0) + +ans=0 +j=m + +for i in range(n+1): + nokori=k-a_acc[i] + if nokori<0: + break + while b_acc[j]>nokori: + j-=1 + ans=max(ans,i+j) + # print(ans, i, j) + +print(ans) +" +p02623,s206610837,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] + +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K : + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s333131203,Accepted,"#C +import itertools +import bisect + +n, m, k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +cA = [0] + list(itertools.accumulate(A)) +cB = list(itertools.accumulate(B)) + +#print(cA) +#print(cB) + +ans = 0 +for i in range(len(cA)): + tmp = cA[-(i+1)] + if tmp < k: + indb = bisect.bisect_right(cB, k - tmp) + #print(indb) + ans = max(ans, (n-i)+indb) + elif tmp == k: + ans = n - i + +print(ans)" +p02623,s674830666,Accepted,"import numpy as np +N, M, K = [int(x) for x in input().split(' ')] +A = [int(x) for x in input().split(' ')] +B = [int(x) for x in input().split(' ')] +cA = np.cumsum([0] + A) +cB = np.cumsum([0] + B) +ans = 0 +for nA in range(len(cA)): + if K < cA[nA]: + break + time_left = K - cA[nA] + nB = np.searchsorted(cB, time_left, side='right') - 1 + #print(nA, cA[nA], time_left, nB, cB[nB]) + ans = max(ans, nA + nB) +print(ans) + " +p02623,s291781628,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s021329112,Accepted,"from itertools import accumulate +from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] + list(accumulate(A)) +b = [0] + list(accumulate(B)) + +ans = 0 +for i in range(N + 1): + if a[i] > K: + break + j = bisect_right(b, K - a[i]) - 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s703903915,Accepted,"import bisect + +N, M, K = map(int, input().split()) +Alist = [0] + list(map(int, input().split())) +Blist = list(map(int, input().split())) + +B = [Blist[0]] +for b in Blist[1:]: + B.append(b + B[-1]) + + +sums = 0 +ans = 0 +for idx, a in enumerate(Alist): + sums += a + if sums > K: + break + k = K - sums + tmp = bisect.bisect_right(B, k) + ans = max(ans, idx + tmp) + +print(ans)" +p02623,s142651782,Accepted,"N, M, K = map(int, input().split()) +a_list = list(map(int, input().split())) +b_list = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + a_list[i]) +for i in range(M): + b.append(b[i] + b_list[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s816298052,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s607424230,Accepted,"n,m,k = map(int,input().split()) +a_li = [0] + list(map(int,input().split())) +b_li = [0] + list(map(int,input().split())) + +for i in range(1,n+1): + a_li[i] += a_li[i-1] +for i in range(1,m+1): + b_li[i] += b_li[i-1] + +ans = 0 +b_cnt = m +for a_cnt in range(n+1): + if a_li[a_cnt] > k: + continue + while a_li[a_cnt] + b_li[b_cnt] > k: + b_cnt -= 1 + ans = max(ans,a_cnt+b_cnt) +print(ans)" +p02623,s890470502,Accepted,"import numpy +import bisect +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0]+list(numpy.cumsum(A)) +b = [0]+list(numpy.cumsum(B)) +ans = 0 +# print(a,b) +for i in range(len(a)): + x = k - a[i] + if x >= 0: + j = bisect.bisect_right(b,x)-1 + ans = max(ans, i+j) +print(ans)" +p02623,s662120750,Accepted,"import bisect +N,M,K=map(int,input().split()) +SumA=[0]*(N+1) +SumB=[0]*(M+1) +A=list(map(int, input().split())) +B=list(map(int,input().split())) +for i in range(1,N+1): + SumA[i]= A[i-1]+SumA[i-1] +for i in range(1,M+1): + SumB[i] = B[i-1]+SumB[i-1] + +ans = 0 +for i in range(N+1): + num = i + rest = K-SumA[i] + if rest<0: + break; + num += bisect.bisect_right(SumB, rest)-1 + ans = max(num, ans) + +print(ans) + +" +p02623,s506845148,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s976757952,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0 for _ in range(N+1)] +b = [0 for _ in range(M+1)] + +for i in range(1,N+1): + a[i] = a[i-1] + A[i-1] + +for j in range(1,M+1): + b[j] = b[j-1] + B[j-1] + +num = M +ans = 0 +for k in range(N+1): + if a[k] > K: + break + while b[num] > K - a[k]: + num -= 1 + ans = max(ans, k+num) + +print(ans)" +p02623,s900919867,Accepted,"n, m, k = map(int, input().split()) +a_books = list(map(int,input().split())) +b_books = list(map(int,input().split())) +sum1 = [0] +sum2 = [0] +for i in range(n): + sum1.append(sum1[-1]+a_books[i]) +for i in range(m): + sum2.append(sum2[-1]+b_books[i]) +ans=0 +import bisect +for i in range(n+1): + if sum1[i] > k: + break + j = bisect.bisect_right(sum2, k-sum1[i])-1 + ans = max(ans, i+j) +print(ans) +" +p02623,s397269670,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s573298259,Accepted,"import bisect + + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + + +cnt = 0 +ru_a = [0] * (n + 1) +ru_b = [0] * (m + 1) +for i in range(n): + ru_a[i + 1] = ru_a[i] + a[i] +for i in range(m): + ru_b[i + 1] = ru_b[i] + b[i] + +ans = 0 +for i in range(n + 1): + if ru_a[i] > k: + continue + ind = bisect.bisect_right(ru_b, k - ru_a[i]) + ans = max(i + ind - 1, ans) +print(ans)" +p02623,s776170002,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] + +for i in range(n): + a.append(a[i] + A[i]) + +for i in range(m): + b.append(b[i] + B[i]) + +ans = 0 +j = m +for i in range(n+1): + if a[i] > k: + break + while b[j] > k-a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s126121552,Accepted,"from itertools import accumulate +from bisect import bisect_left,bisect_right +n,m,k=map(int,input().split()) +a=[0]+list(accumulate(map(int,input().split()))) +b=[0]+list(accumulate(map(int,input().split()))) +ans=[0] +for i in range(n+1): + c=bisect_right(b,k-a[i])-1 + if c!=-1: + ans.append(c+i) +print(max(ans))" +p02623,s274965985,Accepted,"import bisect +n,m,k=map(int,input().split()) +s=list(map(int,input().split())) +t=list(map(int,input().split())) +ds=[0] +for i in range(n): + ds.append(ds[-1]+s[i]) +ans=0 +p=0 +for i in range(m+1): + if i>0: + p+=t[i-1] + if p>k: + break + si=bisect.bisect_left(ds,k-p+1) + ans=max(ans,si+i-1) +print(ans)" +p02623,s659689626,Accepted,"n,m,k = map(int,input().split()) + +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +A=[0] +B=[0] +for i in a: + A.append(i+A[-1]) +for i in b: + B.append(i+B[-1]) + +ans,j = 0,m +for i in range(n+1): + if A[i] > k: + break + while B[j] + A[i] > k: + j -= 1 + ans=max(ans,i+j) +print(ans) + " +p02623,s289892770,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +book_a = [0] * (n + 1) +book_b = [0] * (m + 1) + +for i in range(n): + book_a[i+1] = book_a[i] + a[i] + +for j in range(m): + book_b[j + 1] = book_b[j] + b[j] + +r = m +ans = 0 + +for i in range(n + 1): + if book_a[i] > k: + break + while book_a[i] + book_b[r] > k: + r -= 1 + ans = max(ans, i + r) + +print(ans)" +p02623,s045830413,Accepted,"import numpy as np +N, M, K = map(int, input().split()) +A = np.cumsum([0] + list(map(int, input().split()))) +B = np.cumsum([0] + list(map(int, input().split()))) +ans = 0 +j = M +for i in range(N+1): + if A[i] > K: + break + while A[i] + B[j] > K: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s134971125,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +tmp = 0 +aa = [0]*(n+1) +for i in range(n): + tmp += a[i] + aa[i+1] = tmp + +tmp = 0 +bb = [0]*(m+1) +for i in range(m): + tmp += b[i] + bb[i+1] = tmp + +j = m +ans = 0 +for i in range(n+1): + if aa[i] > k: + break + while bb[j] > k-aa[i] and j >= 0: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s262870351,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(A[i] + a[i]) +for i in range(M): + b.append(B[i] + b[i]) + +ans = 0 +j = M +for i in range(N+1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s747890036,Accepted,"import itertools +import bisect +n,m,k=map(int,input().split()) +aa=list(map(int,input().split())) +bb=list(map(int,input().split())) +count=0 +book=0 +rest=0 +ans=[] +aaa=list(itertools.accumulate(aa)) +bbb=list(itertools.accumulate(bb)) +bs=bisect.bisect(bbb,k) +ap=bisect.bisect(aaa,k) +ans.append(ap) +for i in range(bs+1): + ii=bs-i + rest=k-bbb[ii-1] + goal=bisect.bisect(aaa,rest) + ans.append(ii+goal) + #print(ii,goal,rest) + +print(max(ans)) + " +p02623,s347035117,Accepted,"from itertools import accumulate +import bisect + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +x = 0 +a1 = [0] + list(accumulate(a)) +b1 = list(accumulate(b)) + +for i in range(n + 1): + ren = k - a1[i] + if ren < 0: + break + j = bisect.bisect_right(b1, ren) + x = max (x, i + j) +print (x)" +p02623,s109714611,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a,b=[0],[0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans=0 +j=M +for i in range(N + 1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s706550704,Accepted,"n, m, k = map(int, input().split()) +a = [int(x) for x in input().split()] +b = [int(x) for x in input().split()] +aa = [0] +bb = [0] + +for s in range(n): + aa.append(aa[s] + a[s]) +for s in range(m): + bb.append(bb[s] + b[s]) +ans = 0 +j = m + +for i in range(n+1): + if aa[i] > k: + break + while bb[j] > k - aa[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s208578064,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] + +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k -a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s648147515,Accepted,"import sys, math +input = sys.stdin.readline +rs = lambda: input().strip() +ri = lambda: int(input()) +rl = lambda: list(map(int, input().split())) +mod = 10**9 + 7 + +N, M, K = rl() + +A = rl() +B = rl() + +s = 0 +j = 0 +for i, b in enumerate(B): + if s+b > K: + break + s += b + j += 1 + +ans = j +j -= 1 +for i, a in enumerate(A): + s += a + while j >= 0 and s > K : + s -= B[j] + j -= 1 + if s > K: break + ans = max(ans, i+1+j+1) +print(ans) + +" +p02623,s902107888,Accepted,"from itertools import accumulate +from bisect import bisect_left,bisect_right +n,m,k=map(int,input().split()) +a=[0]+list(accumulate(map(int,input().split()))) +b=[0]+list(accumulate(map(int,input().split()))) +ans=[0] +for i in range(n+1): + c=bisect_right(b,k-a[i])-1 + if c!=-1: + ans.append(c+i) +print(max(ans))" +p02623,s639399411,Accepted,"from itertools import accumulate + + +def solve(string): + from bisect import bisect_right + n, m, k, *ab = map(int, string.split()) + a, b = [0] + ab[:n], [0] + ab[n:] + a, b = list(accumulate(a)), list(accumulate(b)) + ans = 0 + for i in range(n + 1): + c = bisect_right(b, k - a[i]) - 1 + if c != -1: + ans = max(ans, c + i) + return str(ans) + + +if __name__ == '__main__': + import sys + print(solve(sys.stdin.read().strip())) +" +p02623,s878197367,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s426493643,Accepted,"# C - Tsundoku +from bisect import bisect +from itertools import accumulate + + +def main(): + N, M, K, *AB = map(int, open(0).read().split()) + cum_A, cum_B = accumulate(AB[:N], initial=0), tuple(accumulate(AB[N:])) + candidates = [0] + for i, a in enumerate(cum_A): + if a > K: + break + candidates.append(i + bisect(cum_B, K - a)) + print(max(candidates)) + + +if __name__ == ""__main__"": + main() +" +p02623,s169432220,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s892456234,Accepted,"import itertools +import bisect +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a = [0] + list(itertools.accumulate(A)) +b = [0] + list(itertools.accumulate(B)) + +result = 0 +for i in range(N + 1): + if a[i] > K: + break + j = bisect.bisect_right(b, K - a[i]) + result = max(result, i + j - 1) +print(result)" +p02623,s321704452,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] + +# 累積和を求める +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans = 0 +# bを全部読む +j = M + +for i in range(N + 1): + # aは0冊から始まる + if a[i] > K: + break + + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + + +print(ans) +" +p02623,s101596292,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a=[0] +b=[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +ans=0 +j=m +for i in range(n+1): + if a[i]>k: + break + while a[i]+b[j]>k: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s641531765,Accepted,"N,M,K=map(int,input().strip().split()) +A=list(map(int,input().strip().split())) +B=list(map(int,input().strip().split())) + +a=[0] +b=[0] +for n in range(N): + a.append(a[n]+A[n]) +for m in range(M): + b.append(b[m]+B[m]) + +num=0 +bmax=M+1 +for n in range(N+1): + if a[n]>K: + break + for m in reversed(range(bmax)): + if b[m]<=K-a[n]: + num=max(num,n+m) + bmax=m+1 + break +print(num)" +p02623,s350572593,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s602403347,Accepted,"from bisect import* +from itertools import* +n,m,k,*x=map(int,open(0).read().split());c=accumulate;b=[*c(x[n:])];print(max(i+bisect(b,k-v)for i,v in enumerate(c([0]+x[:n]))if v<=k))" +p02623,s520066251,Accepted,"N,M,K=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=list(map(int,input().split())) +x=sum(B) +y=M-1 +r=0 +for i in range(N+1): + x+=A[i] + while x>K and y>=0: + x-=B[y] + y-=1 + if x<=K: + r=max(r,i+y+1) +print(r)" +p02623,s714581441,Accepted,"N, M, K = map(int, input().split()) +A = [int(a) for a in input().split()] +B = [int(a) for a in input().split()] +s = 0 +for i, a in enumerate(A): + if s + a > K: + break + s += a +else: + i += 1 +for j, b in enumerate(B): + if s + b > K: + break + s += b +else: + j += 1 + +ans = i + j +while i: + i -= 1 + s -= A[i] + while j < M and s + B[j] <= K: + s += B[j] + j += 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s832986626,Accepted,"n, m, k = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) +ans = 0 + +a = [0] +b = [0] + +for i in range(n): + a.append(a[i] + A[i]) + +for i in range(m): + b.append(b[i] + B[i]) + +j = m + +for i in range(n + 1): + if a[i] > k: + break + while a[i] + b[j] > k: + j -= 1 + else: + ans = max(ans, i + j) +print(ans)" +p02623,s112302062,Accepted,"from itertools import accumulate + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +As = list(accumulate(A)) +Bs = list(accumulate(B)) + +ans = 0 +idx = M-1 +for i in range(N): + if As[i] > K: + break + while idx != -1 and As[i] + Bs[idx] > K: + idx -= 1 + num = i + idx + 2 + ans = max(ans, num) + +for i in range(M): + if Bs[i] <= K: + ans = max(ans, i+1) +print(ans)" +p02623,s534500857,Accepted,"n,m,k=map(int,input().split()) +al=[int(i) for i in input().split()] +bl=[int(i) for i in input().split()] +aa,bb=[0],[0] +for i in range(n): + aa.append(aa[i]+al[i]) +for i in range(m): + bb.append(bb[i]+bl[i]) +ans=0 +j=m +for i in range(n+1): + if aa[i]>k: + break + while bb[j]>k-aa[i]: + j-=1 + ans=max(ans,i+j) +print(ans) +" +p02623,s601358239,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +from itertools import accumulate +ar=[0]+list(accumulate(a)) +bru=[0]+list(accumulate(b)) +from bisect import bisect_left as bl,bisect_right as br +ans=0 + +for i in range(n+1): + g=ar[i] + if g>k:break + if k-g>=bru[-1]:ans=max(ans,i+m);continue + j=br(bru,k-g) + ans=max(ans,i+j-1) + #print(i,j-1) +print(ans) +" +p02623,s494659361,Accepted,"import sys +import itertools +import bisect + +N, M, K = map(int, input().split()) +A = list(map(int, sys.stdin.readline().rsplit())) +B = list(map(int, sys.stdin.readline().rsplit())) + +sA = [0] + list(itertools.accumulate(A)) +sB = [0] + list(itertools.accumulate(B)) + +res = 0 +for i, a in enumerate(sA): + if K < a: + break + j = bisect.bisect_right(sB, K - a) - 1 + res = max(res, i + j) + +print(res) +" +p02623,s141453538,Accepted," +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +x = [0] * (N + 1) +y = [0] * (M + 1) +for i in range(N): + x[i + 1] = x[i] + A[i] + +for i in range(M): + y[i + 1] = y[i] + B[i] + +j = M +ans = 0 +for i in range(N + 1): + if x[i] > K: + continue + while j >= 0 and x[i] + y[j] > K: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s208453007,Accepted,"from itertools import accumulate +from bisect import bisect_right +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +def ruiseki(lst): + return [0]+list(accumulate(lst)) + +ar = ruiseki(A) +br = ruiseki(B) +ans = 0 +for i in range(1+N): + left = K - ar[i] + if left < 0: + continue + bidx = bisect_right(br, left) - 1 + ans = max(ans,i+bidx) + +print(ans) +" +p02623,s713088982,Accepted,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a = [0] +b = [0] + +for i in range(N): + a.append(a[i] + A[i]) + +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s669311733,Accepted,"n, m, k = map(int, input().split(' ')) +a = list(map(int, input().split(' '))) +b = list(map(int, input().split(' '))) + +a_sum=[0] +for i in range(n): + a_sum.append(a[i]+a_sum[i]) + +b_sum=[0] +for i in range(m): + b_sum.append(b[i]+b_sum[i]) + +ans, j = 0, m +for i in range(n+1): + if a_sum[i]>k: + break + while a_sum[i] + b_sum[j] > k and j>0: + j-=1 + if a_sum[i]+b_sum[j]<=k: + ans=max(ans, i+j) +print(ans)" +p02623,s767304648,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: break + while b[j] > K - a[i]: j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s760595739,Accepted,"from bisect import bisect +from collections import deque + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +for i in range(1, len(A)): + A[i] += A[i-1] +for i in range(1, len(B)): + B[i] += B[i-1] +A.insert(0, 0) +indexB = len(B) - 1 +results = [0] +for i in range(len(A)): + time = A[i] + if time > K: + break + enable_for_b = K - time + results.append(i + bisect(B, enable_for_b)) + +print(max(results))" +p02623,s839814176,Accepted," +from itertools import accumulate + +n,m,k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +cost = 0 +cnt = 0 + +a = [0] + list(accumulate(a)) +b = [0] + list(accumulate(b)) + +ans = 0 + +b_cnt = m + +for a_cnt in range(n+1): + if a[a_cnt] > k: + continue + + while b[b_cnt] > k - a[a_cnt]: + b_cnt -= 1 + + ans = max(ans, a_cnt + b_cnt) + +print(ans)" +p02623,s344857300,Accepted,"import bisect + +N, M, K = input().split() + +desk1 = list(map(int, input().split())) +desk2 = list(map(int, input().split())) + +max_time = int(K) +item1 = [0] +item2 = [0] +for i in desk1: + item1.append(item1[-1] + i) +for i in desk2: + item2.append(item2[-1] + i) + +ret = 0 +for i, t in enumerate(item1): + remain_time = max_time - t + if remain_time >= 0: + j = bisect.bisect(item2, remain_time) - 1 + ret = max(ret, i + j) + +print(ret)" +p02623,s671718425,Accepted,"def solve(): + n,m,k = list(map(int,input().split())) + arr = list(map(int, input().split())) + arr1 = list(map(int, input().split())) + aTrack = 0 + bTrack = sum(arr1) + Bn = len(arr1) + ans = 0 + for An in range(len(arr)+1): + if An>0: + aTrack += arr[An-1] + if aTrack>k: + break + while aTrack+bTrack>k: + Bn -= 1 + bTrack -= arr1[Bn] + ans = max(ans, An+Bn) + print(ans) + + +solve()" +p02623,s394415729,Accepted,"N, M, K = list(map(int,input().split())) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a = [0] +b = [0] +for i in range(N): + a.append(a[-1] + A[i]) +for i in range(M): + b.append(b[-1] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s037514252,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +AS=[0] +BS=[0] +r=0 +for i in A: + if i+AS[-1]<=k: + AS.append(i+AS[-1]) + else: + break + +for i in B: + if i+BS[-1]<=k: + BS.append(i+BS[-1]) + else: + break + +j=len(BS)-1 +for i in range(len(AS)): + while AS[i]+BS[j]>k: + j-=1 + r=max(r,i+j) +print(r)" +p02623,s520262598,Accepted,"n,m,k=map(int,input().split()) +a=[0] + list(map(int,input().split())) +b=[0] + list(map(int,input().split())) + +for i in range(1,n+1): + a[i] += a[i-1] + +for i in range(1,m+1): + b[i] += b[i-1] + +ans=0 +j=m +for i in range(n+1): + l = k - a[i] + if(l<0): + break + while b[j]>l: + j-=1 + + ans = max(ans, i+j) +print(ans)" +p02623,s511818506,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a=[0] +b=[0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +#print(a) +#print(b) + +ans=0 +j=M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + #print(i,j) + ans=max(ans,i+j) +print(ans)" +p02623,s106963260,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A = [0] +B = [0] + +for i in range(n): + A.append(A[i] + a[i]) + +for i in range(m): + B.append(B[i] + b[i]) + +ans = 0 +j = m +for i in range(n+1): + if A[i] > k: + break + else: + while k - A[i] < B[j]: + j -= 1 + + ans = max(ans, i+j) + +print(ans)" +p02623,s558706589,Accepted,"n, m, k = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) +SA, SB = [0], [0] +for i in range(n): + SA.append(SA[i] + A[i]) +for j in range(m): + SB.append(SB[j] + B[j]) +ans, tmp = 0, m +for i in range(n + 1): + if SA[i] > k: + break + for j in range(tmp + 1)[::-1]: + if SA[i] + SB[j] <= k: + break + ans = max(ans, i + j) + tmp = j +print(ans) +" +p02623,s050273863,Accepted,"import bisect +n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +asum, bsum = [0], [0] +for i in range(n): + if k < a[i] + asum[i]: + break + asum.append(a[i] + asum[i]) +for i in range(m): + if k < b[i] + bsum[i]: + break + bsum.append(b[i] + bsum[i]) + +ans = 0 +for i in range(len(asum)): + ans = max(ans, i + bisect.bisect(bsum, k-asum[i]) - 1) +print(ans) +" +p02623,s781219155,Accepted,"import numpy as np +N,M,K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +a.extend(np.cumsum(A, dtype=""int64"")) +b.extend(np.cumsum(B, dtype=""int64"")) + +best = 0 +j = M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + + j -= 1 + best = max(best, i + j) + +print(best) +" +p02623,s736218949,Accepted,"import bisect +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) +ans = 0 +for i in range(n+1): + if a[i] > k: + break + ans = max(ans,i+bisect.bisect(b,k-a[i])-1) +print(ans)" +p02623,s756260779,Accepted,"from itertools import accumulate +import bisect +n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +b = list(map(int, input().split())) +A.insert(0, 0) +b.insert(0, 0) + +A = list(accumulate(A)) +b = list(accumulate(b)) + +ans = 0 +for i, a in enumerate(A): + if a > k: + break + index = bisect.bisect_right(b, k-a) + ans = max(ans, i + index-1) + +print(ans)" +p02623,s162384003,Accepted,"n ,m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A = [0] +B = [0] + +for i in range(n): + A.append(A[i] + a[i]) +for i in range(m): + B.append(B[i] + b[i]) + +ans, j = 0, m +for i in range(n+1): + if A[i] > k: + break + else: + while B[j] > k - A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s530518784,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +now = sum(b) +j = len(b) +while j > 0 and now > k: + j -= 1 + now -= b[j] +ans = j +for i, ai in enumerate(a, 1): + now += ai + while j > 0 and now > k: + j -= 1 + now -= b[j] + if now > k: + break + ans = max(ans, i + j) +print(ans) +" +p02623,s172576771,Accepted,"N, M, K = map(int, input().split()) +A = [int(i) for i in input().split()] +B = [int(j) for j in input().split()] + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans) + +" +p02623,s972670164,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +aL = [0 for _ in range(n+1)] +bL = [0 for _ in range(m+1)] + +for i in range(n): + aL[i+1] = aL[i] + a[i] +for i in range(m): + bL[i+1] = bL[i] + b[i] + +ans = 0 +j = m + +for i in range(n+1): + if aL[i] > k: + break + while bL[j] > k - aL[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s983700739,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): a.append(a[i] + A[i]) +for i in range(M): b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) + +" +p02623,s291376502,Accepted,"N, M , K = map(int, input().split()) +X = list(map(int, input().split())) +Y = list(map(int, input().split())) +t = 0 +R = 0 +tmp = 0 +for i in range(M): + if tmp + Y[i] > K: + break + R += 1 + tmp += Y[i] + +sY = sum(Y) +j = M +for i in range(N): + t += X[i] + if t > K: + break + while j: + if sY + t <= K: + break + j-=1 + sY -= Y[j] + R = max(R, j+i+1) +print(R) +" +p02623,s722569229,Accepted,"n ,m ,k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +sa = [0] +sb = [0] + +for i in range(n): + sa.append(sa[i]+a[i]) + +for i in range(m): + sb.append(sb[i]+b[i]) + +ans = 0 +j = m + +#しゃくとり +for i in range(n+1): + if sa[i] > k: + break + while sa[i]+sb[j] > k: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s056474844,Accepted,"from numpy import cumsum +n, m, k = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A = cumsum([0] + A) +B = cumsum([0] + B) +n_read = 0 +l = len(B) - 1 +for i, a in enumerate(A): + if a > k: + break + for j, b in enumerate(B[l::-1]): + if a + b <= k: + l -= j + n_read = max(n_read, i + l) + break +print(n_read)" +p02623,s346002802,Accepted,"import bisect + +N , M , K = map ( int , input().strip().split("" "") ) ; +A = list ( map ( int , input().strip().split("" "") ) ) ; +B = list ( map ( int , input().strip().split("" "") ) ) ; + +A.insert ( 0 , 0 ) ; +B.insert ( 0 , 0 ) ; + +for i in range ( 1 , len ( A ) ) : + A[i] = A[i-1] + A[i] ; +for i in range ( 1 , len ( B ) ) : + B[i] = B[i-1] + B[i] ; + + + +t = 0 ; +for i , v in enumerate ( A ) : + if v > K : break ; + x2 = bisect.bisect_right( B , K - v ) ; + t = max ( t , x2 - 1 + i ) ; + +print ( t ) ;" +p02623,s044279689,Accepted,"import bisect + +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +timeA=[0]*(N+1) +timeB=[0]*(M+1) +for i in range(N): + timeA[i+1]=timeA[i]+A[i] +for i in range(M): + timeB[i+1]=timeB[i]+B[i] + +ans=0 +for i in range(N+1): + time=K-timeA[i] + if time<0: + break + num=bisect.bisect_right(timeB,time) + ans=max(ans,i+num-1) +print(ans)" +p02623,s648146939,Accepted,"from itertools import accumulate + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +sa = [0] + list(accumulate(a)) +sb = [0] + list(accumulate(b)) + +ans = 0 +p = m +for i in range(n + 1): + for j in range(p, -1, -1): + if sa[i] + sb[j] <= k: + ans = max(ans, i + j) + p = j + break +print(ans) +" +p02623,s924612257,Accepted,"n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) +for i in range(1, n + 1): + a[i] += a[i - 1] +for i in range(1, m + 1): + b[i] += b[i - 1] +i, j, z = 0, m, 0 +while i <= n and a[i] <= k: + while b[j] > k - a[i]: + j -= 1 + z = max(z, i + j) + i += 1 +print(str(z))" +p02623,s743858711,Accepted,"from itertools import accumulate +N, M, K = map(int, input().split()) +Nlist = [0]+list(map(int, input().split())) +Mlist = [0]+list(map(int, input().split())) +Asum = list(accumulate(Nlist)) +Bsum = list(accumulate(Mlist)) +count = 0 +j = 0 +for i in range(N, -1, -1): + if K >= Asum[i]: + while Asum[i]+Bsum[j] <= K: + j += 1 + if j == M+1: + break + if count < i+j-1: + count = i+j-1 + if j == M+1: + break +print(count) +" +p02623,s322046516,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ans1 = 0 +for i in range(n-1): + a[i+1] = a[i]+a[i+1] +for i in range(m-1): + b[i+1] = b[i]+b[i+1] +import bisect +key = bisect.bisect(a,k) +for i in range(key): + ans = 0 + ans += key-i + time = a[key-i-1] + ans += bisect.bisect(b,k-time) + ans1 = max(ans1,ans) +ans = 0 +ans += bisect.bisect(b,k) +ans1 = max(ans,ans1) + + +print(ans1)" +p02623,s972141086,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +A = [0] +B = [0] +for i in range(n): + A.append(a[i] + A[i]) +for i in range(m): + B.append(b[i] + B[i]) +ans = 0 +j = m +for i in range(n+1): + if A[i] > k: + break + while B[j] > k - A[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s245173426,Accepted,"import numpy as np +N,M,K = map(int, input().split()) + +A = np.array([0] + list(map(int, input().split()))) +B = np.array([0] + list(map(int, input().split()))) + +CA = np.cumsum(A) +CB = np.cumsum(B) + +ans = 0 +for i in range(N+1): + if CA[i] > K: + break + j = np.searchsorted(CB, K-CA[i], side='right') - 1 + ans = max(ans, i+j) + #print(ans,i,j) + +#print(CA) +#print(CB) +print(ans)" +p02623,s916846011,Accepted,"N, M, K = map(int, input().split()) +A_list = list(map(int, input().split())) +B_list = list(map(int, input().split())) + +A_sum = [0] +B_sum = [0] + +for a in A_list: + A_sum.append(A_sum[-1] + a) + +for b in B_list: + B_sum.append(B_sum[-1] + b) + +count = 0 +j = M +for i, a in enumerate(A_sum): + if a > K: + break + while B_sum[j] > K - a: + j -= 1 + if count < i + j: + count = i + j + +print(count)" +p02623,s831385760,Accepted,"# C - Tsundoku +from bisect import bisect +from itertools import accumulate + + +def main(): + N, M, K, *AB = map(int, open(0).read().split()) + cum_A, cum_B = tuple(accumulate([0] + AB[:N])), tuple(accumulate(AB[N:])) + res = 0 + for i, a_time in enumerate(cum_A): + if a_time > K: + break + b_time = K - a_time + res = max(res, i + bisect(cum_B, b_time)) + print(res) + + +if __name__ == ""__main__"": + main() +" +p02623,s184032106,Accepted,"n,m,k=[int(x) for x in input().rstrip().split()] +a=[int(x) for x in input().rstrip().split()] +b=[int(x) for x in input().rstrip().split()] + +A=[0] +B=[0] + +for i in range(n): + A.append(A[i]+a[i]) + +for i in range(m): + B.append(B[i]+b[i]) + +ans=0 +j=0 + +for i in range(n+1): + # j=0 + if A[i]>k: + break + nokori=k-A[i] + + while(B[j]<=nokori and j0 and ab_sum >K: + j -= 1 + ab_sum -= B[j] + if ab_sum >K: + break + answer = max(answer, i+j) + if i==N: + break + ab_sum += A[i] + +print(answer) +" +p02623,s393800594,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +cum_A=[0] +cum_B=[0] +for i in range(N): + cum_A.append(cum_A[-1]+A[i]) +for i in range(M): + cum_B.append(cum_B[-1]+B[i]) +ans, j = 0,M +for i in range(N+1): + if cum_A[i] > K: + break + while cum_B[j] > K-cum_A[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s469630660,Accepted,"from bisect import bisect_right +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0]*(N+1) +b = [0]*(M+1) +for i in range(1, N+1): + a[i] = a[i-1]+A[i-1] +for i in range(1, M+1): + b[i] = b[i-1]+B[i-1] +ans = 0 +for i in range(N+1): + if a[i]>K: + break + j = bisect_right(b, K-a[i]) - 1 + ans = max(ans, i+j) +print(ans)" +p02623,s421909688,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +book_a = [0] * (n + 1) +book_b = [0] * (m + 1) + +for i in range(n): + book_a[i+1] = book_a[i] + a[i] + +for j in range(m): + book_b[j + 1] = book_b[j] + b[j] + +r = m +ans = 0 + +for i in range(n + 1): + if book_a[i] > k: + break + while book_a[i] + book_b[r] > k: + r -= 1 + ans = max(ans, i + r) + +print(ans) +" +p02623,s756043877,Accepted,"#関数リスト +import sys +input = sys.stdin.readline + +def I(): return int(input()) +def MI(): return map(int, input().split()) +def LI(): return list(map(int, input().split())) +def ruiseki(mydata): + res = [0]*(len(mydata)+1) + for i in range(len(mydata)): + res[i+1] = res[i] + mydata[i] + return res + +n, k , m = MI() +a = ruiseki(LI()) +b = ruiseki(LI()) +a = a +b = b + +result = 0 +index = k +for i, ii in enumerate(a): + if ii > m: + break + while b[index] + ii > m: + index -= 1 + result = max(result, i+index) +print(result)" +p02623,s308755525,Accepted,"n, m, k = map(int, input().split()) +A = [0] + list(map(int,input().split())) +B = [0] + list(map(int,input().split())) + +for i in range(2,n+1): + A[i] += A[i-1] +for i in range(2,m+1): + B[i] += B[i-1] + +j = m +ans = 0 +for i in range(n+1): + if A[i] > k: + break + while B[j] > k-A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s091313935,Accepted,"from itertools import accumulate +from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] + list(accumulate(A)) +b = [0] + list(accumulate(B)) + +result = 0 +for i in range(N + 1): + if a[i] > K: + break + j = bisect_right(b, K - a[i]) + result = max(result, i + j - 1) +print(result)" +p02623,s257173212,Accepted,"import sys +import itertools as it +input = sys.stdin.readline + +N, M, K = [int(x) for x in input().split()] +A = [int(x) for x in input().split()] +B = [int(x) for x in input().split()] +AS = list(it.accumulate(A)) +BS = list(it.accumulate(B)) +AS.insert(0,0) +BS.insert(0,0) +max, j = 0, M +for i in range(N+1): + if AS[i] > K: + break + while i + j > max: + if AS[i] + BS[j] <= K: + max = i + j + break + j -= 1 + +print(max)" +p02623,s991458001,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +x,y=[0],[0] +for i in range(n): + x.append(a[i]+x[i]) +for j in range(m): + y.append(b[j]+y[j]) + +ans=0 +j=m +for i in range(n+1): + if x[i]>k: + break + while y[j]>k-x[i]: + j-=1 + ans=max(i+j,ans) +print(ans)" +p02623,s767087613,Accepted,"from bisect import bisect_right + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +a_ac=[0] +for i in range(1,n+1): + a_ac.append(a_ac[i-1]+a[i-1]) + +b_ac=[0] +for i in range(1,m+1): + b_ac.append(b_ac[i-1]+b[i-1]) + +#print(a_ac) +#print(b_ac) + +ans=0 +for i in range(n+1): + remain=k-a_ac[i] + if remain<0: + continue + t_ans=i + t_ans+=bisect_right(b_ac,remain)-1 + ans=max(ans,t_ans) + +print(ans)" +p02623,s689796233,Accepted,"import bisect +n,m,k = map(int,input().split()) +a = [0]+list(map(int,input().split())) +b = list(map(int,input().split())) +for i in range(1,n+1): + a[i] += a[i-1] +for j in range(1,m): + b[j] += b[j-1] +ans = 0 +for i in range(n+1): + x = k-a[i] + if x < 0: + break + ptr = bisect.bisect_right(b,x) + ans = max(ans,ptr+i) +print(ans)" +p02623,s396439806,Accepted,"#!/usr/bin/env python3 + +import itertools +import bisect + +N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +cumA = list(itertools.accumulate(A)) +cumB = list(itertools.accumulate(B)) +#print(cumA) +#print(cumB) + +ans = 0 + +for i in range(N+1): + cnt = i + chk = K - cumA[i] + if chk < 0: + continue + cnt += bisect.bisect_right(cumB,chk)-1 + ans = max(ans,cnt) + #print(ans) +print(ans)" +p02623,s344631641,Accepted,"from bisect import bisect_right +N,M,K = list(map(int,input().split())) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +A_sum = [0]*(N+1) +for i in range(N): + A_sum[i+1] = A[i]+A_sum[i] +B_sum = [0]*(M+1) +for i in range(M): + B_sum[i+1] = B[i]+B_sum[i] + +ans = 0 +for i in range(N+1): + if 0 <= K-A_sum[i]: + j = bisect_right(B_sum,K-A_sum[i]) + ans = max(ans,i+j-1) + +print(ans)" +p02623,s431714943,Accepted,"import numpy as np +import sys +read = sys.stdin.read + + +N, M, K = map(int, input().split()) +AB = np.array(read().split(), np.int32) +A = [0] + np.cumsum(AB[:N]).tolist() +B = [0] + np.cumsum(AB[N:]).tolist() +assert (N == len(A) - 1) and (M == len(B) - 1) + +ans = 0 +left = M +for i in range(len(A)): + if A[i] > K: + break + + while A[i] + B[left] > K: + left -= 1 + + ans = max(ans, left + i) + +print(ans)" +p02623,s529630893,Accepted,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +for i in range(1,N): + A[i] += A[i-1] +for i in range(1,M): + B[i] += B[i-1] + + +ans = 0 +for i in range(N): + K1 = K - A[i] + if(K1 >= 0): + j = bisect.bisect_right(B, K1) + ans = max(ans, i+j+1) + +for i in range(M): + K1 = K - B[i] + if(K1 >= 0): + j = bisect.bisect_right(A, K1) + ans = max(ans, i+j+1) +print(ans)" +p02623,s739195011,Accepted,"import sys +input = sys.stdin.readline +from itertools import accumulate + +N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a = [0]+list(accumulate(A)) +b = [0]+list(accumulate(B)) +ans,j = 0,M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s160555614,Accepted,"n, m, k = map(int, input().split(' ')) +ans = 0 + +a_ls = [0] + list(map(int, input().split(' '))) +b_ls = [0] + list(map(int, input().split(' '))) + +for i in range(1, n+1): + a_ls[i] += a_ls[i-1] +for i in range(1, m+1): + b_ls[i] += b_ls[i-1] + +b_cnt = m +for a_cnt in range(0, n+1): + if a_ls[a_cnt] > k: + continue + while a_ls[a_cnt] + b_ls[b_cnt] > k: + b_cnt -= 1 + ans = max(ans, a_cnt + b_cnt) + +print(ans)" +p02623,s118171591,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a_cs = [0] * (n + 1) +b_cs = [0] * (m + 1) + +for i in range(n): + a_cs[i + 1] = a_cs[i] + a[i] +for i in range(m): + b_cs[i + 1] = b_cs[i] + b[i] + +ans = 0 +j = m +for i in range(n + 1): + while j > 0 and a_cs[i] + b_cs[j] > k: + j -= 1 + + if a_cs[i] + b_cs[j] <= k: + ans = max(ans, i + j) + +print(ans) +" +p02623,s888396140,Accepted,"#関数リスト +import sys +input = sys.stdin.readline + +def I(): return int(input()) +def MI(): return map(int, input().split()) +def LI(): return list(map(int, input().split())) +def ruiseki(mydata): + res = [0]*(len(mydata)+1) + for i in range(len(mydata)): + res[i+1] = res[i] + mydata[i] + return res + +n, k , m = MI() +a = ruiseki(LI()) +b = ruiseki(LI()) + +result = 0 +index = k +for i, ii in enumerate(a): + if ii > m: + break + while b[index] + ii > m: + index -= 1 + result = max(result, i+index) +print(result) +" +p02623,s760637830,Accepted,"from itertools import accumulate +from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +ans = 0 +m = [0] + list(accumulate(A)) +l = list(accumulate(B)) +for i, x in enumerate(m): + if x > K: + break + else: + ans = max(ans, i + bisect_right(l, K-x)) +print(ans)" +p02623,s726303119,Accepted," +from bisect import bisect_right +from itertools import accumulate +def resolve(): + N, M, K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + cum_A = [0]+list(accumulate(A)) + cum_B = [0]+list(accumulate(B)) + + ans = 0 + for i in range(N + 1): + limit = K - cum_A[i] + if limit < 0: + break + cnt = i + cnt += bisect_right(cum_B, limit)-1 + ans = max(ans, cnt) + print(ans) + + +if __name__ == ""__main__"": + resolve() +" +p02623,s703227241,Accepted,"def main(): + from itertools import chain + + N, M, K = map(int, input().split()) + *A, = map(int, input().split()) + *B, = map(int, input().split()) + + t = sum(B) + ans = 0 + j = M + for i, x in enumerate(chain([0], A)): + t += x + while j > 0 and t > K: + j -= 1 + t -= B[j] + if t > K: break + if ans < i + j: + ans = i + j + print(ans) + + +if __name__ == '__main__': + main() +" +p02623,s712956871,Accepted,"n,m,k = map(int,input().split()) + +a = list(map(int,input().split())) + +b = list(map(int,input().split())) + +x = [0] + +y = [0] + +for i in range(n): + x.append(x[i]+a[i]) + +for i in range(m): + y.append(y[i]+b[i]) + +ans = 0 + +cnt = m + +for i in range(n+1): + + if k-x[i]<0: + break + + while y[cnt]>k-x[i]: + cnt -= 1 + + ans = max(ans,cnt+i) + +print(ans)" +p02623,s169725408,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +AL = [0] +for i in range(N): + AL.append(AL[-1] + A[i]) +BL = [0] +for i in range(M): + BL.append(BL[-1] + B[i]) + +ans = 0 +from bisect import bisect_right +for i in range(N+1): + zan = K - AL[i] + if zan < 0: + break + ind = bisect_right(BL, zan) - 1 + ans = max(ans, i + ind) + +print(ans) +" +p02623,s504935884,Accepted,"n,m,p=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a=[0]*(n+1) ; b=[0]*(m+1) +for i in range(n): + a[i+1]+=a[i]+A[i] +for j in range(m): + b[j+1]=b[j]+B[j] + + +now=-1 +import bisect as bi +for i in range(n+1): + if a[i]>p : break + G=p-a[i] + now=max(bi.bisect(b, G)+i-1, now) + +print(now) +" +p02623,s944914330,Accepted,"N, M, K = map(int, input().split()) +desk_a = list(map(int, input().split())) +desk_b = list(map(int, input().split())) + +sum_a = [0] +sum_b = [0] + +for i in range(N): + sum_a.append(sum_a[-1] + desk_a[i]) +for i in range(M): + sum_b.append(sum_b[-1] + desk_b[i]) + +ans = 0 +j = M +for i in range(N+1): + a = sum_a[i] + if K - a < 0: + break + while sum_b[j] > K - a: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s937650832,Accepted,"n,m,k=map(int,input().split()) +a=[0]+list(map(int,input().split())) +b=[0]+list(map(int,input().split())) +for i in range(n): + a[i+1]+=a[i] +for i in range(m): + b[i+1]+=b[i] +from bisect import bisect_right +ans=0 +for i in range(n+1): + if k-a[i]>=0: + r=bisect_right(b,k-a[i]) + ans=max(r+i-1,ans) +print(ans) +" +p02623,s090393381,Accepted,"import sys +input = sys.stdin.readline +import numpy as np + +N,M,K= map(int,input().split()) + +A = np.array([0] + list(map(int,input().split()))) +B = np.array([0] + list(map(int,input().split()))) + +cA = np.cumsum(A) +cB = np.cumsum(B) +rcA = (K - cA)[::-1] +ind = N - np.searchsorted(rcA,cB,side='left') +cand = np.arange(M+1) + ind +cand *= (ind >= 0) +print(np.max(cand)) + +" +p02623,s167023907,Accepted,"N, M, K = map(int, input().split()) +A = [int(x) for x in input().split()] +B = [int(x) for x in input().split()] + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for j in range(M): + b.append(b[j] + B[j]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K-a[i]: + j -= 1 + ans = max(ans, i+j) +print(ans) +" +p02623,s494760548,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) #a[0]=0だからbしか含まない形も考慮されてる +print(ans)" +p02623,s157666083,Accepted,"from itertools import accumulate +from bisect import bisect_right +n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +Acc=list(accumulate(B)) +ans=0 +time=0 +a_cnt=0 +for a in A: + remain=k-time + if remain<0: + break + b_cnt=bisect_right(Acc,remain) + ans=max(ans,a_cnt+b_cnt) + time+=a + a_cnt+=1 +remain=k-time +if remain>=0: + b_cnt=bisect_right(Acc,remain) + ans=max(ans,a_cnt+b_cnt) +print(ans)" +p02623,s686832745,Accepted,"readints = lambda: list(map(int, input().split())) +n, m, k = readints() +a = readints() +b = readints() +a.insert(0, 0) +b.insert(0, 0) + +ans = 0 + +j = m +tot = sum(b) +for i in range(n + 1): + tot += a[i] + while j >= 0 and tot > k: + tot -= b[j] + j -= 1 + if j < 0: + break + ans = max(ans, i + j) + +print (ans) +" +p02623,s182107693,Accepted,"import bisect + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +cuma, cumb = [0], [0] +for i in range(1, n+1): + cuma.append(cuma[i-1] + a[i-1]) +for i in range(1, m+1): + cumb.append(cumb[i-1] + b[i-1]) +ans = [0] +for i in range(n+1): + if cuma[i] <= k: + t = k - cuma[i] + j = bisect.bisect_right(cumb, t) + ans.append(i+j-1) +print(max(ans)) +" +p02623,s849514367,Accepted,"from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +cumA = [0] +for i in range(N): + cumA.append(cumA[-1] + A[i]) +cumB = [0] +for i in range(M): + cumB.append(cumB[-1] + B[i]) + +# print(cumA) +# print(cumB) + +ans = 0 +for i, s1 in enumerate(cumA): + j = bisect_right(cumB, K - s1) - 1 + if j >= 0: + s2 = cumB[j] + assert s1 + s2 <= K + ans = max(ans, i + j) + +print(ans) + +" +p02623,s714340974,Accepted,"import itertools + +n,m,k = map(int,input().split()) +a = list(map(int,('0 '+input()).split())) +b = list(map(int,('0 '+input()).split())) + +asum = list(itertools.accumulate(a)) +bsum = list(itertools.accumulate(b)) + +ans = 0 +j=m +for i in range(n+1): + if asum[i]>k: + break + + while asum[i]+bsum[j]>k: + j-=1 + + ans = max(ans,i+j) + +print(ans)" +p02623,s115906395,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +asum=[0] +bsum=[0] + +for i in range(n): + asum.append(asum[i]+A[i]) + +for j in range(m): + bsum.append(bsum[j]+B[j]) + +ans=0 +ko=m +for i in range(n+1): + if asum[i]>k: + break + while asum[i]+bsum[ko]>k: + ko-=1 + ans=max(ans,i+ko) + +print(ans) +" +p02623,s717104582,Accepted,"from itertools import accumulate + +N, M, K = map(int, input().split()) +a = [0] + list(accumulate(int(i) for i in input().split())) +b = [0] + list(accumulate(int(i) for i in input().split())) + +cnt = 0 +best0 = M +for i in range(N+1): + ai = a[i] + for j in range(best0, -1, -1): + bj = b[j] + if ai + bj <= K: + cnt = max(cnt, i + j) + best0 = j + break + +print(cnt)" +p02623,s128252323,Accepted,"import sys +input = sys.stdin.readline + +from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +AA = [0] +for a in A: + AA.append(AA[-1]+a) +BB = [0] +for b in B: + BB.append(BB[-1]+b) + +ans = 0 +for i, aa in enumerate(AA): + if aa > K: break + ind = bisect_right(BB, K-aa)-1 + ans = max(ans, ind+i) + +print(ans)" +p02623,s172988861,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +na, nb = [0], [0] +for i in range(n): + na.append(na[i] + a[i]) +for j in range(m): + nb.append(nb[j] + b[j]) + +ans, j = 0, m +for i in range(n + 1): + if na[i] > k: + break + while nb[j] > k - na[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans) + + + " +p02623,s558573434,Accepted,"import bisect +N,M,K = map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +A_acc=[0] +B_acc=[0] + +for a in A: + A_acc.append(a+A_acc[-1]) +for b in B: + B_acc.append(b+B_acc[-1]) + +ans=0 +for i in range(len(A_acc)): + a_time = A_acc[i] + remain = K-a_time + if remain>=0: + idx = bisect.bisect_right(B_acc,remain) + if idx==0: + continue + ans=max(ans,i+idx-1) +print(ans) + + +" +p02623,s660055450,Accepted,"#abc172c +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +x=[0] +y=[0] +for i in range(n): + x.append(x[i]+a[i]) +for i in range(m): + y.append(y[i]+b[i]) +res=0 +j=m +for i in range(n+1): + if x[i]>k: + break + while y[j]>k-x[i]: + j-=1 + res=max(res,i+j) +print(res) +" +p02623,s735937171,Accepted,"import itertools,sys +def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) +N,M,K = LI() +A = LI() +B = LI() +accumulate_A = [0]+list(itertools.accumulate(A)) +accumulate_B = [0]+list(itertools.accumulate(B)) +ans,j = 0,M +for i in range(N+1): + if accumulate_A[i]>K: + break + while accumulate_A[i]+accumulate_B[j]>K: + j -= 1 + ans = max(ans,i+j) +print(ans) +" +p02623,s560180298,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +i, j = 0, 0 +c = 0 +num = 0 +while i < n and c + A[i] <= k: + c = c + A[i] + num += 1 + i += 1 +while j < m and B[j] + c <= k: + c = c + B[j] + num += 1 + j += 1 +for a in range(i-1, -1, -1): + c -= A[a] + while j < m and c + B[j] <= k: + c = c + B[j] + j += 1 + num = max(num, a+j) +print (num) +" +p02623,s984852369,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s778590217,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) + +" +p02623,s456666298,Accepted,"#!/usr/bin/env python3 +import sys +input = sys.stdin.readline +INF = 10**12 +import bisect + +n, m, k = map(int, input().split()) +a = [int(item) for item in input().split()] +b = [int(item) for item in input().split()] + +acum = [0] +for item in a: + acum.append(acum[-1] + item) +bcum = [0] +for item in b: + bcum.append(bcum[-1] + item) + +ans = 0 +for i, item in enumerate(acum): + if item > k: + continue + index = bisect.bisect_right(bcum, k - item) - 1 + num = i + index + ans = max(ans, num) +print(ans)" +p02623,s943400864,Accepted,"i = list(map(int, input().split())) +n,m,k = i[0], i[1], i[2] + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a,b = [0],[0] + +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) + +ans, j = 0,m +for i in range(n+1): + if a[i] > k: + break + while b[j]>k-a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s308368744,Accepted,"n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a,b = [0], [0] + +for i in range(n): + a.append(a[i]+A[i]) +for j in range(m): + b.append(b[j]+B[j]) + +ans, j = 0, m +for i in range(n+1): + if a[i] > k: + break + while a[i] + b[j] > k: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s116065680,Accepted,"N, M, K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +ruiA = [0] +ruiB = [0] +for i in range(N): + ruiA.append(ruiA[-1] + A[i]) +for i in range(M): + ruiB.append(ruiB[-1] + B[i]) + +MAX = 0 +j = M + +for i in range(N+1): + if ruiA[i] > K: + break + while ruiA[i] + ruiB[j] > K: + j -= 1 + MAX = max(MAX, i+j) + +print(MAX) +" +p02623,s075243541,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a,b=[0],[0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans,j=0,M + +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j-=1 + + ans = max(ans,i+j) + +print(ans) +" +p02623,s064608085,Accepted,"from bisect import * +n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +sa = [0]*(n+1) +sb = [0]*(m+1) +for i in range(n): + sa[i+1] = sa[i] + A[i] +for i in range(m): + sb[i+1] = sb[i] + B[i] +ans = 0 +for i,a in enumerate(sa): + if a > k:break + will = bisect_right(sb,k-a) + ans = max(i + will - 1, ans) +print(ans) +" +p02623,s628187309,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=0 +asum=0 +bsum=0 +pointer=0 +while pointerk and pointer>=0: + pointer-=1 + bsum-=b[pointer] + if asum+bsum>k: + break + ans=max(ans,(i+1)+pointer) +print(ans)" +p02623,s191468817,Accepted,"N,M,K = list(map(int, input().split())) +A = list((map(int, input().split()))) + [10000000000] +B = list((map(int, input().split()))) + [10000000000] + +S = 0 +a = 0 +while S+A[a]<=K: + S+=A[a] + a+=1 + +b = 0 +ans = a + +while a>=0: + if S+B[b]<=K: + S+=B[b] + b+=1 + else: + S-=A[a-1] + a-=1 + ans = max(ans, a+b) + +print(ans)" +p02623,s716817831,Accepted,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A_T = [0] +B_T = [0] +c = 0 +for i in range(N): + c += A[i] + A_T.append(c) +c = 0 +for i in range(M): + c += B[i] + B_T.append(c) + +ans = 0 +for i in range(N+1): + if K - A_T[i] >= 0: + k = bisect.bisect_right(B_T, K-A_T[i]) + ans = max(ans, k+i-1) +print(ans)" +p02623,s576317556,Accepted,"from collections import deque +import numpy as np +import bisect + +n, m, k = map(int, input().split()) +A = [0] + list(map(int,input().split())) +B = [0] + list(map(int,input().split())) + +a = np.cumsum(A) +b = np.cumsum(B) + +ans = 0 +for i in range(n+1): + time = k - a[i] + if time < 0: + break + ans = max(ans, bisect.bisect_right(b, time) - 1 + i) + +print(ans)" +p02623,s838459727,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s137135670,Accepted,"n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +for i in range(1, n+1): a[i] += a[i-1] +for i in range(1, m+1): b[i] += b[i - 1] + +ans, b_cnt = 0, m +for a_cnt in range(n+1): + if a[a_cnt] > k: break + while a[a_cnt] + b[b_cnt] > k: b_cnt -= 1 + ans = max(ans, a_cnt + b_cnt) + +print(ans) +" +p02623,s789684091,Accepted,"n,m,k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A = [0] +B = [0] +for i in range(n): + A.append(A[i]+a[i]) +for j in range(m): + B.append(B[j]+b[j]) + +#print(A,B) + +maxij = 0 +l = m +for i in range(n+1): + for j in range(m): +# print(i,l,A[i],B[l],k) + if(l == -1): + break + elif((A[i]+B[l]) <= k): + maxij=max(maxij,i+l) +# print(""mm"",maxij) + break + else: + l-=1 +print(maxij)" +p02623,s726073813,Accepted,"import sys +def input(): return sys.stdin.readline().strip() +def mapint(): return map(int, input().split()) +sys.setrecursionlimit(10**9) + +from itertools import accumulate +N, M, K = mapint() +As = [0]+list(accumulate(list(mapint()))) +Bs = list(accumulate(list(mapint()))) +from bisect import bisect_right + +ans = 0 +for i, a in enumerate(As): + if a>K: + break + idx = bisect_right(Bs, K-a) + ans = max(ans, i+idx) +print(ans)" +p02623,s350886136,Accepted,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +from itertools import accumulate +AA = [0]+list(accumulate(A)) +BB = [0]+list(accumulate(B)) +ans = 0 +j = M +for i in range(N+1): + if AA[i]>K: + break + while BB[j]>K-AA[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s852719707,Accepted,"from itertools import accumulate +n,m,k = map(int, input().split()) +a = list(map(int,input().split()))[::-1] +b = list(map(int,input().split())) + +l = [0] + a + b +acc = list(accumulate(l)) + +# print(acc) + +ans = 0 +l = 0 +for r in range(1, n+m+1): + while acc[r] - acc[l] > k: + l += 1 + # print(l,r) + if l <= n and r >= n: + ans = max(ans,r-l) + # print(ans) +print(ans)" +p02623,s368393447,Accepted,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a=[0] +b=[0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s118742167,Accepted,"from itertools import accumulate +from bisect import bisect_left,bisect_right +n,m,k=map(int,input().split()) +a=list(accumulate(map(int,input().split()),initial=0)) +b=list(accumulate(map(int,input().split()),initial=0)) +ans=[0] +for i in range(n+1): + c=bisect_right(b,k-a[i])-1 + if c!=-1: + ans.append(c+i) +print(max(ans)) +" +p02623,s182668411,Accepted,"from bisect import bisect_right +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +sa = [0] * (n+1) +sb = [0] * (m+1) +for i in range(n): + sa[i+1] = sa[i] + a[i] +for i in range(m): + sb[i+1] = sb[i] + b[i] +ans = 0 +for i in range(n+1): + cnt_a = i + rest = k - sa[i] + if rest < 0: + break + cnt_b = bisect_right(sb, rest) - 1 + ans = max(ans, cnt_a+cnt_b) +print(ans) +" +p02623,s145954767,Accepted,"# 変数 n, m, k, arr1, arr2, acum1, acum2, ans + +n, m, k = map(int, input().split()) +arr1 = list(map(int,input().split())) +arr2 = list(map(int,input().split())) + +acum1 = [0] +for i in range(n): + acum1.append(acum1[-1]+arr1[i]) + +acum2 = [0] +for i in range(m): + acum2.append(acum2[-1]+arr2[i]) + +ans = 0 +j=m +for i in range(n+1): + if acum1[i] > k: + break + while acum2[j] > k - acum1[i] and j>0: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s222156854,Accepted,"N,M,K=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=[0]+list(map(int,input().split())) + +for i in range(N): + A[i+1]+=A[i] +for i in range(M): + B[i+1]+=B[i] + +idx=N +ans=0 +for i in range(N): + if A[i]>K: + idx=i-1 + break + +idx2=0 +for i in range(idx,-1,-1): + while idx2 tmp: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s790665687,Accepted,"from itertools import accumulate +import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +aa = list(accumulate(a)) +aa.insert(0,0) +bb = list(accumulate(b)) +bb.insert(0,0) + +ans = 0 + +for i in range(n+1): + if aa[i] > k: + break + nokori = k-aa[i] + kazu = bisect.bisect_right(bb, nokori) + ans = max(ans,i+kazu-1) + + + +print(ans)" +p02623,s385105202,Accepted,"import numpy as np +a,b,k=map(int,input().split()) +n=list(map(int,input().split())) +m=list(map(int,input().split())) +n.insert(0,0) +m.insert(0,0) +n=np.array(n) +m=np.array(m) +n=n.cumsum() +m=m.cumsum() +ans=0 +j=len(m)-1 +for i in range(len(n)): + if n[i]>k: + break + while m[j]>k-n[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s439266365,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +an = 0 +bn = 0 +t = 0 +for an in range(n): + if t+a[an] <= k: + t += a[an] + else: + an-=1 + break +an+=1 +ans = an +while True: + while bn < m: + if t+b[bn] <= k: + t += b[bn] + bn += 1 + else: + break + ans = max(ans,an+bn) + if an == 0 or bn == m: + break + else: + an -= 1 + t -= a[an] +print(ans)" +p02623,s043381818,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) +c = 0 +f = m +for i in range(n+1): + if a[i]>k: + break + while a[i]+b[f]>k: + f-=1 + c = max(c, i+f) +print(c) +" +p02623,s340221654,Accepted,"from itertools import accumulate +from bisect import bisect +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) +a = list(accumulate(a)) +b = list(accumulate(b)) +ans = 0 +for i in range(n+1): + if a[i] > k: + break + ans = max(ans, i+bisect(b, k-a[i])-1) +print(ans)" +p02623,s496966342,Accepted,"n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +if sum(A)+sum(B)<=k: + print(n+m) + exit() + +for i in range(1,n): + A[i] += A[i-1] +for i in range(1,m): + B[i] += B[i-1] + +from bisect import bisect_right +ans = bisect_right(B,k) +for i in range(n): + if A[i]>k: + break + ans = max(ans, i+1+bisect_right(B,k-A[i])) +print(ans)" +p02623,s676416875,Accepted,"import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +for i in range(1,n): + a[i] += a[i-1] +for i in range(1,m): + b[i] += b[i-1] +ans = 0 +for i in range(n): + if a[i] <= k: + ans = max(ans,i+1 + bisect.bisect_right(b,k-a[i])) +for i in range(m): + if b[i] <= k: + ans = max(ans,i+1 + bisect.bisect_right(a,k-b[i])) +print(ans)" +p02623,s615558634,Accepted,"from itertools import accumulate +import bisect +n,m,k=map(int,input().split()) +a=[int(i) for i in input().split()] +b=[int(i) for i in input().split()] + +A=list(accumulate(a)) +B=list(accumulate(b)) +ans=bisect.bisect_right(B,k) +for i in range(len(a)): + r = (k-A[i]) + if r<0: + break + #print(r,bisect.bisect_left(B,r)) + #print(B[bisect.bisect_left(B,r)]) + ans=max(ans,i+1+bisect.bisect_right(B,r)) +print(ans) +" +p02623,s674380467,Accepted,"N,M,K=map(int,input().split()) +A,B=[0],[0] +A+=map(int,input().split()) +B+=map(int,input().split()) + +for i in range(1,N+1): + A[i]+=A[i-1] +for i in range(1,M+1): + B[i]+=B[i-1] + +ans,j=0,M +for i in range(N+1): + if A[i]>K: + break + while A[i]+B[j]>K: + j-=1 + ans=max(ans,i+j) + +print(ans) +" +p02623,s324305521,Accepted,"import sys +from itertools import accumulate + +def Main(): + n,m,k = map(int,sys.stdin.readline().rstrip().split()) + a = [0] + list(accumulate(map(int,sys.stdin.readline().rstrip().split()))) + b = [0] + list(accumulate(map(int,sys.stdin.readline().rstrip().split()))) + + ans = 0 + j = m + for i,item in enumerate(a): + if k K: + break + while B[j] > K - A[n]: + j -= 1 + ans = max(ans, n + j) +print(ans)" +p02623,s728894372,Accepted,"from bisect import bisect_left, bisect_right +from itertools import accumulate + +n, m, k = map(int, input().split()) +la = [0] + list(map(int, input().split())) +lb = list(map(int, input().split())) +# n,m,k=3,4,240 +# la = [60, 90, 120] +# lb = [80, 150, 80, 150] + +la = list(accumulate(la)) +lb = list(accumulate(lb)) + + +# x =bisect_right(lb, 600) +# print(lb) +# print(x) + + +answer = 0 +for ia, a in enumerate(la): + if a <= k: + ib = bisect_right(lb, k - a) + answer = max(answer, ia + ib) + + +print(answer) + + + + + +" +p02623,s221512611,Accepted," +import sys +import numpy as np +input = sys.stdin.readline + +N, M, K = map(int, input().split()) +A_list = list(map(int, input().split())) +B_list = list(map(int, input().split())) + + +A_list.insert(0, 0) +B_list.insert(0, 0) +A_cumsum = np.cumsum(A_list) +B_cumsum = np.cumsum(B_list) + +time = B_cumsum[-1] +ans, j = 0, M + + + +for i in range(N+1): + if A_cumsum[i] > K: + break + while B_cumsum[j] > K - A_cumsum[i]: + j -= 1 + ans = max(ans, i+j) +print(ans) +" +p02623,s690438382,Accepted,"from itertools import accumulate +from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +A = list(accumulate(A)) +B = [0] + list(map(int, input().split())) +B = list(accumulate(B)) + +ans = 0 +for i, a in enumerate(A): + if a > K: + break + n = bisect_right(B, K-a) - 1 + ans = max(ans, i+n) + +print(ans)" +p02623,s780396670,Accepted,"import numpy as np +n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +ans=0 +a=np.cumsum(A) +b=np.cumsum(B) +a=np.insert(a,0,0) +b=np.insert(b,0,0) +j=m +for i in range(n+1): + if a[i] > k: + break + while b[j] > k-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s609024827,Accepted,"from bisect import bisect_right +N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +CA = [0 for _ in range(N+1)] +for i in range(N): + CA[i+1] = A[i]+CA[i] +CB = [0 for _ in range(M+1)] +for j in range(M): + CB[j+1] = B[j]+CB[j] +cmax = 0 +for i in range(N,-1,-1): + if CA[i]<=K: + b = K-CA[i] + ind = bisect_right(CB,b) + cmax = max(cmax,i+ind-1) +print(cmax)" +p02623,s685652794,Accepted,"def MI(): return map(int, input().split()) +def LI(): return list(map(int, input().split())) + +N,M,K=MI() +A=[0]+LI() +B=[0]+LI() +from itertools import accumulate +A=list(accumulate(A)) +B=list(accumulate(B)) +ans=0 +b_cnt=M +for a_cnt in range(N+1): + if A[a_cnt]>K: + break + while A[a_cnt]+B[b_cnt]>K: + b_cnt-=1 + ans=max(ans,a_cnt+b_cnt) +print(ans)" +p02623,s575677782,Accepted,"import bisect +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +sumA=[0] +for i in range(N): + sumA.append(sumA[-1]+A[i]) +sumB=[0] +for i in range(M): + sumB.append(sumB[-1]+B[i]) + +ans=0 +for i in range(N+1): + k=K-sumA[i] + if k<0: + break + l=bisect.bisect_right(sumB,k)-1 + ans=max(ans,i+l) +print(ans)" +p02623,s753064459,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s613038546,Accepted,"A,B,K=map(int,input().split()) +List_A = list(map(int, input().split())) +List_B = list(map(int, input().split())) +SumListA=[] +SumListA.append(0) +SumListB=[] +SumListB.append(0) +res =0 +a=0 +for i in range(A): + SumListA.append(SumListA[i]+List_A[i]) +for i in range(B): + SumListB.append(SumListB[i]+List_B[i]) + +j=B +for i in range(A+1): + if SumListA[i] > K: + break + while K-SumListA[i] < SumListB[j]: + j += -1 + res = max(i+j,res) +print(res)" +p02623,s504148661,Accepted," +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) + +" +p02623,s975443165,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j-=1 + ans = max(ans,i+j) +print(ans)" +p02623,s665557704,Accepted,"N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +for i in range(1, N + 1): + A[i] += A[i-1] +for i in range(1, M + 1): + B[i] += B[i-1] + +ans = 0 +b_cnt = M +for a_cnt in range(N + 1): + if A[a_cnt] > K: + continue + while A[a_cnt] + B[b_cnt] > K: + b_cnt -= 1 + ans = max(ans, a_cnt + b_cnt) + +print(ans)" +p02623,s940183097,Accepted,"import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +sa = [0]*(n+1) +sb = [0]*(m+1) +for i in range(n): + sa[i+1] = sa[i]+a[i] +for i in range(m): + sb[i+1] = sb[i]+b[i] +ans = 0 +for i in range(n+1): + t = sa[i] + s = i + tl = k-t + if tl < 0: + continue + s += bisect.bisect_right(sb, tl)-1 + ans = max(ans,s) +print(ans)" +p02623,s276630541,Accepted,"n,m,k=map(int,input().split()) +al=list(map(int,input().split())) +bl=list(map(int,input().split())) +a=[0] +b=[0] +for i in range(n): + a.append(a[i]+al[i]) +for i in range(m): + b.append(b[i]+bl[i]) +ans=0 +j=m +for i in range(n+1): + if a[i]>k: + break + while b[j]>k-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans) +" +p02623,s770660114,Accepted,"def main(): + from itertools import chain + + N, M, K = map(int, input().split()) + A = map(int, input().split()) + *B, = map(int, input().split()) + + t = sum(B) + ans = 0 + j = M + for i, x in enumerate(chain([0], A)): + t += x + while j > 0 and t > K: + j -= 1 + t -= B[j] + if t > K: break + if ans < i + j: + ans = i + j + print(ans) + + +if __name__ == '__main__': + main() +" +p02623,s149939745,Accepted,"import bisect +N, M, K = map(int, input().split()) +A = tuple(map(int, input().split())) +B = tuple(map(int, input().split())) + +Asums = [0] * (N + 1) +for i, a in enumerate(A): + Asums[i+1] = Asums[i] + a + +Bsums = [0] * (M + 1) +for i, b in enumerate(B): + Bsums[i+1] = Bsums[i] + b + +ans = 0 +for anum in range(N + 1): + t = Asums[anum] + if K < t: + break + bnum = bisect.bisect_right(Bsums, K - t) - 1 + ans = max(ans, anum + bnum) +print(ans)" +p02623,s383244549,Accepted,"import bisect +n , m , k = map(int, input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ax = [0]*(n+1) +bx = [0]*(m+1) +for i in range(1,n+1): + ax[i]=ax[i-1]+a[i-1] +for i in range(1,m+1): + bx[i]=bx[i-1]+b[i-1] + +c = bisect.bisect_right(ax,k) +ma = 0 +for i in range(c): + d = bisect.bisect_right(bx,k-ax[i]) + ma = max(ma,i+d-1) +print(ma) +" +p02623,s203645012,Accepted,"import bisect +import itertools +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +acc1 = [0]+list(itertools.accumulate(a)) +acc2 = list(itertools.accumulate(b)) + +ans = 0 +for i in range(n+1): + num = i + temp = acc1[i] + rest = k-temp + + if rest >= 0: + hoge = bisect.bisect_right(acc2,rest) + + num += hoge + + if num > ans: + ans = num + +print(ans) + +" +p02623,s025701263,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0 for i in range(n+1)] +b = [0 for j in range(m+1)] +for i in range(n): + a[i+1] = a[i]+A[i] +for j in range(m): + b[j+1] = b[j]+B[j] + +j = m +res = 0 +for i in range(n+1): + if a[i] > k: + break + while k - a[i] < b[j]: + j -= 1 + res = max(res, i+j) + +print(res)" +p02623,s766087194,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + #print(b[j],K - a[i]) + j -= 1 + ans = max(ans, i + j) + #print(""ans"",ans) +print(ans)" +p02623,s751209930,Accepted,"n,m,k=map(int,input().split()) +a=[0]+list(map(int,input().split())) +b=[0]+list(map(int,input().split())) + +for i in range(1,n+1): a[i]=a[i]+a[i-1] +for i in range(1,m+1): b[i]=b[i]+b[i-1] +j=m +ans=0 +for i in range(n+1): + if j<0: break + while a[i]+b[j]>k and j>=0: j-=1 + ans=max(i+j,ans) +print(ans)" +p02623,s690841067,Accepted,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +res = 0 +output = 0 +j = M +num = 0 +for i in range(N + 1): + if K < a[i]: + break + else: + res = K - a[i] + while b[j] > res: + j -= 1 + num = i + j + output = max(output, num) +print(output)" +p02623,s215786471,Accepted,"# C - Tsundoku +from bisect import bisect +from itertools import accumulate + + +def main(): + N, M, K, *AB = map(int, open(0).read().split()) + cum_A, cum_B = tuple(accumulate([0] + AB[:N])), tuple(accumulate(AB[N:])) + candidates = [] + for i, a_time in enumerate(cum_A): + if a_time > K: + candidates.append(0) + break + b_time = K - a_time + candidates.append(i + bisect(cum_B, b_time)) + print(max(candidates)) + + +if __name__ == ""__main__"": + main() +" +p02623,s905784749,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a, b = [0], [0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) + +ans = 0 +j = m +for i in range(n+1): + if a[i] > k: break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s380098294,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +t = sum(A) +i = N +ans = 0 + +for j in range(M + 1): + while i > 0 and t > K: + i -= 1 + t -= A[i] + if t > K: + break + ans = max(ans, i + j) + if j == M: + break + t += B[j] +print(ans)" +p02623,s609907557,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +most = 0 +cur = 0 +tot = 0 +for i in range(n): + if tot + a[i] <= k: + cur += 1 + tot += a[i] + if cur > most: + most = cur + else: + i -= 1 + break +j = 0 +while j < m: + if tot + b[j] <= k: + cur += 1 + tot += b[j] + if cur > most: + most = cur + j += 1 + else: + if i >= 0: + cur -= 1 + tot -= a[i] + i -= 1 + else: + break +print(most)" +p02623,s243729635,Accepted,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a = [0] +b = [0] +for i in range(n): + a.append(a[-1]+A[i]) +for j in range(m): + b.append(b[-1]+B[j]) +ans = 0 +j = m +for i in range(n+1): + if a[i] > k: + break + while b[j] > k -a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s213144958,Accepted,"from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +sum_a = [0] +for v in a: + sum_a.append(sum_a[-1] + v) + +sum_b = [0] +for v in b: + sum_b.append(sum_b[-1] + v) + +x = bisect_right(sum_a, k) + +res = 0 +for i in range(x): + res = max(res, bisect_right(sum_b, k - sum_a[i]) + i - 1) +print(res)" +p02623,s867864086,Accepted,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +bc = [0]*(m+1) +for i in range(m): + bc[i+1] = bc[i] + b[i] +bc = bc[1:] + +ans = bisect.bisect_right(bc, k) # 0冊 +totala = 0 +na = 0 +for i in range(n): + totala += a[i] + na += 1 + if totala == k: + ans = max(ans, na) + break + elif totala > k: + break + ba = bisect.bisect_right(bc, k-totala) + ans = max(ans, na+ba) +print(ans)" +p02623,s091948526,Accepted,"from bisect import bisect_left,bisect_right +n,m,k=map(int,input().split()) +arr1=list(map(int,input().split())) +arr2=list(map(int,input().split())) +for i in range(1,n): + arr1[i]=arr1[i]+arr1[i-1] +for i in range(1,m): + arr2[i]=arr2[i]+arr2[i-1] +ma=0 +for i in range(n): + if arr1[i]<=k: + ma=max(ma,bisect_right(arr2,k-arr1[i])+i+1) +for i in range(m): + if arr2[i]<=k: + ma=max(ma,bisect_right(arr1,k-arr2[i])+i+1) +print(ma)" +p02623,s548097346,Accepted,"import bisect +N, M, K = map(int,input().split()) +ls_a = list(map(int,input().split())) +ls_b = list(map(int,input().split())) + +A = [0] * (N+1) +B = [0] * (M+1) +for i in range(N): + A[i+1] = A[i] + ls_a[i] +for i in range(M): + B[i+1] = B[i] + ls_b[i] + +ans = 0 +for i in range(N+1): + if A[i] <= K: + x = bisect.bisect(B,K-A[i]) + ans = max(ans, i+x-1) +print(ans)" +p02623,s905409213,Accepted,"n, m, k = map(int, input().split()) +a_list = list(map(int, input().strip().split())) +b_list = list(map(int, input().strip().split())) + +a, b = [0], [0] +for i in range(n): + a.append(a[i] + a_list[i]) +for j in range(m): + b.append(b[j] + b_list[j]) + +ans, j = 0, m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s728743494,Accepted,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] +for i in range(0, n): + a.append(A[i] + a[i]) +for i in range(0, m): + b.append(B[i] + b[i]) + +ans = 0 +j = m +for i in range(n+1): + if a[i] > k: + break + while b[j] > k-a[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s432684273,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A, B = [0], [0] +for i in range(n): + A.append(a[i]+A[i]) +for i in range(m): + B.append(b[i]+B[i]) + +ans, j = 0, m +for i in range(n+1): + if A[i] > k: + break + while B[j] > k - A[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s480597244,Accepted,"from bisect import bisect_left, bisect_right + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +res = 0 + +cA = [0] +for i in range(N): + cA.append(cA[-1] + A[i]) + +cB = [0] +for i in range(M): + cB.append(cB[-1] + B[i]) + +for i in range(N + 1): + rem = K - cA[i] + if rem < 0: + continue + j = bisect_right(cB, rem) + res = max(res, i + j - 1) + +print(res)" +p02623,s870532012,Accepted,"from bisect import * +n, m, k = map(int, input().split()) +A = [0] +for x in map(int, input().split()): + x += A[-1] + if x > k: break + A.append(x) +B = [0] +for x in map(int, input().split()): + x += B[-1] + if x > k: break + B.append(x) +ans = 0 +for i in range(len(A)): + ans = max(ans, i + (bisect_right(B, k-A[i]) - 1)) +print(ans) +" +p02623,s684039444,Accepted,"from itertools import accumulate, permutations + +import bisect + + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A = [0] + list(accumulate(A)) +B = [0] + list(accumulate(B)) + +ans = 0 +for i in range(N+1): + a = A[i] + if a > K: + continue + r = K - a + j = bisect.bisect(B, r) - 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s194311703,Accepted,"n,m,k=map(int, input().split()) +*a,=map(int, input().split()) +*b,=map(int, input().split()) +a=[0]+a +b=[0]+b +import numpy as np +a=np.cumsum(a) +b=np.cumsum(b) +bi=m +ans=0 +for i in range(n+1): + asm=a[i] + while a[i]+b[bi]>k and bi: + bi-=1 + if a[i]+b[bi]<=k: + ans=max(ans,i+bi) +print(ans)" +p02623,s029646848,Accepted,"from itertools import accumulate +from bisect import bisect_left,bisect +n, m , k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ruia = [0] +ruia.extend(list(accumulate(a))) +ruib = list(accumulate(b)) +ans = 0 +for i in range(n+1): + nokori = k - ruia[i] + if nokori < 0: + break + yomeru = bisect(ruib,nokori) + ans = max(ans,i+yomeru) +print(ans)" +p02623,s601055439,Accepted,"import sys +input = sys.stdin.readline + +n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +res = 0 +a, b = [0], [0] + +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) + +j = m + +for i in range(n+1): + if a[i] > k: + break + while True: + if a[i] + b[j] <= k: + break + j -= 1 + res = max(res, i+j) + +print(res)" +p02623,s746286240,Accepted,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a,b = [0],[0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans,j = 0,m +for i in range(n+1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s251086494,Accepted,"n, m, k = map(int, input().split()) + +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +sum_a = [0] +sum_b = [0] + +for i in range(n): + sum_a.append(sum_a[-1] + a[i]) + +for i in range(m): + sum_b.append(sum_b[-1] + b[i]) + +ans = 0 +j = m +for i in range(n + 1): + while sum_a[i] + sum_b[j] > k and j >= 0: + j -= 1 + + if j < 0: + break + + if sum_a[i] + sum_b[j] <= k: + ans = max(ans, i + j) + +print(ans) + +" +p02623,s502603443,Accepted,"from bisect import bisect_right +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +for i in range(m): + b[i+1] += b[i] + + +def f(time, r): + ret = bisect_right(r, time) - 1 + return ret + + +def fa(time): + return f(time, a) + + +def fb(time): + return f(time, b) + +ans = 0 + +for i, ai in enumerate(a): + k -= ai + if k < 0: + break + ans = max(ans, i + fb(k)) + +print(ans)" +p02623,s853119607,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ea=[0] +for i in range(n): + ea.append(ea[i]+a[i]) +eb=[0] +for i in range(m): + eb.append(eb[i]+b[i]) +if n>m: + ea,eb=eb,ea + n,m=m,n +tb=m +p=0 +for i in range(n+1): + while ea[i]+eb[tb]>k: + if tb==0: + break + tb-=1 + if ea[i]+eb[tb]<=k: + p=max(i+tb,p) +print(p)" +p02623,s585130004,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s481530269,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +A = [0] * (n+1) +B = [0] * (m+1) +for i in range(n): + A[i+1] = A[i] + a[i] +for i in range(m): + B[i+1] = B[i] + b[i] + +ans = 0 +j = m +for i in range(n+1): + if A[i] > k: + break + while B[j] > k - A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s756005023,Accepted,"import bisect +N,M,K = map(int, input().split()) +A= list(map(int, input().split())) +B = list(map(int, input().split())) +for i in range(1,len(A)): + A[i]+=A[i-1] +for i in range(1,len(B)): + B[i]+=B[i-1] + +honn=bisect.bisect(B,K) +#print(honn) +for i in range(len(A)): + s=K-A[i] + if s>=0: + + a=bisect.bisect(B,s) + #print(s) + if i+1+a>honn: + honn=i+1+a +print(honn)" +p02623,s591750438,Accepted,"n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +a = [0] +b = [0] + +for i in range(n): + a.append(a[i]+ A[i]) +for i in range(m): + b.append(b[i] + B[i]) +# print(a) +# print(b) +# print(a[3]) +ans=0 +j = m +for i in range(n+1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s490410250,Accepted,"from itertools import accumulate +from bisect import bisect_right +N, M, K = map(int,input().split()) +A = [0]+list(accumulate(map(int,input().split()), lambda x,y:x+y)) +B = [0]+list(accumulate(map(int,input().split()), lambda x,y:x+y)) +ans = 0 +for i in range(N+1): + left = K-A[i] + if left < 0: + break + j = bisect_right(B, left) + ans = max(ans, i+j-1) +print(ans)" +p02623,s908085832,Accepted,"n,m,k=map(int,input().split()) +aa=list(map(int,input().split())) +bb=list(map(int,input().split())) + +a=[0] +b=[0] + +for i in range(n):a.append(a[i]+aa[i]) +for i in range(m):b.append(b[i]+bb[i]) + +ans=0 +j=m +for i in range(n+1): + if(a[i]>k):break + while b[j]>k-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s772889252,Accepted,"import bisect + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ans = 0 +cnta = [0 for i in range(n + 1)] +cntb = [0 for i in range(m + 1)] + +for i in range(n): + cnta[i + 1] = cnta[i] + a[i] +for i in range(m): + cntb[i + 1] = cntb[i] + b[i] +for i in range(n + 1): + cnt = 0 + if k - cnta[i] >= 0: + cnt = i + cnt += min(m, bisect.bisect_right(cntb, k - cnta[i]) - 1) + ans = max(ans, cnt) +print(ans) +" +p02623,s779353028,Accepted,"import sys, math +input = sys.stdin.readline +rs = lambda: input().strip() +ri = lambda: int(input()) +rl = lambda: list(map(int, input().split())) +mod = 10**9 + 7 + +N, M, K = rl() +A = rl() +B = rl() + +s = 0 +for i, b in enumerate(B): + s += b + B[i] = s + +import bisect + +ans = 0 +s = 0 +j = bisect.bisect_right(B, K) +ans = j +for i, a in enumerate(A): + s += a + if s > K: + break + j = bisect.bisect_right(B, K-s) + #print(i, j) + n = i+1 + j + ans = max(ans, n) +print(ans) +" +p02623,s261437494,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +nmax = 0 + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans = 0 +j = M +for i in range(N + 1): + if a[i] > K: + break + + while b[j] + a[i] > K: + j -= 1 + ans = max(ans, i+j) + +print(ans) +exit() +" +p02623,s620046845,Accepted,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a=[0];b=[0];ans=0;j=m +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +for i in range(n+1): + if a[i]>k: + break + while b[j]>k-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s129081095,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +aa=[a[0]] +for i in range(n-1): + aa.append(aa[i]+a[i+1]) +aa.insert(0,0) +bb=[b[0]] +for i in range(m-1): + bb.append(bb[i]+b[i+1]) + +import bisect +l=[] +for i in range(n+1): + p=k-aa[i] + if p>=0: + l.append(i+bisect.bisect_right(bb,p)) + else: + break +print(max(l)) + +" +p02623,s875832239,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s001185813,Accepted,"import bisect +N,M,K = map(int,input().split()) +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +bsum = [0] +for b in B: + bsum.append(bsum[-1]+b) + +ans = bisect.bisect_right(bsum,K) -1 +asum = 0 +for n,a in enumerate(A): + asum += a + if asum > K: + break + m = bisect.bisect_right(bsum,K-asum) + if ans < m+n: + ans = m+ n +print(ans)" +p02623,s053271469,Accepted,"from bisect import bisect_right as br +n,m,k = map(int,input().split()) +a = [int(i) for i in input().split()] +sa = [0]*(n+1) +for i in range(n): sa[i+1] = sa[i]+a[i] +b = [int(i) for i in input().split()] +sb = [0]*(m+1) +for i in range(m): sb[i+1] = sb[i]+b[i] +ans = 0 +for i in range(n+1): + cnt = sa[i] + if cnt > k: break + ans = max(ans,br(sb,k-cnt)-1+i) +print(ans)" +p02623,s323078483,Accepted,"from itertools import accumulate +from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +acc_a = list(accumulate(a)) +acc_b = list(accumulate(b)) + +ans = 0 +for i, e in enumerate(acc_b): + if e > k: + break + a_cnt = bisect_right(acc_a, k - e) + ans = max(ans, i + a_cnt) + +print(ans) +" +p02623,s831319306,Accepted,"n, m, k = map(int, input().split()) +an = list(map(int, input().split())) +bn = list(map(int, input().split())) +ls = an[::-1] + bn +l = 0 +r = n +s = sum(an) +ans = 0 +while r < n + m and l <= n: + if s <= k: + ans = max(ans, r - l) + s += ls[r] + r += 1 + else: + s -= ls[l] + l += 1 +if s <= k: + ans = max(ans, r-l) +print(ans) + + " +p02623,s540581819,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +A,B = [0],[0] + +for i in range(n): + A.append(a[i] + A[i]) +for i in range(m): + B.append(b[i] + B[i]) + +num,x = 0,m + +for i in range(n+1): + if A[i] > k: + break + while A[i] + B[x] > k: + x -= 1 + num = max(num, i + x) + +print(num) + + +" +p02623,s912786940,Accepted,"N, M, K = map(int, input().split(' ')) +A_ls = [0] + list(map(int, input().split(' '))) +for i in range(N): + A_ls[i + 1] += A_ls[i] +B_ls = [0] + list(map(int, input().split(' '))) +for i in range(M): + B_ls[i + 1] += B_ls[i] +b_cnt, rst = M, 0 +for a_cnt in range(N + 1): + if A_ls[a_cnt] > K: + break + while A_ls[a_cnt] + B_ls[b_cnt] > K and b_cnt >= 0: + b_cnt -=1 + rst = max(rst, a_cnt + b_cnt) +print(rst)" +p02623,s730612017,Accepted,"import numpy as np + +n, m, k = map(int, input().split()) +a = np.array([0] + input().split(), dtype=int) +b = np.array([0] + input().split(), dtype=int) + +cum_a = a.cumsum() +cum_b = b.cumsum() + +maximum = 0 +j = 0 +for i in range(n, -1, -1): + rest = k - cum_a[i] + if rest < 0: + continue + while rest - cum_b[j] >= 0: + j += 1 + if j > m: + break + j -= 1 + maximum = max(maximum, i + j) +print(maximum)" +p02623,s073312593,Accepted,"import sys +import numpy as np + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +N, M, K = map(int, readline().split()) +AB = np.array(read().split(), np.int64) +A = AB[:N] +B = AB[N:] + +Acum = np.zeros(N + 1, np.int64) +Acum[1:] = np.cumsum(A) +Bcum = np.zeros(M + 1, np.int64) +Bcum[1:] = np.cumsum(B) + +Acum = Acum[Acum <= K] +Bcum = Bcum[Bcum <= K] + +x = np.searchsorted(Acum, K - Bcum, side='right') - 1 +x += np.arange(len(Bcum)) + +print(x.max())" +p02623,s013131267,Accepted,"import numpy as np +import bisect +from decimal import Decimal +n, m, k = map(int, input().split()) +aa = list(map(Decimal, input().split())) +bb = list(map(Decimal, input().split())) +aasum = np.cumsum(aa) +bbsum = np.cumsum(bb) +an = bisect.bisect_right(aasum, k) +bn = bisect.bisect_right(bbsum, k) +ret = max(an, bn) +for i in range(n): + if k - aasum[i] < 0: + break + v = bisect.bisect_right(bbsum, k - aasum[i]) + if v+i+1>ret: + ret = v+i+1 +print(ret)" +p02623,s127983566,Accepted,"N,M,K = map(int,input().split()) + +A = list(map(int, input().split())) +B =list(map(int, input().split())) + +sumA=[0] +sumB=[0] + + +for i in range(N): + sumA.append(sumA[-1]+A[i]) +for i in range(M): + sumB.append(sumB[-1]+B[i]) + + +total=0 +startB=len(sumB)-1 +for a in range(len(sumA)): + for b in range(startB,-1,-1): + if sumA[a]+sumB[b]<=K: + total=max(total,a+b) + startB=b + break + if sumA[a]>K: + break + +print(total) + " +p02623,s741873395,Accepted,"from itertools import accumulate +from bisect import bisect_right +N, M, K = [int(x) for x in input().split()] +A = [0] + [int(x) for x in input().split()] +B = [0] + [int(x) for x in input().split()] + +cumA = list(accumulate(A)) +cumB = list(accumulate(B)) + +ans = 0 +for i in range(N + 1): + if cumA[i] > K: break + Tb = K - cumA[i] + temp = i + bisect_right(cumB, Tb) - 1 + ans = max(ans, temp) + +print(ans)" +p02623,s622408610,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +t = 0 +sum_a = [0] +for i in range(n): + if t + a[i] <= k: + t += a[i] + sum_a.append(t) + else: + break +sum_b = [0] +t = 0 +for i in range(m): + if t + b[i] <= k: + t += b[i] + sum_b.append(t) + else: + break +ans = [] +j = 0 +for i in range(len(sum_a)): + while sum_a[i] + sum_b[len(sum_b) - j - 1] > k: + j += 1 + ans.append(i + len(sum_b) - j - 1) +print(max(ans))" +p02623,s065702459,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A = [0] + A +B = [0] + B +for i in range(N): + A[i + 1] += A[i] +for i in range(M): + B[i + 1] += B[i] + +res, j = 0, M +for i in range(N + 1): + if A[i] > K: + break + while B[j] > K - A[i]: + j -= 1 + res = max(res, i + j) +print(res) +" +p02623,s819369529,Accepted,"N,M,K=map(int, input().split()) +A = [0] +B = [0] +A += list(map(int, input().split())) +B += list(map(int, input().split())) +for i in range(N): + A[i+1] += A[i] +for i in range(M): + B[i+1] += B[i] +j = 0 +ans = 0 +for i in range(N,-1,-1): + while (j <= M) and (A[i] + B[j] <= K): + ans = max(ans, i+j) +# print(i,j,A[i],B[j], A[i] + B[j], ans) + j += 1 +print(ans) + +" +p02623,s620651855,Accepted,"N, M, K = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) + +dp = [0]*(N+1) +tot, lb = sum(B), M +while tot > K: + tot -= B.pop(-1) + lb -= 1 +dp[0] = lb + +for i in range(N): + K -= A[i] + if K < 0: + continue + while tot > K and lb > 0: + tot -= B.pop(-1) + lb -= 1 + dp[i+1] = i+1 + lb + +print(max(dp))" +p02623,s796408832,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +A = [0] +B = [0] + +for i in range(n): + A.append(A[i]+a[i]) + +for i in range(m): + B.append(B[i]+b[i]) + +ans,j = 0,m +for i in range(n+1): + if A[i] > k: + break + while B[j] + A[i] > k: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s041091149,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +A,B = [0],[0] + +for i in range(n): + A.append(A[i] + a[i]) +for i in range(m): + B.append(B[i] + b[i]) + +ans,j = 0,m + +for i in range(n+1): + if A[i] > k: + break + while B[j] > k - A[i]: + j -= 1 + ans = max(ans,i+ j) +print(ans) + +" +p02623,s420841495,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] + +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s002725850,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M + +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s924067925,Accepted,"n,m,k = map(int,input().split()) + +A = [int(x) for x in input().split()] +B = [int(x) for x in input().split()] + +a, b = [0], [0] +for i in range(n): + a.append(a[i] + A[i]) +for i in range(m): + b.append(b[i] + B[i]) + +ans, j = 0, m +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans) +" +p02623,s902496408,Accepted,"import sys +from itertools import accumulate + +n,m,k=map(int, input().split()) +a = [0] + list(accumulate(map(int,sys.stdin.readline().rstrip().split()))) +b = [0] + list(accumulate(map(int,sys.stdin.readline().rstrip().split()))) +ans = 0 +j = m + +#print(a,b) + +for i,item in enumerate(a): + if kk: + continue + rest=k-a[a_cnt] + b_cnt=bisect.bisect(b,rest)-1 + book_cnt=max(book_cnt,a_cnt+b_cnt) + +print(book_cnt)" +p02623,s365651100,Accepted,"N,M,K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = [0] +b = [0] + +for i in range(N): + a.append(a[i] + A[i]) +for j in range(M): + b.append(b[j] + B[j]) +ans = 0 +j = M +for i in range(N+1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i+j) +print(ans)" +p02623,s624362473,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +sa = [0] +sb = [0] +for i in range(n): + sa.append(sa[i]+a[i]) +for i in range(m): + sb.append(sb[i]+b[i]) +maxn = 0 +j = m +for i in range(n+1): + if sa[i] <= k: + while sa[i] + sb[j] > k: + j -= 1 + maxn = max(maxn,i+j) +print(maxn)" +p02623,s018985931,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] + +for i in range(N): + a.append(a[i] + A[i]) + +for j in range(M): + b.append(b[j] + B[j]) + +ans = 0 +j = M + +for i in range(N+1): + if a[i] > K: + break + + while b[j] > K - a[i]: + j -= 1 + + ans = max(ans, i + j) + +print(ans)" +p02623,s557435660,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +lia = [0] +lib = [0] +j = M +ans = 0 + +for i in range(N): + lia.append(lia[i]+A[i]) +for i in range(M): + lib.append(lib[i]+B[i]) + +for i in range(N+1): + if lia[i] > K: + break + + while lib[j] > K-lia[i]: + j -= 1 + ans = max(ans, i+j) + +print(ans)" +p02623,s772742574,Accepted,"import bisect + +N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] +b = [0] +for i in range(N): + a += [a[i] + A[i]] +for i in range(M): + b += [b[i] + B[i]] + +ans = 0 +for i in range(N+1): + if a[i] <= K: + ans = max(ans, i + bisect.bisect_right(b, K - a[i])-1) + +print(ans)" +p02623,s755034143,Accepted,"import numpy as np +from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = list(map(int, input().split())) + +ac = np.cumsum(a) +bc = np.cumsum(b) +ans = 0 + +# print(ac) +# print(bc) + +for i in range(n+1): + if k < ac[i]: + break + time = k - ac[i] + j = bisect_right(bc, time) + ans = max(ans, j + i) + +print(ans) +" +p02623,s262563388,Accepted,"from itertools import accumulate + +N, M, K = map(int, input().split()) +A = list(accumulate(int(i) for i in input().split())) +B = list(accumulate(int(i) for i in input().split())) + +a,b = [0],[0] +for ai in A: + a.append(ai) +for bj in B: + b.append(bj) + +cnt = 0 +best0 = M +for i in range(N+1): + ai = a[i] + for j in range(best0, -1, -1): + bj = b[j] + if ai + bj <= K: + cnt = max(cnt, i + j) + best0 = j + break + +print(cnt)" +p02623,s402497931,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +p, q = [0], [0] +for i in range(n): + p.append(p[i] + a[i]) +for i in range(m): + q.append(q[i] + b[i]) + +j, ans = m, 0 +for i in range(n+1): + if p[i] > k: + break + + while q[j] > k - p[i]: + j -= 1 + + ans = max(ans, i+j) + +print(ans)" +p02623,s514024133,Accepted,"# C - Tsundoku + +import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +Asum = [0] +for i in range(N): + Asum.append(Asum[i] + A[i]) + +Bsum = [0] +for j in range(M): + Bsum.append(Bsum[j] + B[j]) + +ans = 0 +for i in range(N+1): + if Asum[i] > K: + continue + tmp = K - Asum[i] + j = bisect.bisect_right(Bsum, tmp) - 1 + ans = max(ans, i+j) +print(ans) +" +p02623,s897360805,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s546954167,Accepted,"import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +sa,sb = [0],[0] +ans = 0 +for i in range(n): + sa.append(sa[i]+a[i]) +for i in range(m): + sb.append(sb[i]+b[i]) + + +for i in range(n+1): + sai = sa[i] + x = k-sai + if x>=0: + ans = max(ans,bisect.bisect_right(sb,x)-1+i) +print(ans)" +p02623,s046112971,Accepted,"# -*- coding: utf-8 -*- +# 標準入力を取得 +N, M, K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +# 求解処理 +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for j in range(M): + b.append(b[j] + B[j]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) + +# 結果出力 +print(ans) +" +p02623,s790338414,Accepted,"import itertools + +N,M,K=map(int, input().split()) +A=list(map(int, input().split())) +B=list(map(int, input().split())) + +sumA = list(itertools.accumulate(A)) +sumB = list(itertools.accumulate(B)) +j=M-1 +while K=0: + j-=1 +ans=j+1 +for i in range(N): + if sumA[i]>K: + break + while K=0: + j-=1 + ans=max(ans,i+j+2) +print(ans)" +p02623,s401240884,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s006578621,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s878624876,Accepted,"N, M, K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +a, b=[0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans, j=0, M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans=max(ans, i+j) + +print(ans)" +p02623,s372973813,Accepted,"import sys +input = sys.stdin.readline + +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +from itertools import accumulate +import bisect + +SA=[0]+list(accumulate(A)) +SB=[0]+list(accumulate(B)) + +ANS=0 +for i in range(N+1): + if K-SA[i]<0: + break + x=bisect.bisect_right(SB,K-SA[i]) + ANS=max(ANS,i+x-1) +print(ANS) +" +p02623,s272241849,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s242494439,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +t = sum(b) +ans = 0 +j = m + +for i in range(n+1): + while j > 0 and t>k: + j -= 1 + t -= b[j] + if t>k: break + ans = max(ans, i+j) + if i==n: break + t += a[i] + +print(ans) +" +p02623,s028078126,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ans = 0 +a_list = [0] +b_list = [0] +for i in range(n): + a_list.append(a[i] + a_list[i]) +for i in range(m): + b_list.append(b[i] + b_list[i]) + +ans = 0 +num = m +for i in range(n+1): + if a_list[i] > k: + break + while b_list[num] > k - a_list[i]: + num -= 1 + ans = max(ans,i + num) +print(ans) +" +p02623,s186250126,Accepted,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=0 +asum=0 +bsum=0 +pointer=0 +while pointerk and pointer>=0: + pointer-=1 + bsum-=b[pointer] + if asum+bsum>k: + break + ans=max(ans,(i+1)+pointer) +print(ans)" +p02623,s600481173,Accepted,"n,m,k = list(map(int,input().split())) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +import numpy as np +a = [0] + a +b = [0] + b +sa = np.cumsum(a) +sb = np.cumsum(b) +ans = 0 +r = m +for i in range(n+1): + if sa[i] > k: + break + while sa[i] + sb[r] > k: + r -= 1 + ans = max(ans, i+r) + +print(ans)" +p02623,s212429621,Accepted,"n,m,k=map(int,raw_input().split()) +a=map(int,raw_input().split()) +b=map(int,raw_input().split()) +cnt1=0 +cnt2=0 +a1=[0] +b1=[0] +for i in range(n): + a1.append(a1[-1]+a[i]) +for i in range(m): + b1.append(b1[-1]+b[i]) +ans=0 +j=m +for i in range(n+1): + if a1[i]>k: + break + while b1[j]>k-a1[i]: + j-=1 + ans=max(ans,i+j) +print ans" +p02623,s169915198,Accepted,"from itertools import accumulate +n,m,k = map(int,input().split()) +deskA = list(map(int,input().split())) +deskB = list(map(int,input().split())) +cumA = list(accumulate(deskA)) +cumB = list(accumulate(deskB)) +cumA = [0] + cumA +cumB = [0] + cumB +ans = 0 +l = m +for i in range(n+1): + tmp = k - cumA[i] + if tmp<0: + continue + j = l + tmp -= cumB[j] + while tmp < 0: + tmp += cumB[j] + j -= 1 + tmp -= cumB[j] + l = j + ans = max(i+j,ans) +print(ans)" +p02623,s695368672,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A, B = [0], [0] +for i in range(n): + A.append(A[i] + a[i]) +for i in range(m): + B.append(B[i] + b[i]) + +ans, j = 0, m +for i in range(n+1): + if A[i] > k: + break + while B[j] > k - A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans) +" +p02623,s985811759,Accepted,"N, M, K = map(int, input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for j in range(M): + b.append(b[j] + B[j]) + +ans = 0 +j = M +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j = j -1 + ans = max(ans, i+j) + +print(ans)" +p02623,s072946168,Accepted,"N, M, K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a, b=[0], [0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) +ans, j=0, M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j-=1 + ans=max(ans, i+j) +print(ans)" +p02623,s939493795,Accepted,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a,b = [0],[0] +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +ans,j = 0,M +for i in range(N+1): + if a[i]>K: + break + while b[j]>K-a[i]: + j -= 1 + ans = max(ans,i+j) +print(ans)" +p02623,s373794153,Accepted,"from bisect import bisect +from numpy import cumsum +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +a=cumsum(a) +b=cumsum(b) + +read=bisect(a,k) +time=a[read-1] +ans=read + +for i in range(read): + extra=k-time + r=bisect(b,extra) + ans=max(ans,read+r) + read-=1 + time=a[read-1] +read=bisect(b,k) +ans=max(ans,read) +print(ans)" +p02623,s231280610,Accepted,"import numpy as np + +N, M, K = map(int, input().split()) +A = [0] + list(map(int, input().split())) +B = [0] + list(map(int, input().split())) + +A = np.array(A).cumsum() +B = np.array(B).cumsum() + +ans = 0 +j = M +for i in range(N+1): + if A[i] > K: + break + while B[j] > K - A[i]: + j -= 1 + ans = max(ans, i+j) +print(ans) +" +p02623,s954303689,Accepted,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +import bisect + +alist = [0] +blist = [0] + +for i in range(n): + alist.append(alist[i]+a[i]) +for i in range(m): + blist.append(blist[i]+b[i]) + +res = 0 +ans = 0 +for i in range(n+1): + border = k - alist[i] + if border < 0: + continue + ans = i + ans += bisect.bisect_right(blist, border)-1 + res = max(res, ans) + +print(res)" +p02623,s998713380,Accepted,"n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +for i in range(1, n+1): + a[i] += a[i-1] +for i in range(1, m+1): + b[i] += b[i-1] + +ans = 0 +b_cnt = m +for a_cnt in range(n+1): + if a[a_cnt] > k: break + while a[a_cnt] + b[b_cnt] > k: + b_cnt -= 1 + ans = max(ans, a_cnt + b_cnt) + +print(ans) +" +p02623,s356828879,Accepted,"import bisect + + +n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +cumA = [0] +cumB = [] + +a_sum = 0 +for a in A: + a_sum += a + cumA.append(a_sum) + +b_sum = 0 +for b in B: + b_sum += b + cumB.append(b_sum) + + +candidates = [] +for i, aa in enumerate(cumA): + if aa > k: + break + + residue = k - aa + j = bisect.bisect_right(cumB, residue) + candidates.append(i + j) + +print(max(candidates))" +p02623,s814382819,Accepted,"from bisect import bisect_right + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +SA = [0]*(N+1) +SB = [0]*(M+1) +for i in range(N): + SA[i+1] = SA[i] + A[i] +for i in range(M): + SB[i+1] = SB[i] + B[i] + +ans = 0 +for i in range(N+1): + cntA = i + rest = K - SA[i] + if rest < 0: + break + cntB = bisect_right(SB, rest) - 1 + ans = max(ans, cntA+cntB) + +print(ans)" +p02623,s715192985,Accepted,"from itertools import accumulate +import bisect +n, m, k = map(int, input().split()) +Acum = [0]+list(accumulate(map(int, input().split()))) +Bcum = [0]+list(accumulate(map(int, input().split()))) + +ans = 0 +for a in range(n+1): + if k-Acum[a] < 0: + break + b = bisect.bisect_right(Bcum, k-Acum[a])-1 + if ans < a+b: + ans = a+b +print(ans) +" +p02623,s795070559,Accepted,"import sys +input = lambda: sys.stdin.readline().rstrip() + +N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a = [0] + A +b = [0] + B + +for i in range(len(a)-1): + a[i+1] += a[i] + +for i in range(len(b)-1): + b[i+1] += b[i] + +ans = 0 +j = M + +for i in range(N+1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i+j) +print(ans) " +p02623,s534983825,Accepted,"import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +from bisect import bisect_right +n,k,m = map(int,readline().split()) +a = [int(i) for i in readline().split()] +b = [int(i) for i in readline().split()] + +aa = [0]*(n+1) +bb = [0]*(k+1) +for i in range(n): + aa[i+1] = aa[i]+a[i] +for i in range(k): + bb[i+1] = bb[i]+b[i] + +ans = 0 +for num,i in enumerate(bb): + M = m-i + if M >= 0: + ind = bisect_right(aa,M) + ans = max(ans,num+ind-1) + +print(ans)" +p02623,s057008143,Accepted,"import itertools +from bisect import bisect_right +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +sum_a = [0] + list(itertools.accumulate(a)) +sum_b = [0] + list(itertools.accumulate(b)) +ans = 0 +for i in range(n + 1): + if sum_a[i] > k: + break + ans = max(ans, i + bisect_right(sum_b, k - sum_a[i]) - 1) +print(ans) +" +p02623,s133315706,Accepted,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +from itertools import accumulate +a = list(accumulate(a)) +b = list(accumulate(b)) + +from collections import deque +u = deque([0]) +a.insert(0,0) + +import bisect +for i in range(n+1): + if k-a[i]>=0: + index = bisect.bisect_right(b,k-a[i]) + u.append(index+i) + else: + break +print(max(u))" +p02623,s101192824,Accepted,"from itertools import accumulate +import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ac = [0] + list(accumulate(a)) +bc = [0] + list(accumulate(b)) + +ans = 0 +for i in range(bisect.bisect(ac, k)): + bi = bisect.bisect(bc, k - ac[i]) + ans = max(ans, i+bi-1) +print(ans)" +p02623,s392154366,Wrong Answer,"x = input().split() +y = input().split() +z = input().split() +s = 0 + +for nn in range(2000000): + if int(x[2]) < 0: + break + if int(y[0]) <= int(z[0]) : + x[2] = int(x[2]) - int(y[0]) + del y[0] + y.append(1000000001) + s += 1 + else: + x[2] = int(x[2]) - int(z[0]) + del z[0] + z.append(1000000001) + s += 1 +print(s-1)" +p02623,s271125020,Wrong Answer,"def main(): + n, m, k = map(int,input().split()) + A = list(map(int,input().split())) + B = list(map(int,input().split())) + C = [] + for x in range(n): + sumA = int(sum(A[0:x])) + for y in range(m): + sumB = int(sum(B[0:y])) + if sumA + sumB < k: + C.append(x+y) + print(max(C)) +main()" +p02623,s848618528,Wrong Answer,"a = [input() for l in range(0,3)] + +a1 = [int(p) for p in a[0].split()] +a2 = [int(p) for p in a[1].split()] +a3 = [int(p) for p in a[2].split()] +a4 = a2 + a3 + +b = sorted(a4) + +c = 0 +for i in range(0,len(b)): + c = c + b[i] + +if c <= a1[2]: + print(len(b)) +else: + s = 0 + t = 0 + while s <= a1[2] and t < len(b): + s = s + b[t] + t = t + 1 + print(t-1)" +p02623,s850210006,Wrong Answer,"import bisect + +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A_cum = [0] +B_cum = [0] + +for i in range(n): + A_cum.append(A_cum[i]+A[i]) + +for i in range(m): + B_cum.append(B_cum[i]+B[i]) + +ans = 0 +for i in range(n): + rest = k-A_cum[i] + if rest<=0: + continue + ans = max(ans, bisect.bisect_left(B_cum, rest)+i) + +print(ans)" +p02623,s865158584,Wrong Answer,"n, m, k = (int(x) for x in input().split()) + +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] + +K = k +ans = 0 + +i = 0 +while K-a[i]>=0: + K -= a[i] + i += 1 + if i==n: + break +ans = i + +# K = k +for j in range(i-1, -1, -1): + l = 0 + while K-b[l]>=0: + K -= b[l] + l += 1 + if l==m: + break + ans = max(ans, j+l+1) + K += a[j] + + +print(ans)" +p02623,s503194982,Wrong Answer,"import bisect +N,M,K= map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +dpA = [0]*(N+1) +dpB = [0]*(M+1) + +for i in range(1,N+1): + dpA[i] = dpA[i-1] + A[i-1] + +for i in range(1,M+1): + dpB[i] = dpB[i-1] + B[i-1] + +ans = 0 +for i in range(1,N+1): + if dpA[i] > K: + continue + indexB = bisect.bisect_right(dpB, K - dpA[i]) + ans = max(ans, i + indexB - 1) + +print(ans)" +p02623,s231443566,Wrong Answer,"import sys +n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +for i in range(1,n): + a[i] += a[i-1] +for i in range(1,m): + b[i] += b[i-1] + +ans = 0 +for i in range(n, 0, -1): + p = 0 + q = 0 + if a[i-1] <= k: + p = a[i-1] + q = i + for j in range(m, 0, -1): + if p + b[j-1] <= k: + ans = max(ans, q + j) + +print(ans)" +p02623,s344113025,Wrong Answer,"import bisect + +N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +arui = [0] * (N + 1) +brui = [0] * (M + 1) +for i in range(N): + arui[i + 1] = a[i] + arui[i] +for i in range(M): + brui[i + 1] = b[i] + brui[i] + +ans = 0 +for i in range(1, N + 1): + if arui[i] > K: + break + bcnt = M + while brui[bcnt] + arui[i] > K: + bcnt -= 1 + ans = max(ans, i + bcnt) + +print(ans)" +p02623,s613190042,Wrong Answer,"n , m , k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +counter = 0 + +while k >= 0: + if len(a) == 0 and len(b) == 0: + break + elif len(a) == 0: + k -= b.pop(0) + elif len(b) == 0: + k -= a.pop(0) + else: + if a[0] > b[0]: + k -= b.pop(0) + else: + k -= a.pop(0) + counter += 1 +if k < 0: + counter -= 1 +print(counter) + " +p02623,s415063266,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +i = 0 +for s in range(n+m): + if i>k: + if a[0]>=b[0]: + i = i + a[0] + del a[0] + else: + i = i + b[0] + del a[0] + else: + print(s) +" +p02623,s169042204,Wrong Answer,"n,m,k = map(int, input().split()) +ln_a = list( map(int, input().split())) +ln_b = list( map(int, input().split())) +total = 10**9 +output = 0 +for i in range(1,len(ln_a) + len(ln_b) +1): + for j in range(i +1): + total = min(total, sum(ln_a[:j]) + sum(ln_a[:i-j] )) + if total <= k: + output = i + total = 10**9 +print(output) + " +p02623,s936627732,Wrong Answer,"import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +for i in range(1,n): + a[i] += a[i-1] +for i in range(1,m): + b[i] += b[i-1] +ans = 0 +for i in range(n): + if a[i] < k: + ans = max(ans,i+1 + bisect.bisect_left(b,k-a[i])) +print(ans)" +p02623,s590134927,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +i = 0 +for s in range(n+m): + if i>k: + if a[0]>=b[0]: + i = i + a[0] + del a[0] + else: + i = i + b[0] + del a[0] + elif i==k: + print(s+1) + else: + print(s)" +p02623,s461063118,Wrong Answer,"n, m, k = map(int, input().split()) +a_list = list(map(int, input().split())) +b_list = list(map(int, input().split())) +max = 10 ** 9 + 1 +time = 0 +ans = 0 +a = 0 +b = 0 + +for i in range(n + m): + if a_list[a] < b_list[b]: + time += a_list[a] + a += 1 + else: + time += b_list[b] + b += 1 + + if time > k: + break + else: + ans += 1 + + if a >= n: + a_list.append(max) + if b >= m: + b_list.append(max) + +print(ans) +" +p02623,s213138610,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +A.insert(0,0) +cntB=0 +cnt_list=[] + +for i in range(n+1): + timeA=sum(A[:i+1]) + cntA=i + time=timeA + if timeA>k: + break + for j in range(m): + if time+B[j]<=k: + timeB=sum(B[:j+1]) + time=timeA+timeB + cntB=j+1 + else: + break + cnt=cntA+cntB + cnt_list.append(cnt) + +print(max(cnt_list))" +p02623,s530071192,Wrong Answer,"import numpy as np +import sys +input = sys.stdin.buffer.readline + +N, M, K = map(int, input().split()) +cumA = np.zeros(N+1, dtype=np.int32) +cumA[1:] = np.array(input().split(), dtype=np.int32).cumsum() +cumB = np.zeros(M+1, dtype=np.int32) +cumB[1:] = np.array(input().split(), dtype=np.int32).cumsum() +# print(cumA) +# print(cumB) + +ans = 0 +for i in range(N, -1, -1): + if cumA[i] > K: continue + j = np.searchsorted(cumB, K-cumA[i], side='right') + ans = max(ans, i+j-1) +print(ans)" +p02623,s612642327,Wrong Answer,"from sys import stdin +An, Bn, t = [int(x) for x in stdin.readline().rstrip().split()] + +A = [int(x) for x in stdin.readline().rstrip().split()] +B = [int(x) for x in stdin.readline().rstrip().split()] + + +idxA = 0 +idxB = 0 + +cnt = 0 + +for i in range(An + Bn): + if t < 0 : break + + if An > i : + t -= A[idxA] + if t < 0 : break + cnt += 1 + idxA += 1 + + if Bn > i : + t -= B[idxB] + if t < 0 : break + cnt += 1 + idxB += 1 +print(cnt) + +" +p02623,s969903496,Wrong Answer,"N,M,K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(10**9+7) +B.append(10**9+7) +ans = 0 + +while True: + if A[0] > B[0]: + K = K- B[0] + B = B[1:] + ans +=1 + else: + K = K-A[0] + A = A[1:] + ans +=1 + if K <0: + break +print(ans-1)" +p02623,s704297233,Wrong Answer,"N,M,K = input().split() +A = input().split() +B = input().split() + +cnt = 0 + +list = A + B +list = [int(s) for s in list] +list.sort() +ans = min(list) + +min = int(int(K)/int(min(list))) +for s in range(len(list)): + if ans <= int(K): + cnt += 1 + ans += list[s] + +print(cnt) +" +p02623,s377251562,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(K + 1) +B.append(K + 1) +ia, ib = 0, 0 +time = 0 +flag = True +while flag: + flag = False + if A[ia] <= B[ib] and time + A[ia] <= K: + time += A[ia] + ia += 1 + flag = True + if B[ib] < A[ia] and time + B[ib] <= K: + time += B[ib] + ib += 1 + flag = True +print(ia + ib)" +p02623,s087462034,Wrong Answer,"from bisect import bisect + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +R_B = [0]*(M+1) +i = 0 +while i < M: + R_B[i+1] = R_B[i]+B[i] + i += 1 +ans = 0 +i = 0 +while i < N and K >= A[i]: + K -= A[i] + idx = bisect(R_B, K) + ans = max(ans, i+idx) + R_B = R_B[:idx+1] + i += 1 +print(ans) + +" +p02623,s044904212,Wrong Answer,"N, M, K = map(int, input().split()) +pa = abs(N-M) + 1 +A = list(map(int, input().split()))+ [1000000010] +B = list(map(int, input().split()))+ [1000000010] +if N < M: + A = A + [1000000010]*(pa) +elif N > M: + B = B + [1000000010]*(pa) +c = 0 +while K >= A[0] or K >= B[0]: + if A[0] < B[0]: + K -= A.pop(0) + else: + K -= B.pop(0) + c += 1 +print(c)" +p02623,s675770614,Wrong Answer,"from sys import stdin +input = lambda: stdin.readline().rstrip(""\r\n"") +from collections import defaultdict as vector, deque as que +read = lambda: list(map(int,input().split())) +from bisect import bisect +from heapq import heappush as hpush,heappop as hpop + +n,m,k=read() +A=read() +B=read() +a,b=[0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +ans=0 +for i in range(1,n+1): + curr=a[i] + j=m + if curr>k: + break + while(b[j]>k-curr): + j-=1 + ans=max(ans,i+j) +print(ans) + +" +p02623,s204757460,Wrong Answer,"n, m, k = map(int, input().split(' ')) +a_list = list(map(int, input().split(' '))) +b_list = list(map(int, input().split(' '))) +a_sum = 0 +b_sum = sum(b_list) + +j = len(b_list)-1 +best=0 +for i, a in enumerate(a_list): + a_sum+=a + while ((a_sum + b_sum) > k) & (j>=0): + b_sum-=b_list[j] + j-=1 + if (a_sum + b_sum) <= k: + if i+j+2 > best: + best=i+j+2 + + +print(best)" +p02623,s845795697,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +for i in range(1,n): + a[i] += a[i-1] +for i in range(1,m): + b[i] += b[i-1] +ans = -100 +for i in range(n): + if(a[i]>k): + break + for j in range(1,m): + if(a[i]+b[(-1)*j]>k): + break + ans = max(ans,i+j+1) +print(ans) +" +p02623,s214242063,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +mix = sorted(A + B) +temp_sum = 0 +goal = 0 +for i in range(len(mix)): + temp_sum += mix[i] + goal = i + if temp_sum > K: + print(i) + exit() +print(goal + 1)" +p02623,s567588392,Wrong Answer,"import bisect + +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A_cum = [0] +B_cum = [0] + +for i in range(n): + A_cum.append(A_cum[i]+A[i]) + +for i in range(m): + B_cum.append(B_cum[i]+B[i]) + +ans = 0 +for i in range(n+1): + rest = k-A_cum[i] + if rest<=0: + continue + + ans = max(ans, bisect.bisect_right(B_cum, rest)-1+i) + +print(ans)" +p02623,s156799645,Wrong Answer,"def main(): + M, N, K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + spent_time = 0 + count = 0 + AB = A + B + AB.sort() + + while(True): + if count == M + N: + break + temp = AB[count] + if spent_time + temp > K: + break + spent_time = spent_time + temp + count += 1 + print(count) + +main() +" +p02623,s759301428,Wrong Answer,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +AB = A + B +AB.sort() + +x = 0 +for i in range(N + M): + if AB[i] <= K: + x = x + 1 + K = K - AB[i] + if K <= 0: + break + +print(x) +" +p02623,s377996492,Wrong Answer,"import itertools +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +sa = list(itertools.accumulate(a)) +sb = list(itertools.accumulate(b)) + +max = 0 + +for i in range(1, n + 1): + for j in range(1, m + 1): + if (sa[i] + sb[j] <= k): + if i + j > max: + max = i + j + else: + break +print(max)" +p02623,s078421475,Wrong Answer,"n, m, k = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) +SA, SB = [0], [0] +for i in range(n): + SA.append(SA[i] + A[i]) +for j in range(m): + SB.append(SB[j] + B[j]) +ans, tmp = 0, m +for i in range(n + 1): + if SA[i] > k: + break + for j in range(tmp, 0, -1): + if SA[i] + SB[j] <= k: + ans = max(ans, i + j) + break + tmp = j +print(ans) +" +p02623,s674195428,Wrong Answer,"n,m,k = map(int,input().split()) + +a = list(map(int,input().split())) + +b = list(map(int,input().split())) + + +c = [0] +d = 0 +for i in range(n): + d += a[i] + c.append(d) + +e = [0] +f = 0 +for i in range(m): + f += b[i] + e.append(f) + + +ans = 0 +j = m +for i in range(n): + if c[i] > k: + break + else: + while c[i] + e[j] > k: + j -= 1 + ans = max(i + j,ans) + +print(ans)" +p02623,s209897283,Wrong Answer,"from collections import deque +n,m,k=map(int,input().split()) +a=deque(list(map(int,input().split()))) +b=deque(list(map(int,input().split()))) +cost=0 +ans=0 +while (a and cost+a[0]<=k) or (b and cost+b[0]<=k): + if a and b: + if a[0]0 and len(B)>0: + if A[-1] > B[-1]: + K -= B.pop() + else: + K -= A.pop() + elif len(A)>0: + K-=A.pop() + elif len(B)>0: + K-=B.pop() + if(K<0): + break + cnt += 1 +print(cnt)" +p02623,s538040345,Wrong Answer,"# ABC C-Tsundoku +n,m,k = map(int,input().split()) +an = list(map(int,input().split())) +bn = list(map(int,input().split())) + +suma = [0] +sumb = [0] +a = 0 +b = 0 +for i in an: + a += i + suma.append(a) +for i in bn: + b += i + sumb.append(b) + +res = [0] +for j in range(n+1): + if k-suma[j] < 0: + break + for l in range(m+1): + if k-suma[j]-sumb[l] < 0: + res.append(j+l-1) + break +print(max(res))" +p02623,s300144228,Wrong Answer,"from itertools import accumulate +import bisect +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a=list(accumulate(A)) +b=list(accumulate(B)) +diff=2*10**9 +count=0 +for i in range(N): + j=bisect.bisect_right(b,K-a[i])-1 + if 0<=K-(a[i]+b[j])<=diff: + diff=K-(a[i]+b[j]) + count=max(count,(i+1)+(j+1)) +print(count)" +p02623,s782672009,Wrong Answer,"x = input().split() +y = input().split() +z = input().split() +s = 0 + +for nn in range(400000): + if int(x[2]) < 0: + break + if int(y[0]) <= int(z[0]) : + x[2] = int(x[2]) - int(y[0]) + del y[0] + y.append(1000000001) + s += 1 + else: + x[2] = int(x[2]) - int(z[0]) + del z[0] + z.append(1000000001) + s += 1 +print(s-1)" +p02623,s155411096,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a.extend(b) +ab = sorted(a) + +book = 0 +time = 0 +for i in ab: + time += i + if time > k: + print(book) + exit() + elif time == k: + book += 1 + print(book) + exit() + else: + book += 1" +p02623,s455111346,Wrong Answer,"from itertools import accumulate + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +As = list(accumulate(A)) +Bs = list(accumulate(B)) + +ans = 0 +if Bs[M-1] <= K: + ans = max(ans, M) +idx = M-1 +for i in range(N): + while idx != -1 and As[i] + Bs[idx] > K: + idx -= 1 + num = i + idx + 2 + if As[i] > K: + num = 0 + ans = max(ans, num) + +print(ans)" +p02623,s026485281,Wrong Answer,"N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +ans = 0 + +while K >= 0: + if len(A) > 0 & len(B) > 0: + if A[0] <= B[0]: + k = A.pop(0) + else: + k = B.pop(0) + elif A: + k = A.pop(0) + elif B: + k = B.pop(0) + else: + break + K -= k + if K >= 0: + ans += 1 + +print(ans) + +" +p02623,s516040024,Wrong Answer,"from collections import deque + +n,m,k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A,B = deque(A),deque(B) +count = 0 +a = A.popleft() +b = B.popleft() +while k>=a or k>=b: + if a k: break + else: + cnt += nxt + ans += 1 +print(ans)" +p02623,s659893906,Wrong Answer,"n, m, k = map(int, input().split()) + +l1 = list(map(int, input().split())) +l2 = list(map(int, input().split())) + +l = l1 + l2 +l.sort() + +tmp = 0 +ans = 0 +if l[0] <= k: + ans += 1 +for i in range(1, n + m): + l[i] += l[i-1] + if l[i] <= k: + ans += 1 + +print(ans) +" +p02623,s509508239,Wrong Answer,"N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +min = 0 +cnt = 0 +for i,k in enumerate(b): + min += k +j = i +for i in range(N): + while(j > 0 and min > K): + j -= 1 + min -= b[j] + if(min > K): + break + cnt = max(cnt, i + j) + if(i == N): + break + min += a[i] +print(cnt) +" +p02623,s830173061,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +i=0 +j=0 +t=0 +A.append(1000000001) +B.append(1000000001) +while t < K: + if A[i]>=B[j] and t+B[j]<=K: + t+=B[j] + j+=1 + elif A[i] k: + break + + times += i + book_num += 1 + +print(book_num) +" +p02623,s746250317,Wrong Answer,"import sys +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +C=A+B +d=0 +C.sort() +if sum(C)<=K : + print(len(C)) + sys.exit() +for i in range(len(C)) : + d=d+C[i] + if d>K : + print(i+1) + sys.exit()" +p02623,s371743773,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +print(a) +print(b) +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s073327836,Wrong Answer,"N, M, K = map(int, input().split()) +A_N = list(map(int, input().split())) +B_M = list(map(int, input().split())) + +A_ind = 0 +B_ind = 0 +count = K +ans = 0 + +for i in range(N+M): + if A_N[0] < B_M[0]: + if count >= A_N[0]: + count -= A_N.pop(0) + ans += 1 + if len(A_N) == 0: + A_N.append(1000000001) + else: + if count >= B_M[0]: + count -= B_M.pop(0) + ans += 1 + if len(B_M) == 0: + B_M.append(1000000001) + +print(ans)" +p02623,s689188944,Wrong Answer,"a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = list(map(int, input().split())) +count = 0 +sort_array = b + c +sort_array.sort() + +num = a[2] + +print(sort_array) +for i in range(0,len(sort_array)): + num -= sort_array[i] + if num >= 0: + count += 1 + + +print(count) +" +p02623,s263931467,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +b_sum = sum(B) +for i in range(M - 1, -1, -1): + b_sum -= B[i] + if b_sum <= K: + j = i + break +else: + j = -1 +result = j + 1 + +a_sum = 0 +for i in range(N): + a_sum += A[i] + if a_sum > K: + break + while a_sum + b_sum > K: + b_sum -= B[j] + j -= 1 + result = max(result, (i + 1) + (j + 1)) +print(result) +" +p02623,s941278589,Wrong Answer,"import bisect +N,M,K = map(int, input().split()) +A= list(map(int, input().split())) +B = list(map(int, input().split())) +for i in range(1,len(A)): + A[i]+=A[i-1] +for i in range(1,len(B)): + B[i]+=B[i-1] + +honn=bisect.bisect(B,K) +print(honn) +for i in range(len(A)): + s=K-A[i] + if s>=0: + + a=bisect.bisect(B,s) + #print(s) + if i+1+a>honn: + honn=i+1+a +print(honn)" +p02623,s175626318,Wrong Answer,"from bisect import bisect +from itertools import accumulate +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a = list(accumulate(a)) +b = list(accumulate(b)) +ans = 0 +for i in range(n): + if a[i] > k: + break + ans = max(ans, i+1+bisect(b, k-a[i])) +print(ans)" +p02623,s140088808,Wrong Answer,"from collections import deque + +N, M, K = map(int, input().split()) +A = deque(map(int, input().split())) +B = deque(map(int, input().split())) + +time = 0 +count = 0 +while A or B: + if A and B: + desk = A if A[0] < B[0] else B + else: + desk = A if A else B + time += desk.popleft() + + if time > K: + break + else: + count += 1 + +print(count) +" +p02623,s272458128,Wrong Answer,"import itertools + + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + + +accA = list(itertools.accumulate(a)) +accB = list(itertools.accumulate(b)) + + +cnt = 0 +ans = 0 +for i in range(len(accA)): + for j in range(len(accB)): + if k >= accA[i]+accB[j]: + cnt = i+j + + ans = max(cnt, ans) + + +print(ans)" +p02623,s611247537,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +ac = 0 +bc = 0 +ans = 0 +t = 0 +while t b[bc]: + t += b[bc] + bc +=1 + else: + t+= a[ac] + ac+=1 + elif ac >= n and bc<=m-1: + t += b[bc] + bc +=1 + print(t) + elif bc == m and ac<=n-1: + t+= a[ac] + ac+=1 + else: + break + ans+=1 + +print(ans)" +p02623,s434455870,Wrong Answer,"alen,blen,k = map(int,input().split()) +alist = list(map(int,input().split())) +blist = list(map(int,input().split())) +max = 0 + +for acount in range(0,alen): + bcount = 0 + asum = sum(alist[:acount]) + while asum + sum(blist[:bcount+1]) < k and bcount <= blen: + bcount += 1 + if acount + bcount > max and asum + sum(blist[:bcount])<=k: + max = acount + bcount + +print(max) +" +p02623,s136911786,Wrong Answer,"N,M,K = map(int, input().split()) +A = map(int, input().split()) +B = map(int, input().split()) + +sa = {-1: 0} +for i, val in enumerate(A): + sa[i] = sa[i-1] + val + +sb = {-1: 0} +for i, val in enumerate(B): + sb[i] = sb[i-1] + val + +max_num = 0 + +for i in range(N): + for j in range(M): + if(sa[i]+sb[j]<=K): + max_num = max(max_num,i+j+2) + + +print(max_num)" +p02623,s188615858,Wrong Answer,"N,M,K=map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A+=[10**10] +B+=[10**10] +a,b = 0,0 +while K >= A[a] or K >= B[b] : + if A[a]>B[b]: + K -= B[b] + b+=1 + else: + K -= A[a] + a+=1 + #print(a,b) + +print(a+b)" +p02623,s856439860,Wrong Answer,"from collections import deque +N,M,K = map(int,input().split()) +A = deque(map(int,input().split())) +B = deque(map(int,input().split())) +ans = 0 +time = 0 + +while len(A) > 0 or len(B) > 0: + if len(A) == 0: + time += B.popleft() + elif len(B) == 0: + time += A.popleft() + elif A[0] < B[0]: + time += A.popleft() + else: + time += B.popleft() + if time > K: + break + ans += 1 + +print(ans) +" +p02623,s628689299,Wrong Answer,"a = input().split() +a = [int(a)for a in a] +lis = [] + +b = input().split() +b = [int(b)for b in b] +c = input().split() +c = [int(c)for c in c] + +for i in b: + lis.append(i) + +for i in c: + lis.append(i) + +lis.sort() + +count = 0 +time = a[2] +honn = 0 + +while time >= lis[count] and count <= len(lis)-1 : + time = time - lis[count] + + if count >= len(lis)-1 : + honn += 1 + + break + + else: + count += 1 + honn += 1 + +print(honn) +" +p02623,s529183628,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +c=a+b +c.sort() +i=0 +sum=0 +flag=0 +while i<(n+m): + sum=sum+c[i] + i=i+1 + if sum<=k: + flag=flag+1 + else: + break +print(flag) + +" +p02623,s718991462,Wrong Answer,"N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +A = [0] +B = [0] +for i in range(N): + A.append(A[i] + a[i]) +for i in range(M): + B.append(B[i] + b[i]) + +ans = 0 +j = M +for n in range(N + 1): + while True: + time = A[n] + B[j] + if time <= K or j == 0: + ans = max(ans, n + j) + break + else: + j -= 1 +print(ans)" +p02623,s700658290,Wrong Answer,"import bisect +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +A=[0] +B=[0] +for i in range(n): + A.append(A[-1]+a[i]) +for i in range(m): + B.append(B[-1]+b[i]) +ans=0 +for i in range(n+1): + index=bisect.bisect_right(B,k-A[i])-1 + index=max(0,index) + ans=max(ans,i+index) +print(ans) +" +p02623,s202702856,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +sum = [] +a,b = [0],[0] +ans = 0 + +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +for i in range(N+M+1): + tmp = 0 + for j in range(i): + if a[j]+b[i-j] < K: + tmp = i + ans = max(ans,tmp) + break + if tmp ==0: + break + +print(ans)" +p02623,s874339850,Wrong Answer,"import math +import time +from collections import defaultdict, deque +from sys import stdin, stdout +from bisect import bisect_left, bisect_right,bisect +n,m,k=map(int,stdin.readline().split()) +a=list(map(int,stdin.readline().split())) +b=list(map(int,stdin.readline().split())) +prea=[] +ans=0 +for i in a: + ans+=i + prea.append(ans) +final=0 +temp=0 +for i in range(m): + temp+=b[i] + if(temp>k): + break + temp2=bisect(prea,k-temp) + final=max(final,temp2+i+1) +print(final)" +p02623,s677906327,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +time = 0 +ares = 0 +bres = 0 +bsatu = int() +time2 = 0 +res = [] +for i in range(0,n): #Aで最高何冊読めるか + if sum(a[n-i:]) < k and k <= sum(a[n-i-1:]): + ares = i +for i in range(0,ares+1): #0からaresまで + asatu = ares - i + bsatu = 0 + time2 = sum(a[n-asatu:]) + bsatu += i + if time >= k: + break + res += [asatu + bsatu] +print(max(res)) + +" +p02623,s556987640,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +k=0 +ans=0 +a=0 +b=0 +for i in range(N+M+1): + if a==N and b==M: + break + elif a==N: + k+=B[b] + b+=1 + elif b==M: + k+=A[a] + a+=1 + else: + if A[a]>=B[b]: + k+=B[b] + b+=1 + else: + k+=A[a] + a+=1 + if k<=K: + ans+=1 + else: + break +print(ans) +" +p02623,s425492567,Wrong Answer,"n,m,k=map(int,input().split()) +a=sorted(map(int,input().split())) +b=sorted(map(int,input().split()))[::-1] +x=sum(a) +z=n +ans=0 +while a and x>k: + c=a.pop() + x-=c + z-=1 + if x>k:continue + ans=max(ans,z) +while a: + while b and b[-1]+x<=k: + c=b.pop() + x+=c + z+=1 + ans=max(ans,z) + c=a.pop() + x-=c + z-=1 + if x>k:continue + ans=max(ans,z) +print(ans) +" +p02623,s174877624,Wrong Answer,"N, M, K = [int(_) for _ in input().split()] +A = [int(_) for _ in input().split()] +B = [int(_) for _ in input().split()] + +v = 0 +ans = 0 +for i in range(N): + if v + A[i] <= K: + v += A[i] + else: + mi = i-1 + break +else: + mi = N-1 + +for j in range(M): + while mi > -1 and v + B[j] > K: + v -= A[mi] + mi -= 1 + v += B[j] + if v <= K: + ans = max(ans, mi+1+ j+1) + +print(ans) +" +p02623,s291851706,Wrong Answer,"import numpy as np +from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a = np.cumsum(a) +b = np.cumsum(b) + +ans = 0 +for a_num, time in enumerate(a): + if time > k: + continue + b_num = bisect_right(b, k - time) + num = a_num + b_num + 1 + if num > ans: + ans = num +print(ans) +" +p02623,s354681563,Wrong Answer,"from itertools import accumulate +from bisect import bisect_left + +n,m,k=map(int,input().split()) +a=list(accumulate([0]+list(map(int,input().split())))) +b=list(accumulate([0]+list(map(int,input().split())))) +#print(b) +mx=0 +for i in range(n+1): + if a[i]>k:continue + #print('a[i];'+str(a[i])) + idx=max(bisect_left(b,k-a[i])-1, 0) + #print(idx) + if a[i]+b[idx]>k:continue + mx=max(mx,i+idx) +print(mx) + " +p02623,s100878282,Wrong Answer,"from collections import deque + +N, M, K = map(int, input().split()) +A = deque(map(int, input().split())) +B = deque(map(int, input().split())) + +count = 0 +for i in range(N + M): + if len(A) == 0: + book = B[0] + B.popleft() + elif len(B) == 0: + book = A[0] + A.popleft() + else: + if A[0] <= B[0]: + book = A[0] + A.popleft() + else: + book = B[0] + B.popleft() + + if K >= book: + count += 1 + K -= book + else: + break + +print(count)" +p02623,s896450551,Wrong Answer,"from queue import deque + +N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +A = deque(A) +B = list(map(int, input().split())) +B = deque(B) + +count = 0 + +while 1: + a = A.popleft() if A else 10**9+1 + b = B.popleft() if B else 10**9+1 + + if min(a, b) <= K: + count += 1 + K -= min(a, b) + if a <= b: + B.appendleft(b) + else: + A.appendleft(a) + else: + break + +print(count) +" +p02623,s381603060,Wrong Answer,"from collections import deque +n,m,k=map(int,input().split()) +a=deque(list(map(int,input().split()))) +b=deque(list(map(int,input().split()))) +cost=0 +ans=0 +while (a and cost+a[0]<=k) or (b and cost+b[0]<=k): + if a and b: + if a[0]K: + break + count+=1 + else: + time+=B[b] + b+=1 + if time>K: + break + count+=1 + +print(count)" +p02623,s436063806,Wrong Answer,"from bisect import bisect_left +n, m, k = map(int, input().split()) +list_A = list(map(int, input().split())) +list_B = list(map(int, input().split())) + +list_AS = [] +list_BS = [] +a = 0 +b = 0 +for i in list_A: + a += i + list_AS.append(a) + +for i in list_B: + b += i + list_BS.append(b) +ans = 0 + +for i in range(n): + j = bisect_left(list_BS, k-list_AS[i]) + if list_AS[i] + list_BS[j-1] <= k: + ans = max(ans, i+j+1) + +print(ans)" +p02623,s124109951,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +a.append(10000000000) +b.append(10000000000) +ans = 0 +t = 0 +a1,b1 = 0,0 +while tk: break + if a[a1] K: + break + cnt += 1 +# print(time,A,B) +print(cnt) +" +p02623,s320126274,Wrong Answer,"##C +N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +##print(A+B) +C = A+B +##print(C) +i = 0 +j = 0 +goukei = 0 +if K >= sum(C): + print(N+M) +else: + A = A+[10**9] + B = B+[10**9] + while goukei <= K: + if A[i] <= B[j]: + goukei += A[i] + i += 1 + else: + goukei += B[j] + j += 1 + print(i+j-1)" +p02623,s474547178,Wrong Answer,"'''ABC172 C''' +import numpy as np +n,m,k = map(int,input().split()) +a = np.array([int(i) for i in input().split()], dtype='int64') +b = np.array([int(i) for i in input().split()], dtype='int64') + +a_c = np.zeros(n+1,dtype='int64') +a_c[1:] = np.cumsum(a) + +b_c = np.zeros(m+1,dtype='int64') +b_c[1:] = np.cumsum(b) + +a_c = a_c[a_c <= k] +b_c = b_c[b_c <= k] +ans = 0 +for i,ai in enumerate(a_c): + n = np.searchsorted(b_c, k - ai, side = 'right') + ans = max(i + n, ans) +print(ans)" +p02623,s476191839,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +at=0 +bt=0 +al=[0]*n +bl=[0]*m +for i in range(n): + at=at+a[i] + al[i]=at +for j in range(m): + bt=bt+b[j] + bl[j]=bt +t=m-1 +ans=0 +i=0 +while iK: + count-=B[M-1] + M-=1 + if i!=N-1: + count+=A[i+1] + a+=A[i+1] + p=max(p,i+M+1) + if a>K: + break +print(p)" +p02623,s411646641,Wrong Answer,"N,M,K=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=[0]+list(map(int,input().split())) + +for i in range(N): + A[i+1]+=A[i] +for i in range(M): + B[i+1]+=B[i] + +idx=N +ans=0 +for i in range(N): + if A[i]>K: + idx=i-1 + break + +idx2=0 +for i in range(idx,-1,-1): + while idx2= B[0]: + L.append(B[0]) + B.pop(0) + else: + L.append(A[0]) + A.pop(0) + +ans = 0 +for i in range(N+M): + ans += L[i] + if ans > K: + print(i) + break + +if ans <= K: + print(N+M)" +p02623,s637645147,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +sumnum = 0 +count = 0 + +B.reverse() +AB = A + B + +while 1: + if len(AB) == 0: + break + + elif AB[0] < AB[-1]: + tmp = sumnum + AB[0] + AB.pop(0) + + else: + tmp = sumnum + AB[-1] + AB.pop(-1) + + if tmp > K: + break + + else: + sumnum = tmp + count = count + 1 + + +print(count) + +" +p02623,s731312362,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +AS=[0] +BS=[0] +r=0 +for i in A: + if i+AS[-1]k: + j-=1 + r=max(r,i+j) +print(r)" +p02623,s183648570,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +temp = [[0] * M] * N + +result = 0 +count = 0 +for i in range(0, len(A)): + temp[i][0] = A[i] + if temp[i][0] <= K: + result = max(result, temp[i][0]) + count = i + 1 + for j in range(1, len(B)): + temp[i][j] = temp[i][j-1] + B[j] + if temp[i][j] <= K: + result = max(result, temp[i][j]) + count = i + j + 2 +print(count) +" +p02623,s028596678,Wrong Answer,"n, m, k = map(int, input().strip().split()) +A = list(map(int, input().strip().split())) +B = list(map(int, input().strip().split())) +i=j=0 + +time=0 +while jk: + time-=B[j] + break + j += 1 +j-=1 +rem=k-time +ans=j+1 +cnt=ans +while j>=0: + while i=0: + rem-=A[i] + i+=1 + cnt+=1 + ans=max(ans,cnt) + + rem+=B[j] + j-=1 + cnt-=1 + +print(ans)" +p02623,s971521337,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.reverse() +B.reverse() + +ans = 0 +total_time = 0 +while A or B: + if not A: + t = B.pop() + elif not B: + t = A.pop() + else: + if A[-1] < B[-1]: + t = A.pop() + else: + t = B.pop() + total_time += t + if total_time <= K: + ans += 1 + else: + break +print(ans)" +p02623,s659205105,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + + +maxNum = 0 +cnt = 0 + + +for i in a: + if k - i > 0: + k -= i + cnt += 1 + else: + break + + for i in b: + if k - i > 0: + k -= i + cnt += 1 + else: + break + + maxNum = max(maxNum, cnt) + + +print(maxNum) + +" +p02623,s945181623,Wrong Answer,"N,M,K = list(map(int,input().split())) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a,b = [0],[0] +for i in range(N): + a.append(a[i]+A[i]) +for j in range(M): + b.append(b[j]+B[j]) +ans = 0 +#print(a,b,N+1) +for i in range(N+1): + if a[i] > K: + break + j = 0 + while K - a[i] >= b[j]: + if j >= M: + break + j = j+1 + j = j-1 + ans = max(ans,i+j) + +print(ans)" +p02623,s074086242,Wrong Answer,"n,m,k=map(int,input().split()) + +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +suma=[] +tmp=0 +for aa in a: + tmp+=aa + suma.append(tmp) + +sumb=[] +tmp=0 +for bb in b: + tmp+=bb + sumb.append(tmp) + +ans=0 + +for i in range(n): + if suma[i]<=k: + for j in range(m): + if suma[i]+sumb[j]<=k: + ans=max(ans,i+j+2) + else: + break +print(ans) + + +" +p02623,s740919022,Wrong Answer,"import numpy as np +n,m,k=map(int,input().split()) +A=[0]+list(map(int, input().split())) +B=[0]+list(map(int, input().split())) +ans=0 +a=np.cumsum(np.array(A)).tolist() +b=np.cumsum(np.array(B)).tolist() +for i in range(n+1): + if kk-a[i]: + j-=1 + ans=max(ans,i+j) +print(ans)" +p02623,s510837979,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +r=0 +t=0 +m_i=0 +n_i=0 +m+=-1 +n+=-1 +for i in range(m+n+2): + #print(n_i) + a_i=a[min(n_i,n)] + b_i=b[min(m_i,m)] + if ((a_i>b_i and m_i <=m) or (n_i > n)): + m_i+=1 + t+=b_i + #m_i=min(m_i,m) + else: + n_i+=1 + t+=a_i + #n_i=min(n_i,n) + if t>k: + break + r+=1 +print(r)" +p02623,s727606175,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 +ans = max(ans, i + j) +print(ans) +" +p02623,s669043515,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +INF=10**12 +A.append(INF) +B.append(INF) +A=A[::-1] +B=B[::-1] +for i in range(N+M+1): + if A[-1]<=B[-1]: + if K b[0]): + c.append(b[0]);b.pop(0);continue + else: + c.append(a[0]);a.pop(0);continue + +tmp = 0 +ans = 0 +for i in c: + tmp += i + if(tmp <= k):ans+=1 + else:print(ans);exit() +print(ans)" +p02623,s306977499,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +na = [] +c = 0 +for booka in a: + c += booka + na.append(c) +nb = [] +d = 0 +for bookb in b: + d += bookb + nb.append(d) +maxa = 0 +for i in range(n-1,-1,-1): + for j in range(m-1,-1,-1): + if na[i] + nb[j] <= k: + maxa = max(maxa,i+j+2) + break +print(maxa)" +p02623,s882991510,Wrong Answer,"M, N, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +time = 0 +ai = 0 +bj = 0 +am = 0 +bm = 0 + +while time < K: + if ai < len(A): + am = A[ai] + else: + am = K + if bj < len(B): + bm = B[bj] + else: + bm = K + + if am < bm: + if (time + am) > K: + break + else: + time += am + ai += 1 + else: + if (time + bm) > K: + break + else: + time += bm + bj += 1 + +print(ai + bj) +" +p02623,s485681618,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +max_num = 0 +j = 0 +j_max = M + 1 +A_sums=[sum(A[:i]) for i in range(N+1)] +B_sums=[sum(B[:i]) for i in range(M+1)] + +for i in range(N + 1): + j = 0 + while j < j_max: + print(i, j) + if A_sums[i] + B_sums[j] > K: + j_max = j + break + + max_num = max(max_num, i + j) + j += 1 +print(max_num) +" +p02623,s506333178,Wrong Answer,"N,M,K = list(map(int,input().split())) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +sumA = [0] * (N+1) +sumB = [0] * (M+1) +for i in range(N): + sumA[i+1] = sumA[i] + A[i] +for i in range(M): + sumB[i+1] = sumB[i] + B[i] + +ans = 0 +import bisect +for i in range(N+1): + idx = bisect.bisect_left(sumB,K-sumA[i]) + ans = max(ans,i + idx - 1) +print(ans)" +p02623,s066199513,Wrong Answer,"from collections import deque +n,m,k=[int(_) for _ in input().split()] +A=deque([int(_) for _ in input().split()]) +B=deque([int(_) for _ in input().split()]) +jikan=0 +yomi=0 +while (A or B): + if A and B: + if A[0] K: + break + k = K - sums + tmp = bisect.bisect_left(B, k) + ans = max(ans, idx + tmp) + +print(ans)" +p02623,s189743518,Wrong Answer,"from itertools import accumulate +import bisect +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +aa=list(accumulate(a)) +b=list(map(int,input().split())) +bb=list(accumulate(b)) +ans=0 +for i in range(n): + if aa[i]>k: + break + tmp=k-aa[i] + t=bisect.bisect(bb,tmp) + if i+1+t>ans: + ans=i+t+1 +print(ans)" +p02623,s504419150,Wrong Answer,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +ar = [0]*N +br = [0]*M +ar[0] = A[0] +br[0] = B[0] + +for i in range(1, N): + ar[i] = ar[i-1]+A[i] +for i in range(1, M): + br[i] = br[i-1]+B[i] + +res = bisect.bisect_right(br, K) + +for i in range(N): + if ar[i] < K: + res = max(i+bisect.bisect_right(br, K-ar[i])+1, res) + +print(res)" +p02623,s936407577,Wrong Answer,"n,m,k=map(int,input().split()) +a=[int(i) for i in input().split()] +b=[int(i) for i in input().split()] +c=[0] +for i in a: + c+=[c[-1]+i] +d=[0] +for i in b: + d+=[d[-1]+i] +ans=j=0 +for i in range(m): + if d[i]>k: + ans=j=i-1 + + +for i in range(n+1): + while c[i]+d[j]>k and c[i]k: + break + while ((a_sum + b_sum) > k) & (j>=0): + b_sum-=b_list[j] + j-=1 + + best = max(best,i+j+2) + + + +print(best)" +p02623,s264883780,Wrong Answer,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +for i in range(1, n): + a[i] += a[i-1] +for i in range(1, m): + b[i] += b[i-1] + +I = bisect.bisect_right(a, k) +ans = 0 +li = list(range(I)) +li = li[::-1] +for i in li: + tmp = bisect.bisect_right(b, k-a[i]) + ans = max(ans, i+tmp+1) + +print(ans)" +p02623,s197060942,Wrong Answer,"N, M, K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +res = 0 +tmp = 0 +A.extend(B) + +for i in range(N + M): + tmp += A[i] + if tmp > K: + break + res += 1 +print(res)" +p02623,s221592572,Wrong Answer,"from collections import deque +N, M, K = map(int, input().split()) + +A = deque([int(i) for i in input().split()]) +B = deque([int(i) for i in input().split()]) +ans = 0 +while True: + a = A[0] if len(A) else float('inf') + b = B[0] if len(B) else float('inf') + if a > b: + if len(B): B.popleft() + K -= b + else: + if len(A): A.popleft() + K -= a + if K < 0: + break + ans += 1 +print(ans)" +p02623,s756029072,Wrong Answer,"N, M, K = map(int,input().split()) +arr = input() +A= list(map(int,arr.split(' '))) +i=0 +la=len(A) +B= list(map(int,arr.split(' '))) +lb=len(B) +for x in range(la): + if(A[x] B[0]: + t += B.pop(0) + else: + t += A.pop(0) + + ret += 1 + if t > K: + ret -= 1 + break + +print(ret) +" +p02623,s181952965,Wrong Answer,"def resolve(): + M, N, K = map(int, input().split()) + a = list(map(int, input().split())) + b = list(map(int, input().split())) + + count = 0 + for m in range(1, M+1): + for n in range(1, N+1): + if (sum(a[:m] + b[:n]) <= K): + count = max(count, m + n) + print(count) + +if __name__ == ""__main__"": + resolve()" +p02623,s223980987,Wrong Answer,"from itertools import accumulate +from bisect import bisect_right + +R = lambda: map(int, input().split()) +*_, k = R() +a = accumulate(R()) +b = list(accumulate(R())) +r = 0 +for i, x in enumerate(a, 1): + if x > k: + break + j = bisect_right(b, k - x) + r = max(r, i + j) +print(r) +" +p02623,s594668190,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A += [10**10] +B += [10**10] + +ans = 0 +T = 0 +a, b = 0, 0 +while True: + if A[a] <= B[b]: + T += A[a] + a += 1 + else: + T += B[b] + b += 1 + if T > K: + break + ans += 1 + +print(ans)" +p02623,s076425324,Wrong Answer,"ni = lambda: int(input()) +nm = lambda: map(int, input().split()) +nl = lambda: list(map(int, input().split())) + +n,m,k=nm() +a=nl() +b=nl() + +sm=0 + +ai=0 +bi=0 + +cnt=0 +for i in range(n+m): + bk = 0 + if ai==n: + bk = b[bi] + bi+=1 + elif bi==m: + bk = a[ai] + ai+=1 + else: + if a[ai] < b[bi]: + bk = a[ai] + ai+=1 + else: + bk = b[bi] + bi+=1 + + if sm+bk > k: + break + sm+=bk + cnt+=1 + +print(cnt)" +p02623,s526334697,Wrong Answer,"# ABC C-Tsundoku +n,m,k = map(int,input().split()) +an = list(map(int,input().split())) +bn = list(map(int,input().split())) + +suma = [0] +sumb = [0] +a = 0 +b = 0 +for i in an: + a += i + suma.append(a) +for i in bn: + b += i + sumb.append(b) + +res = [0] +l = m +for j in range(n+1): + if k-suma[j] < 0: + break + while k-suma[j]-sumb[l] < 0 and l > 0: + l -= 1 + res.append(j+l-1) +print(max(res))" +p02623,s169861181,Wrong Answer,"n,m,k = map(int,input().split()) +a = tuple(map(int,input().split())) +b = tuple(map(int,input().split())) + +t = 0 +i = 0 +j = 0 +while (t <= k): + #print(i,j,t) + if i < n: + ai = a[i] + else: + ai = 10**10 + if j < m: + bi = b[j] + else: + bi = 10**10 + if ai < bi: + i += 1 + t += ai + else: + j += 1 + t += bi +if t <= k: + print(n+m) +else: + print(i+j-1) +#print(t,i,j)" +p02623,s620706746,Wrong Answer,"N,M,K = map(int, input().split()) +A=list(map(int, input().split())) +B=list(map(int, input().split())) +A.append(10**9+1) +B.append(10**9+1) +t=0 +a=0 +while t<=K: + if A[0] < B[0]: + t+=A[0] + if t>K: + print(a) + exit() + A.pop(0) + a+=1 + elif A[0] >= B[0]: + t+=B[0] + if t>K: + print(a) + exit() + B.pop(0) + a+=1 " +p02623,s232017399,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +cnt=0 +T=K+1 +while(K>0): + if(A[0]=read): + K-=read + cnt+=1 + else: + break +print(cnt) + + + + + +" +p02623,s151714811,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +i,j = 0,0 +a.append(k+1) +b.append(k+1) +ans = 0 +flag = 1 +while flag: + if a[i] <= b[j] and a[i] <= k: + k -= a[i] + i += 1 + ans += 1 + elif a[i] > b[j] and b[j] <= k: + k -= b[j] + j += 1 + ans += 1 + else: + flag = 0 +print(ans)" +p02623,s369939922,Wrong Answer,"# -*- coding: utf-8 -*- + + +def main(): + from bisect import bisect + from itertools import accumulate + + import sys + input = sys.stdin.readline + + n, m, k = map(int, input().split()) + a = list(accumulate([0] + list(map(int, input().split())))) + b = list(accumulate([0] + list(map(int, input().split())))) + + i1 = bisect(a, k) - 1 + j1 = bisect(b, max(0, k - a[i1])) - 1 + i2 = bisect(b, k) - 1 + j2 = bisect(a, max(0, k - b[i2])) - 1 + + print(max(i1 + j1, i2 + j2)) + + +if __name__ == '__main__': + main() +" +p02623,s849504747,Wrong Answer,"import bisect +N,M,K=map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +A=[0]*N +A[0]=a[0] +ans=0 +for i in range(N-1): + A[i+1]=A[i]+a[i+1] +B=[0]*M +B[0]=b[0] +for i in range(M-1): + B[i+1]=B[i]+b[i+1] +a=[1,2,2,2,3] +for i in range(N): + if A[i]=a[0] or k>=b[0] : + if a[0]<=b[0]: + k-=a[0] + a.pop(0) + else: + k-=b[0] + b.pop(0) + ans+=1 +print(ans) + +" +p02623,s106766255,Wrong Answer,"N ,M ,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +result = -1 + +A.append(10**10) +B.append(10**10) +i,j = 0,0 +while K >= 0: + K -= min(A[i],B[j]) + if A[i] <= B[j]: + i += 1 + else: + j += 1 + result += 1 +print(result)" +p02623,s135508699,Wrong Answer,"R = lambda: map(int, input().split()) +*_, k = R() +k += 1 +a = R(), R() +x = [next(y) for y in a] +m = min(x) +r = 0 +while m < k: + r += 1 + i = x.index(m) + x[i] = next(a[i], k) + k -= m + m = min(x) +print(r) +" +p02623,s578857014,Wrong Answer,"N, M, K = map(int, input().split()) +As = input().split() +Bs = input().split() + +time = 0 +cnt = 0 +while True: + A, B = int(As[0]) , int(Bs[0]) + if A K: + break + time+=A + del As[0] + if As == []: + As.append(10**10) + else: + if time + B > K: + break + time+=B + del Bs[0] + if Bs == []: + Bs.append(10**10) + cnt+=1 +print(cnt)" +p02623,s441964769,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A.reverse() +B.reverse() + +count = 0 +time = 0 + +while count < K and time < N + M: + try: + if A[-1] <= B[-1]: + count += A.pop() + else: + count += B.pop() + + except: + if A: + count += A.pop() + else: + count += B.pop() + + time += 1 + +if count > K: + time -= 1 + +print(time)" +p02623,s995861100,Wrong Answer,"from collections import deque +N,M,K=list(map(int,input().split())) +a_list = list(map(int,input().split())) +b_list = list(map(int,input().split())) +a = deque(a_list) +b = deque(b_list) + +book = 0 +k = 0 +while len(a) > 0 or len(b) > 0: + if len(a) == 0: + k += b.popleft() + elif len(b) == 0: + k += a.popleft() + elif a[0] K: + break + total += 1 + if i >= len_A and j >= len_B: + break + +print(total)" +p02623,s837260818,Wrong Answer,"n,m,sus = map(int,input().split()); ans,l,r,ct = 0,0,0,0 +A,B = list(map(int,input().split())),list(map(int,input().split())) +while ans < sus: + if min(A[l],B[r]) == A[l]: + if ans + A[l] > sus : break + ans += A[l]; A[l] = 2e10; l = (l+1)%n; ct +=1 + else: + if ans + B[r] > sus : break + ans += B[r]; B[r] = 2e10; r = (r+1)%m; ct += 1 +print(ct)" +p02623,s382375316,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +a.append(10**10) +b.append(10**10) + +i,j,ans=0,0,0 +while k>=0: + if a[i]>b[j]: + k-=b[j] + j+=1 + else: + k-=a[i] + i+=1 + ans+=1 + +print(ans-1) + " +p02623,s447775505,Wrong Answer,"N,M,K = map(int,input().split()) +Ali = list(map(int,input().split())) +Bli = list(map(int,input().split())) + +ans=0 + +if (sum(Ali)+sum(Bli))==K: + print(N+M) + exit() +if (sum(Ali)+sum(Bli))>K: + print(0) + exit() +while K>0 or (Ali!=[] and Bli!=[]) : + + if Ali[0] ans: + ans = (i + 1) + (ind) + +print(ans)" +p02623,s480580241,Wrong Answer,"n, m, k = map(int, input().split()) + +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ans = 0 + + +for i in range(n): + cnt = sum(a[:i + 1]) + if cnt > k: + ans = max(ans, i) + break + for j in range(m): + cnt += b[j] + if cnt > k: + ans = max(ans, i + 1 + j) + break + else: + ans = max(ans, i + j + 2) +print(ans)" +p02623,s054045453,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +a.append(float('inf')) +b.append(float('inf')) +at = 0 +bt = 0 +time = 0 +cnt = 0 + +while time+a[at]<=k or time+b[bt]<=k: + if a[at] <= b[bt]: + time += a[at] + at += 1 + cnt += 1 + elif a[at] > b[bt]: + time += b[bt] + bt += 1 + cnt += 1 + +print(cnt) + + +" +p02623,s253858112,Wrong Answer,"N,M,K=map(int,input().split()) +costA=list(map(int,input().split())) +costB=list(map(int,input().split())) +time=0 +count=0 +cost=sorted(costA+costB) +while time<=K: + time+=cost[0] + count+=1 + del cost[0] + if len(cost)==0: + break +print(count-1)" +p02623,s509943903,Wrong Answer,"from collections import deque +n,m,k = map(int,input().split()) +A=deque(list(map(int,input().split()))) +B=deque(list(map(int,input().split()))) + +cnt=0 + +while k>0: + if len(A)==0: + A.append(9999999999999999999999999999999999) + if len(B)==0: + B.append(9999999999999999999999999999999999) + + if A[0]<=B[0] and A[0]<=k: + k=k-A.popleft() + cnt+=1 + elif A[0]>=B[0] and B[0]<=k: + k=k-B.popleft() + cnt+=1 + else: + break + +print(cnt)" +p02623,s786173212,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +c=0 +import numpy as np +A=np.array(A).cumsum() +B=np.array(B).cumsum() +for i in range(N): + if M!=0: + for j in reversed(range(M)): + if K-A[i]>=B[j]: + if c=0 and c0: + j=bisect.bisect_right(RB,k-a) + r=max(r,i+j-1) + #print(i,k-a,j) +print(r)" +p02623,s926388801,Wrong Answer,"import numpy as np + +N, M, K = list(map(int, input().split())) +As = list(map(int, input().split())) +Bs = list(map(int, input().split())) + +As.append(np.inf) +Bs.append(np.inf) + +count = 0 +while K >= min(As[0], Bs[0]): + if As[0] <= Bs[0]: + t = As.pop(0) + else: + t = Bs.pop(0) + K -= t + count += 1 + +print(count)" +p02623,s147053660,Wrong Answer,"x = input().split() +N = int(x[0]) +M = int(x[1]) +K = int(x[2]) +C =[] +A = input().split() +B = input().split() +A.append(10000000000) +B.append(10000000000) +for i in range(N + M): + if int(A[0]) <= int(B[0]): + C.append(int(A[0])) + del A[0] + else: + C.append(int(B[0])) + del B[0] + +T = 0 +book = 0 +for i in range(len(C)): + if T +C[i] <= K: + T += C[i] + book += 1 + else: + break +print(book)" +p02623,s365181507,Wrong Answer,"l = input() +l = l.split() +n,m,k = l[0], l[1], int(l[2]) +a = input().split() +b = input().split() + +total = a+b +ans = 0 + +for i in range(int(n)+int(m)): + total[i] = int(total[i]) + +total = sorted(total) + +for i in total: + if k - i >= 0: + ans += 1 + else: + break + +print(ans) +" +p02623,s131054861,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a.extend(b) + +time = 0 +count = 0 +if a[0] > k: + print(count) +else: + for x in a: + if time > k: + break + time += x + count += 1 + print(count)" +p02623,s334209521,Wrong Answer,"a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = list(map(int, input().split())) +count = 0 +sort_array = b + c +sort_array.sort() + +num = a[2] + +#print(sort_array) +for i in range(0,len(sort_array)): + if num >= sort_array[i]: + num -= sort_array[i] + if num >= 0: + count += 1 + + +print(count)" +p02623,s614639432,Wrong Answer,"import bisect +from collections import deque + +n,m,k = map(int, input().split()) +a = deque(map(int, input().split())) +b = deque(map(int, input().split())) + +x = deque() +x.append(0) +for i in range(n + m): + num = 0 + if len(a) == 0: + num = b.popleft() + elif len(b) == 0: + num = a.popleft() + elif a[0] <= b[0]: + num = a.popleft() + else: + num = b.popleft() + x.append(num + x[-1]) + +x.popleft() + +pos = bisect.bisect_right(x, k) +print(pos) +" +p02623,s993339756,Wrong Answer,"n, m, k = map(int, input().split(' ')) +a_list = list(map(int, input().split(' '))) +b_list = list(map(int, input().split(' '))) +sa = [0] * (n+1) +sb = [0] * (m+1) + +for i in range(n): + sa[i+1] = a_list[i] + sa[i] +for j in range(m): + sb[j+1] = b_list[j] + sb[j] + +best=0 +r = m +for a in a_list: + if a>k: + break + while ((a + sb[r]) > k) & (r>=0): + r-=1 + + best = max(best,i+j+2) + + + +print(best)" +p02623,s853622893,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a, b = [0], [0] +for i in range(0, N): + a.append(a[i] + A[i]) +for j in range(0, M): + b.append(b[j] + B[j]) + +ans = 0 +j = M +for i in range(0, N): + if a[i] > K: + break + while b[j] > K - a[i]: + j = j -1 + ans = max(ans, i+j) + +print(ans)" +p02623,s286904991,Wrong Answer,"import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +N, M, K = map(int, readline().split()) +A = list(map(int, readline().split())) +B = list(map(int, readline().split())) + +INF = 1 << 60 +A.append(INF) +B.append(INF) + +p, q = 0, 0 +while True: + if A[p] > B[q]: + A, B = B, A + p, q = q, p + x = A[p] + p += 1 + if K >= x: + K -= x + else: + break + +print(p + q - 1)" +p02623,s888910687,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +time=0 +a,b=0,0 + +if K>=sum(A)+sum(B): + print(N+M) +else: + A.append(1000000000000000) + B.append(1000000000000000) + while time<=K: + if A[a]<=B[b]: + time+=A[a] + #print(f""A{A[a]}"") + a+=1 + else: + time+=B[b] + #print(f""B{B[b]}"") + b+=1 + print(a+b-1)" +p02623,s656378825,Wrong Answer,"import numpy as np +n,m,k = map(int,input().split()) +a = np.array([int(i) for i in input().split()], dtype='int64') +b = np.array([int(i) for i in input().split()], dtype='int64') + +a_c = np.cumsum(a) +b_c = np.cumsum(b) + +a_c = a_c[a_c <= k] +b_c = b_c[b_c <= k] +ans = 0 +for i,ai in enumerate(a_c): + n = np.searchsorted(b_c, k - ai, side = 'right') + ans = max(i+1 + n, ans) + +print(ans)" +p02623,s863107289,Wrong Answer,"import sys +sys.setrecursionlimit(10**6) +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(99999) +B.append(99999) +Sum = 0 +i = 0 +j = 0 +while Sum < K: + if A[i] <= B[j]: + Sum += A[i] + i += 1 + else: + Sum += B[j] + j += 1 +if Sum >= 1000000000: + print(0) +else: + print(i + j)" +p02623,s953553294,Wrong Answer,"n=list(map(int,input().split())) +m=list(map(int,input().split())) +t=list(map(int,input().split())) + +li=m+t +i=0 +count=0 + +while i< len(li): + if li[i] + count <= n[2]: + count +=1 + i+=1 + + + +print(count) + + +" +p02623,s016638997,Wrong Answer,"n,m,k = map(int, input().split()) +a_list = list(map(int, input().split())) +b_list = list(map(int, input().split())) + + +count=0 +count_min=0 +value=0 +for item in a_list : + value+=item + count+=1 + current=count + + cure_value=value + for item2 in b_list : + if cure_value+item2<=k : + current+=1 + cure_value+=item2 + count_min=max(count_min,current) + + +print(count_min) +" +p02623,s558967346,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +import numpy as np +A = [0] + A +B = [0] + B +AA = np.cumsum(A) +BB = np.cumsum(B) + +ans = 0 +jmax = M +for i in range(1, N+1): + a = AA[i] + for j in range(jmax, 0, -1): + b = BB[j] + if a + b <= K: + ans = max(ans, i+j) + break + jmax = j +print(ans)" +p02623,s665204836,Wrong Answer,"def hoge(): + N,M,K = map(int,input().split()) + A = list(map(int,input().split())) + B = list(map(int,input().split())) + + A = [10**10]+A[::-1] + B = [10**10]+B[::-1] + + a = 0 + while True: + if A[-1] < B[-1] and K >= A[-1]: + a += 1 + K -= A.pop() + if K >= B[-1]: + a += 1 + K -= B.pop() + else: + return a + +print(hoge())" +p02623,s936919480,Wrong Answer,"import bisect +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +waa=[0 for i in range(n)] +waa[0]=a[0] +wab=[0 for i in range(m)] +wab[0]=b[0] +for i in range(1,n): + waa[i]=waa[i-1]+a[i] +for i in range(1,m): + wab[i]=wab[i-1]+b[i] + +ans=0 +for i in range(n): + if waa[i]>k: + break + idx=bisect.bisect_left(wab,k-waa[i]) + if idx K: + num = i + break + mnt += a +A = A[:num] +ans = num + +j = 0 +for i in range(num): + while j < M and mnt+B[j] <= K: + mnt += B[j] + j += 1 + ans = max(ans, j+num-i) + mnt -= A[num-i-1] +print(ans)" +p02623,s929599006,Wrong Answer,"a = [input() for l in range(0,3)] +a1 = [int(p) for p in a[0].split()] +a2 = [int(p) for p in a[1].split()] +a3 = [int(p) for p in a[2].split()] +a4 = a2 + a3 +b = sorted(a4) +c = 0 +for i in range(0,len(b)): + c = c + b[i] +if c <= a1[2]: + print(len(b)) +else: + s = 0 + t = 0 + while s <= a1[2] and t < len(b): + s = s + b[t] + t = t + 1 + print(t-1)" +p02623,s069637238,Wrong Answer,"import numpy as np +N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +A_np = np.array(A) +B_np = np.array(B) + +C_np = np.append(A_np,B_np) +C_np = np.sort(C_np) + +x = 0 +y = 0 +for i in range(len(C_np)): + if K >= x + C_np[i]: + x += C_np[i] + y += 1 + else: + break +print(x)" +p02623,s371458184,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(K + 1) +B.append(K + 1) +ia, ib = 0, 0 +time = 0 +flag = True +while flag: + flag = False + if A[ia] <= B[ib] and time + A[ia] <= K: + time += A[ia] + ia += 1 + flag = True + elif B[ib] < A[ia] and time + B[ib] <= K: + time += B[ib] + ib += 1 + flag = True +print(ia + ib)" +p02623,s686839613,Wrong Answer,"N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +C = A+B +C.sort() + +ans = 0 +count = 0 +for c in C: + ans += c + if ans <= K: + count += 1 + else: + break + +print(count) + + +" +p02623,s014671176,Wrong Answer,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +x = min(m,n) +i = j = 0 +ans = 0 +while i < n and j < m: + if A[i] < B[j]: + k -= A[i] + i += 1 + else: k -= B[j]; j += 1 + if k > 0: ans += 1 +if i < n: + for q in range(i,n): + k -= A[q] + if k >= 0: ans += 1 + else: print(ans);exit() +elif j < m: + for q in range(j,m): + k -= B[q] + if k >= 0: ans += 1 + else: print(ans); exit() +print(ans) + + +" +p02623,s402377910,Wrong Answer," +import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +a.append(float(""INF"")) +b.append(float(""INF"")) +la = [a[0]] +lb = [b[0]] +for i in range(1,n): + la.append(la[-1]+a[i]) +for i in range(1,m): + lb.append(lb[-1]+b[i]) +ans = 0 +for i in range(n): + if la[i] > k: + break + x = k-la[i] + + count = i+1 + ind = bisect.bisect_right(lb,x) + count += ind + ans = max(ans,count) +print(ans) +" +p02623,s320025308,Wrong Answer,"n, m, k = map(int, input().split()) +a = [int(x) for x in input().split()] +b = [0]+[int(x) for x in input().split()] + +count = sum(a) +p = n-1 +ans = 0 +judge = True +for i in range(m+1): + flag = False + count += b[i] + while count > k and judge: + count -= a[p] + p -= 1 + if p == -1: + if count > k: + flag = True + else: + judge = False + break + if flag: + break + sub = p+1+i + if ans < sub: + ans = sub +print(ans) + + " +p02623,s809542933,Wrong Answer,"input_data = [input().split() for l in range(3)] + +limit = int(input_data[0][2]) +deskA = [int(m) for m in input_data[1]] +deskB = [int(m) for m in input_data[2]] +num = 0 + +while True: + try: + if not deskA: + limit -= int(deskB.pop(0)) + elif not deskB: + limit -= int(deskA.pop(0)) + elif deskA[0] >= deskB[0]: + limit -= int(deskB.pop(0)) + else: + limit -= int(deskA.pop(0)) + if limit < 0: + break + num += 1 + + except IndexError: + break + +print(num)" +p02623,s879286944,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +import numpy as np +C=np.array(sorted(A+B)).cumsum() + +import bisect +print(bisect.bisect_left(C, K))" +p02623,s983907370,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +print(a,b) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s055547828,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = [0] + list(reversed(b)) + a +for i in range(n + m): + c[i + 1] += c[i] +r = m +ans = 0 +for l in range(n + m): + while r <= n + m and c[r] - c[l] <= k: + ans = max(ans, r - l) + r += 1 +print(ans) +" +p02623,s423054699,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +m = M+1 +cost = [] +for n in range(N + 1): + print(n, m) + if sum(A[:n]) > K: + break + while True: + print(n, m) + if sum(A[:n]) + sum(B[:m]) <= K: + cost.append(n + m) + break + m -= 1 + +print(max(cost))" +p02623,s764851171,Wrong Answer,"import collections as cs + +N, M, K = map(int, input().split()) +A = cs.deque(map(int, input().split())) +B = cs.deque(map(int, input().split())) + +A.append(K + 1) +B.append(K + 1) + +count = 0 +time = 0 +num = len(A) + len(B) + +for i in range(num): + if A[0] <= B[0]: + if A[0] + time <= K: + time += A.popleft() + count += 1 + + elif A[0] > B[0]: + if B[0] + time <= K: + time += B.popleft() + count += 1 + +print(count)" +p02623,s720126163,Wrong Answer,"N, M, X = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(100000000000000000) +B.append(100000000000000000) +A.reverse() +B.reverse() + + +ans = 0 +c = 0 +while True: + if A[-1] >= B[-1]: + b = B.pop() + if ans+b > X: + break + ans += b + c += 1 + else: + a = A.pop() + if ans+a > X: + break + ans += a + c += 1 +print(c) + +" +p02623,s238264798,Wrong Answer,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +sa = [0] * (n+1) +for i in range(n): + sa[i+1] = sa[i] + a[i] +sb = [0] * (m+1) +for i in range(m): + sb[i+1] = sb[i] + b[i] + +ans = 0 +for i in range(1,n+1): + bi = min(m, bisect.bisect_right(sb, max(0, k-sa[i]+1))-1) + if sa[i] + sb[bi] <= k: + ans = max(ans, i + bi) +print(ans)" +p02623,s552467369,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +S_A = [0] * (N + 1) +S_B = [0] * (M + 1) +for i in range(N): + S_A[i+1] = S_A[i] + A[i] + +for i in range(M): + S_B[i+1] = S_B[i] + B[i] + +ans = 0 +a = 0 +for i in range(M, -1, -1): + s = S_B[i] + while a=n and j>=m: + break + if a[i]<=b[j]: + t+=a[i] + i+=1 + else: + t+=b[j] + j+=1 + if t<=k: + ans+=1 +print(ans) +#print(t)" +p02623,s904847621,Wrong Answer,"import numpy as np + +def main(): + n,m,k=map(int,input().split()) + a=list(map(int,input().split())) + b=np.array(list(map(int,input().split()))) + #a=np.cumsum(a) + b=np.cumsum(b) + k0=k+1 + #a0=np.searchsorted(a,k) + b0=np.searchsorted(b,k) + r=b0 + i=0 + for i, ia in enumerate(a): + k0=k0-ia + #print(k0) + if k0<=0: + break + b0=np.searchsorted(b,k0) + b0+=i+1 + if b0 > r: + r=b0 + print(r) +main()" +p02623,s859451393,Wrong Answer,"n, m, k =map(int, input().split()) +a=list(map(int, input().split())) +b=list(map(int, input().split())) +ta=sum(a) +a.append(0) +tb=0 +ans=0 + +for i in range(n+1): + ta -= a[n-i] + for j in range(m): + tb += b[j] + if tb + ta >k: + break + if j==m-1: + j +=1 + + ans=max(ans,n-i+j) + +print(ans)" +p02623,s244251316,Wrong Answer,"from bisect import * +n, m, k = map(int, input().split()) +A = [0] +for x in map(int, input().split()): + if A[-1]+x <= k: A.append(A[-1]+x) +B = [0] +for x in map(int, input().split()): + if B[-1]+x <= k: B.append(B[-1]+x) +ans = 0 +for i in range(len(A)): + j = bisect_right(B, k-A[i]) - 1 + # if k >= A[i] + B[j]: + # ans = max(ans, i+j) + ans = max(ans, i+j) + +# print(k) +# print(A) +# print(B) +print(ans) +" +p02623,s493300889,Wrong Answer,"N ,M ,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +result = 0 + +A.append(10**10) +B.append(10**10) +i,j = 0,0 +for k in range(N+M): + K -= min(A[i],B[j]) + if K < 0: + break + if A[i] <= B[j]: + i += 1 + else: + j += 1 + result += 1 +print(result)" +p02623,s953131527,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +t = 0 +c = 0 +while(t= A[0] or K >= B[0]: + if A[0] < B[0]: + K -= A.pop(0) + else: + K -= B.pop(0) + c += 1 + if len(A) == 0: + A = A + [1000000010] + if len(B) == 0: + B = B + [1000000010] +print(c)" +p02623,s392781480,Wrong Answer,"n,m,k=map(int, input().split()) +A=list(map(int, input().split())) +B=list(map(int, input().split())) +A.append(10000000000000000) +B.append(10000000000000000) +a=0 +b=0 +cnt=0 +for i in range(n+m): + if a==n and k>=B[b]: + k-=B[b] + cnt+=1 + b+=1 + elif b==m and k>=A[a]: + k-=A[a] + cnt+=1 + a+=1 + elif min(A[a],B[b])>k: + break + elif A[a]>=B[b]: + k-=B[b] + b+=1 + cnt+=1 + else: + k-=A[a] + a+=1 + cnt+=1 +print(cnt)" +p02623,s211305708,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +dp_A = [0]*N +dp_B = [0]*M +dp_A[0] = A[0] +dp_B[0] = B[0] + +for a in range(1, N): + dp_A[a] += dp_A[a-1] + A[a] + +for b in range(1, M): + dp_B[b] += dp_B[b-1] + B[b] +ans = 0 +for i in range(N): + for j in range(M): + if dp_A[i] + dp_B[j] <= K: + ans = max(ans, i+j+2) +print(ans) +" +p02623,s500259575,Wrong Answer,"import sys +input = sys.stdin.readline +ins = lambda: input().rstrip() +ini = lambda: int(input().rstrip()) +inm = lambda: map(int, input().split()) +inl = lambda: list(map(int, input().split())) +out = lambda x: print('\n'.join(map(str, x))) + +n, m, k = inm() +a = inl() +b = inl() +count = 0 +for i in range(n-1): + a[i+1] += a[i] +for i in range(m-1): + b[i+1] += b[i] +for i in range(n): + j = m-1 + if a[i] > k: + break + while a[i] + b[j] > k and j >= 0: + j -= 1 + count = max(count, i+j + 2) +print(count)" +p02623,s773678655,Wrong Answer,"a,b,c = (int(i) for i in input().split()) +N = list(int(a) for a in input().split()) +M = list(int(b) for b in input().split()) +total = 0 +n = 0 +m = 0 +e = 0 +for i in range(a+b): + if N[n] < M[m] and n < a: + c -= N[n] + e += 1 + elif N[n] > M[m] and m < a: + c -= M[m] + e += 1 + elif n == a: + c -= M[m] + e += 1 + elif m == a: + c -= N[n] + e += 1 + + if c < 0: + e -= 1 + break + +print(e)" +p02623,s839470638,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +aa=[0]*n +ba=[0]*m +aa[0]=a[0] +ba[0]=b[0] +for i in range(1,n): + aa[i]=aa[i-1]+a[i] +for i in range(1,m): + ba[i]=ba[i-1]+b[i] +aa=[0]+aa +ba=[0]+ba +import bisect as bi +ax=bi.bisect_right(aa,k)-1 +ans=0 +for i in range(ax): + kk=k-aa[ax-i] + bx=bi.bisect_right(ba,kk)-1 + t=ax+bx-i + ans=max(ans,t) +print(ans)" +p02623,s115580647,Wrong Answer,"n,m,k = map(int,input().split()) +a = tuple(map(int,input().split())) +b = tuple(map(int,input().split())) + +t = 0 +i = 0 +j = 0 +while (t <= k): + #print(i,j,t) + if i < n: + ai = a[i] + else: + ai = 10**10 + if j < m: + bi = b[j] + else: + bi = 10**10 + if ai < bi: + i += 1 + t += ai + else: + j += 1 + t += bi +print(i+j-1)" +p02623,s605116017,Wrong Answer,"x, y, z = map(int, input().split()) +lx = list(map(int, input().split())) +nx = lx[0] +ly = list(map(int, input().split())) +ny = ly[0] +a = 0 + +while nx <= z or ny <= z: + if nx <= ny: + z = z-nx + lx.pop(0) + if not lx: + nx = z+1 + else: + nx = lx[0] + a = a+1 + else: + z = z-ny + ly.pop(0) + if not ly: + ny = z+1 + else: + ny = ly[0] + a = a + 1 +print(a)" +p02623,s045584120,Wrong Answer,"n,m,k=map(int,input().split()) +As=list(map(int,input().split())) +Bs=list(map(int,input().split())) +from collections import deque +As=deque(As) +Bs=deque(Bs) +ans=0 +inf=100000000000000000000000000000000000 +while k>0: + try: + a=As.popleft() + except: + a=inf + try: + b=Bs.popleft() + except: + b=inf + if a>b: + k-=b + As.appendleft(a) + else: + k -=a + Bs.appendleft(b) + ans+=1 +print(ans-1) +" +p02623,s495508150,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = 0 +for i in range(1, n): + a[i] += a[i-1] +for i in range(1, m): + b[i] += b[i-1] +for i in range(n): + if a[i] > k: + break; + while a[i]+b[m-1] > k: + m -= 1 + if m == 0: + break; + c = max(c, i+m+1) + if m == 0: + break; +print(c)" +p02623,s077116994,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +A=[0]*n +B=[0]*m +A[0]=a[0] +B[0]=b[0] +ans=0 + +for i in range(1,n): + A[i]=A[i-1]+a[i] +for i in range(1,m): + B[i]=B[i-1]+b[i] + +for j in range(n): + K=k-A[j] + if K<0: + break + left=0 + right=m + while leftK: + right=mid + else: + left=mid+1 + ans=max(ans,j+left+1) +print(ans) +" +p02623,s693030850,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +sum = [] +a,b = [0],[0] +ans = 0 + +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +for i in range(N+1): + if a[i] > K: + break + for j in range(M+1): + if a[i]+b[M-j] < K: + ans = max(ans,i+M-j) + break + +print(ans)" +p02623,s882838552,Wrong Answer,"from itertools import accumulate + +N,M,K = map(int,input().split()) + +A = [int(x) for x in input().split()] + +B = [int(x) for x in input().split()] + +C = list(accumulate(A)) + +D = list(accumulate(B)) + +res = 0 +for i,v1 in enumerate(C,1): + for j,v2 in enumerate(D,1): + if v1+v2 <= K: + res = max(res,i+j) + else: + break + +print(res) + " +p02623,s321975023,Wrong Answer,"N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +from heapq import heapify, heappop, heappush + +heap = [] +heapify(heap) + +for a in A: + heappush(heap, a) +for b in B: + heappush(heap, b) + +cnt = 0 +t = 0 +while t < K: + x = heappop(heap) + t += x + + if t <= K: + cnt += 1 + +print(cnt) + +" +p02623,s194504178,Wrong Answer,"import bisect +n, m, lim = map(int, input().split()) +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] +s = [0] * (n+m+1) +nowt = 0 +acnt = 0 +bcnt = 0 + +a.append(10**9+1) +b.append(10**9+1) +for i in range(1, n+m+1): + if a[acnt] < b[bcnt]: + s[i] = s[i-1] + a[acnt] + acnt += 1 + else: + s[i] = s[i-1] + b[bcnt] + bcnt += 1 + +print(bisect.bisect_right(s, lim)-1) +" +p02623,s089064583,Wrong Answer,"import collections as deque + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A += B +A.sort() +hon = deque.deque(A) +time = 0 +ans = 0 + +while len(hon) > 0: + time += hon.popleft() + if time <= K: + ans += 1 + +print(ans)" +p02623,s833766554,Wrong Answer,"import sys +readline = sys.stdin.readline + +N,M,K = map(int,readline().split()) +A = list(map(int,readline().split())) +B = list(map(int,readline().split())) + +for i in range(1, len(A)): + A[i] = A[i] + A[i - 1] + +for i in range(1, len(B)): + B[i] = B[i] + B[i - 1] + +import bisect +ans = 0 +for i in range(len(A)): + rest = K - A[i] + # あとrest分大丈夫 + ind = bisect.bisect_right(B, rest) + if ind != 0: + if (i + 1) + (ind) > ans: + ans = (i + 1) + (ind) + +print(ans)" +p02623,s964322124,Wrong Answer,"N, M, K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +minute = 0 +num = 0 +a = 0 +b = 0 +while(minute= sum(A_list[:n+1])+sum(B_list[:m+1]): + ans = max(ans, n+m+2) + else: + break + +print(ans)" +p02623,s113049049,Wrong Answer,"n,m,k = map(int,input().split()) +A = [int(p) for p in input().split()] +B = [int(p) for p in input().split()] +count = 0 + +for _ in range(99): + if A[0] > k and B[0] > k: + break + if A[0] < B[0]: + k -= A.pop(0) + count += 1 + else: + k -= B.pop(0) + count += 1 + if len(A)==0: + A.append((10**9)+1) + if len(B)==0: + B.append((10**9)+1) +print(count) +" +p02623,s628379775,Wrong Answer,"import bisect +N,M,K = map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +A_acc=[0] +B_acc=[0] + +for a in A: + A_acc.append(a+A_acc[-1]) +for b in B: + B_acc.append(b+B_acc[-1]) + +ans=0 +for i in range(len(A_acc)): + a_time = A_acc[i] + remain = K-a_time + if remain>0: + idx = bisect.bisect_right(B_acc,remain) + ans=max(ans,i+idx-1) +print(ans) +" +p02623,s216663574,Wrong Answer,"def MI(): return map(int, input().split()) +def LI(): return list(map(int, input().split())) + +N,M,K=MI() +A=[0]+LI() +B=[0]+LI() +from itertools import accumulate +A=list(accumulate(A)) +B=list(accumulate(B)) +ans=0 +for i in range(1,N+1): + if A[i]>K: + continue + for j in range(M,-1,-1): + if A[i]+B[j]>K: + continue + ans=max(ans,i+j) +print(ans)" +p02623,s682449346,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +total = 0 +len_A = len(A) +len_B = len(B) +i = 0 +j = 0 +while True: + a_i = A[i] if i < len_A else 1e10 + b_j = B[j] if j < len_B else 1e10 + if i >= len_A and j >= len_B: + break + if a_i < b_j: + K -= float(a_i) + i += 1 + else: + K -= float(b_j) + j += 1 + if K >= 0 - 1e-2: + total += 1 + else: + break + +print(total)" +p02623,s799416678,Wrong Answer,"n,m,k = map(int,input().split()) +c = [] +a = list(map(int,input().split())) +for x in a: + c.append(x) +b = list(map(int,input().split())) +for x in b: + c.append(x) +c.sort() +cc = 0 +ans = 0 +for x in c: + cc += x + ans = ans + 1 + if cc >= k: + if cc > k: + print(ans-1) + break + else: + print(ans) + break + else: + pass + +" +p02623,s604745576,Wrong Answer,"N,M,K = map(int,input().split()) +A_list = list(map(int,input().split())) +B_list = list(map(int,input().split())) +count = 0 +output = 0 +for i in range(N): + count += A_list[i] + if count > K: + break +for j in range(i + 1): + alcount = sum(A_list[:j + 1]) + for h in range(M): + alcount += B_list[h] + if alcount > K: + break + if j + h + 2 > output: + output = j + h + 2 + +# print(j,h,alcount) +print(output)" +p02623,s371186967,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j]+a[i]> K: + j -= 1 + ans = max(ans, i + j) +print(ans) +print(a) +print(b)" +p02623,s953429150,Wrong Answer,"import sys +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +C=A+B +d=0 +C.sort() +if sum(C)<=K : + print(len(C)) + sys.exit() +for i in range(len(C)) : + d=d+C[i] + if d>K : + print(i) + sys.exit()" +p02623,s795614368,Wrong Answer," +import bisect +import numpy + +n, m, k = map(int, input().split("" "")) +a = list(map(int, input().split("" ""))) +b = list(map(int, input().split("" ""))) + +cost_a = numpy.insert(numpy.cumsum(a), 0, 0) +cost_b = numpy.insert(numpy.cumsum(b), 0, 0) + +left_max = bisect.bisect_left(cost_a, k) + +ans = 0 +j = len(cost_b) - 1 +for i in range(left_max): + for j in range(j , -1, -1): + if cost_a[i] + cost_b[j] <= k: + ans = i + j if ans < i + j else ans + break +print(ans)" +p02623,s573836625,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +import numpy as np +import bisect + +ra=[0]+list(np.cumsum(a)) +rb=[0]+list(np.cumsum(b)) + +ans=0 +for i in range(n+1): + capa = k - ra[i] + if ra[i]<0: + break + j=bisect.bisect_right(rb,capa) + + + ans=max(ans,i-1+j) + +print(ans) " +p02623,s794522618,Wrong Answer,"from bisect import bisect_right +from itertools import accumulate + +N, M, K, *AB = map(int, open(0).read().split()) +A, B = AB[:N], AB[N:] + +A = [0] + list(accumulate(A)) +B = [0] + list(accumulate(B)) + +ans = 0 +for i, a in enumerate(A): + if K - a <= 0: + break + ans = max(ans, bisect_right(B, K - a) + i - 1) + +print(ans)" +p02623,s819152188,Wrong Answer,"n,m,k=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=[0]+list(map(int,input().split())) + +asum=[0] +bsum=[0] + +for i in range(n): + asum.append(asum[i]+A[i]) + +for j in range(m): + bsum.append(bsum[j]+B[j]) + +ans=0 +ko=m +for i in range(n+1): + if asum[i]>k: + break + while asum[i]+bsum[ko]>k: + ko-=1 + ans=max(ans,i+ko) + +print(ans) +" +p02623,s434396757,Wrong Answer,"# -*- coding: utf-8 -*- +m, n, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.extend(B) +del B +AB = sorted(A) +s=0 +l=0 +for i in AB: + if s+i <= k: + s+=i + l+=1 + else: + break +print(""{}"".format(l))" +p02623,s672802473,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +ab = a + b +ab.sort() +ans = 0 +now = k +for elem in ab: + now -= elem + if now < 0: + break + ans += 1 +print(ans) +" +p02623,s398268346,Wrong Answer,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +# cumsum +a_sum = [0] * n +a_sum[0] = a[0] +for i in range(1, n): + a_sum[i] = a_sum[i-1] + a[i] + +b_sum = [0] * m +b_sum[0] = b[0] +for i in range(1, m): + b_sum[i] = b_sum[i-1] + b[i] + +ans = 0 +for i in range(n): + a_total = a_sum[i] + if a_total > k: break + j = bisect.bisect_right(b_sum, k - a_total) + ans = max(ans, i + j + 1) +print(ans) +" +p02623,s827521815,Wrong Answer,"n, m, k = (int(i) for i in input().split()) +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +A.append(float('inf')) +B.append(float('inf')) + +sum,min,ans,i,j = 0,0,0,0,0 + +while True: + if A[i] < B[j]: + min = A[i] + i += 1 + else: + min = B[j] + j += 1 + + if sum + min > k: + break + else: + sum += min + ans += 1 + +print(ans)" +p02623,s964477278,Wrong Answer,"from bisect import bisect +from itertools import accumulate +from sys import stdin + + +def main(): + input = lambda: stdin.readline()[:-1] + N, M, K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + + book = list(accumulate(sorted(A + B))) + ans = bisect(book, K) + print(ans) + + +main() +" +p02623,s817232213,Wrong Answer,"from collections import deque + +n, m, k = map(int, input().split()) +a = deque(list(map(int, input().split()))) +b = deque(list(map(int, input().split()))) + +ans = 0 +cnt = 0 +while True: + if a: at = a.popleft() + if b: bt = b.popleft() + if at < bt: + cnt += at + b.appendleft(bt) + else: + cnt += bt + a.appendleft(at) + if cnt >= k: + print(ans) + exit() + ans += 1" +p02623,s399071036,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=0 +ai=0 +bi=0 +loopcnt=len(a)+len(b) +for i in range(loopcnt): + ans+=1 + if len(a)-ai==0: + k-=b[bi] + bi+=1 + elif len(b)-bi==0: + k-=a[ai] + ai+=1 + elif a[ai]>b[bi]: + k-=b[bi] + bi+=1 + else: + k-=a[ai] + ai+=1 + if k<0: + ans-=1 + break +print(ans)" +p02623,s375752965,Wrong Answer,"N ,M ,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +result = 0 + +A.append(1000000001) +B.append(1000000001) +i,j = 0,0 +for k in range(N+M): + if A[i] <= B[j]: + K -= A[i] + i += 1 + else: + K -= B[j] + j += 1 + if K < 0: + break + result += 1 +print(result)" +p02623,s345215037,Wrong Answer,"import bisect + +n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +Acum = [A[0]] + [0]*(n-1) +Bcum = [B[0]] + [0]*(m-1) +for i in range(1,n): + Acum[i] = Acum[i-1] + A[i] +for i in range(1,m): + Bcum[i] = Bcum[i-1] + B[i] +maxn = 0 +for i in range(m): + if Bcum[i] < k: + maxn = max(maxn,i + 1 + bisect.bisect_right(Acum, k-Bcum[i])) + +print(maxn)" +p02623,s443086838,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +c=0 +count=0 +while c+min(a[0],b[0])<=k: + + c+=min(a[0],b[0]) + count+=1 + if min(a[0],b[0])==a[0]: + a.remove(a[0]) + if not a: + a.append(1000000000) + else: + b.remove(b[0]) + if not b: + b.append(1000000000) +print(count) " +p02623,s591535945,Wrong Answer,"N, M, KK = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +max = N +if N < M: + max = M +sum = 0 + +for i in range(max): + k = 0 + if len(a) > 0: + k = a[0] + if len(b) > 0 and k > b[0]: + k = b[0] + + if KK - k > 0: + sum += 1 + KK -= k +print(sum)" +p02623,s583772284,Wrong Answer,"def aaa(): + n,m,k = map(int,input().split()) + a = list(map(int,input().split())) + b = list(map(int,input().split())) + c = [] + for i,j in zip(a,b): + c.append(i) + c.append(j) + c = sorted(c) + d = 0 + e = 0 + for i in c: + if i+e < k: + e += i + d += 1 + else: + return d + return n + m +nnn = aaa() +print(nnn)" +p02623,s669576250,Wrong Answer,"from collections import deque + +N, M, K = map(int, input().split()) +A = deque(map(int, input().split())) +B = deque(map(int, input().split())) + +count = 0 +for i in range(N + M): + if len(A) == 0: + book = B.popleft() + elif len(B) == 0: + book = A.popleft() + else: + if A[0] < B[0]: + book = A.popleft() + else: + book = B.popleft() + + if K >= book: + count += 1 + K -= book + else: + break + +print(count)" +p02623,s239274646,Wrong Answer,"n,m,k=map(int,input().split()) +A=[0]+list(map(int,input().split())) +B=[0]+list(map(int,input().split())) +from itertools import accumulate +from bisect import bisect_right +A=list(accumulate(A)) +B=list(accumulate(B)) +ans=0 +t=0 +for a in range(n+1): + t=k-A[a] + b=bisect_right(B,t)-1 + if B[b]>k:continue + ans=max(ans,a+b) +print(ans)" +p02623,s516843266,Wrong Answer,"import sys +sys.setrecursionlimit(10**6) +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(99999) +B.append(99999) +Sum = 0 +i = 0 +j = 0 +while True: + if A[i] <= B[j] and Sum + A[i] <= K: + Sum += A[i] + i += 1 + elif A[i] > B[j] and Sum + B[j] <= K: + Sum += B[j] + j += 1 + else: + break +if Sum >= 1000000000: + print(0) +else: + print(i + j)" +p02623,s633913491,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +AS=[0] +BS=[0] +r=0 +for i in A: + AS.append(i+AS[-1]) + if AS[-1]>k: + break +for i in B: + BS.append(i+BS[-1]) + if BS[-1]>k: + break +f=1 +for i in range(1,len(AS)): + for j in range(f,len(BS)): + if AS[-i]+BS[-j]<=k: + if len(AS)+len(BS)-i-j>r: + r=len(AS)+len(BS)-i-j + f=j +print(r)" +p02623,s090674722,Wrong Answer,"import bisect + +N, M, K = map(int, input().split()) +Alist = [0] + list(map(int, input().split())) +Blist = list(map(int, input().split())) + +B = [Blist[0]] +for b in Blist[1:]: + B.append(b + B[-1]) + + +sums = 0 +ans = 0 +for idx, a in enumerate(Alist): + sums += a + if sums > K: + break + k = K - sums + print(k) + tmp = bisect.bisect_right(B, k) + ans = max(ans, idx + tmp) + +print(ans)" +p02623,s605284611,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a,b=[0],[0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +ans = 0 +j = M +for i in range(N + 1): + if a[i]>K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s021755621,Wrong Answer,"N, M, K = map(int,input().split()) +AL = list(map(int, input().split())) +BL = list(map(int, input().split())) +AL.extend(BL) +AAL = sorted(AL) + +if sum(AAL) <= K: + print(len(AAL)) + exit() + +cnt = 0 +ans = 0 +for i in range(N+M): + cnt += AAL[i] + ans += 1 + if cnt >= K: + print(ans-1) + exit()" +p02623,s589808901,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +ac = 0 +bc = 0 +ans = 0 +t = 0 + +while t b[bc]: + t += b[bc] + bc +=1 + ans+=1 + else: + t+= a[ac] + ac+=1 + ans+=1 + elif ac >= n and bc<=m-1: + t += b[bc] + bc +=1 + ans+=1 + elif bc >= m and ac<=n-1: + t+= a[ac] + ac+=1 + +if t>k: + ans -=1 + +print(ans)" +p02623,s650825039,Wrong Answer,"import collections as cs + +N, M, K = map(int, input().split()) +A = cs.deque(map(int, input().split())) +B = cs.deque(map(int, input().split())) + +A.append(K + 1) +B.append(K + 1) + +count = -1 +time = 0 + +while time <= K: + count += 1 + if A[0] <= B[0]: + time += A.popleft() + else: + time += B.popleft() + +print(count)" +p02623,s867198328,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +c = 0 +ans = -1 +ia = 0 +ib = 0 +while c <= K: + if ia == N and ib == M: + ans += 1 + break + elif ia == N: + c += B[ib] + ib += 1 + + elif ib == M: + c += A[ia] + ia += 1 + + elif A[ia] <= B[ib]: + c += A[ia] + ia += 1 + + else: + c += B[ib] + ib += 1 + + ans += 1 +print(ans)" +p02623,s741211691,Wrong Answer,"N, M, K = map(int, input().split()) +As = [int(i) for i in input().split()] +Bs = [int(i) for i in input().split()] +x = 0 +i = 0 +while x < K: + if(As != [] and Bs != []): + if(As[0] >= Bs[0]): + x += Bs.pop(0) + i += 1 + elif(As[0] < Bs[0]): + x += As.pop(0) + i += 1 + elif(As == [] and Bs == []): + print(i - 1) + elif(Bs == []): + x += As.pop(0) + i += 1 + elif(As == []): + x += Bs.pop(0) + i += 1 +print(i - 1)" +p02623,s675894270,Wrong Answer,"from collections import deque +n,m,k=map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +A,B = deque(A),deque(B) +time,ans = 0,0 +while A or B: + if not A: v = B.popleft() + elif not B: v = A.popleft() + elif A[0] <= B[0]: v = A.popleft() + else: v = B.popleft() + if time + v > k: break + time += v + ans += 1 +print(ans)" +p02623,s133312883,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +count = 0 +while K > 0: + if A == []: + K -= B.pop(0) + elif B == []: + K -= A.pop(0) + else: + if A[0] >= B[0]: + K -= B.pop(0) + else: + K -= A.pop(0) + if K >= 0: + count += 1 +print(count)" +p02623,s045514099,Wrong Answer,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +i = 0 +j = 0 +time = 0 +ans = 0 +for _ in range(n+m+1): + if A[i] < B[j] and i != n-1: + ans +=1 + time += A[i] + i += 1 + else: + if j != m-1: + ans +=1 + time += B[j] + j += 1 + + if time > k: + ans -= 1 + print(ans) + exit() + + if (i+1)+(j+1) == n+m: + print(n+m) + exit()" +p02623,s915913158,Wrong Answer,"def main(): + n, m, k = map(int, input().split()) + a = list(map(int, input().split())) + b = list(map(int, input().split())) + + c = a + b + c.sort() + sum = 0 + for i in range(len(c)): + sum += c[i] + if k < sum: + return print(i) + print(len(c)) + + +main()" +p02623,s619979329,Wrong Answer,"n, m, k = map(int, input().split()) +a = [int(x) for x in input().split()] +b = [int(x) for x in input().split()] +aa = a.copy() +bb = b.copy() + +aa = [sum(a[:s+1]) for s in range(n)] +bb = [sum(b[:s+1]) for s in range(m)] + +temp, ans = 0, 0 + +for i in range(1, n): + for j in range(m)[::-1]: + if aa[i] + bb[j] <= k: + temp = i+1 + j+1 + break + if temp > ans: + ans = temp + +print(ans) +" +p02623,s861331184,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + + +maxNum = 0 +cnt = 0 + + +for i in a: + if k - i > 0: + k -= i + cnt += 1 + else: + break + + for j in b: + if k - j > 0: + k -= j + cnt += 1 + else: + break + + maxNum = max(maxNum, cnt) + + +print(maxNum) + +" +p02623,s848893753,Wrong Answer,"N, M, K = map(int,input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +time = 0 +count = -1 +while time <= K: + count += 1 + if len(A) == 0 and len(B) == 0: + break + elif len(A) == 0: + time += B.pop(0) + + elif len(B) == 0: + time += A.pop(0) + + else: + if A[0] <= B[0]: + time += A.pop(0) + + else: + time += B.pop(0) +print(count)" +p02623,s379191879,Wrong Answer,"import sys +a, b, n = map(int, input().split()) +alis = list(map(int, input().split())) +blis = list(map(int, input().split())) +alis.append(sys.maxsize) +blis.append(sys.maxsize) + +count = 0 +time = 0 + +ac = 0 +bc = 0 +while time <= n: + time += min(alis[ac], blis[bc]) + count += 1 + if alis[ac] <= blis[bc]: + ac += 1 + else: + bc +=1 + +print(count-1)" +p02623,s675760276,Wrong Answer,"from bisect import bisect + +N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +csumA = [] +csumB = [] + +s = 0 +for i in A: + s += i + csumA.append(s) +s = 0 +for i in B: + s += i + csumB.append(s) + +ans = 0 +for i in range(N): + if K - csumA[i] >= 0: + ans = max(ans,i+1+bisect(csumB,max(0,K-csumA[i]))) + +print(ans)" +p02623,s335292863,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +cost = 0 +ans = 0 +pa = 0 +pb = 0 +while cost <= K: + if pa < N and pb < M: + if A[pa] <= B[pb]: + cost += A[pa] + pa += 1 + else: + cost += B[pb] + pb += 1 + ans += 1 + elif pa < N: + cost += A[pa] + pa += 1 + ans += 1 + elif pb < M: + cost += B[pb] + pb += 1 + ans += 1 + else: + ans += 1 + break; +print(ans-1) +" +p02623,s992032562,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A_ = [sum(A[:i+1]) for i in range(len(A)) if sum(A[:i+1]) <= K] +B_ = [sum(B[:i+1]) for i in range(len(B)) if sum(B[:i+1]) <= K] + +x = [i+j+2 for i in range(len(A_)) for j in range(len(B_)) if A_[i]+B_[j] <= K] +print(max(x) if len(x) > 0 else 0)" +p02623,s199353770,Wrong Answer,"from collections import deque +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ad = deque(a) +ad.append(float('inf')) +bd = deque(b) +bd.append(float('inf')) +count = 0 +while True: + k = k - min(ad[0],bd[0]) + if k < 0 or ad[0] == float('inf') and bd[0] == float('inf'): + break + if ad[0] > bd[0]: + bd.popleft() + else: + ad.popleft() + count += 1 +print(count)" +p02623,s702195762,Wrong Answer,"import bisect + +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +a_sum = [0]*(n+1) +b_sum = [0]*(m+1) + +for i in range(n): + a_sum[i+1] = a_sum[i] + a[i+1] +for j in range(m): + b_sum[j+1] = b_sum[j] + b[j+1] + +ans = 0 +for i in range(n+1): + j = bisect.bisect_left(b_sum, k - a_sum[i]) + tmp = i + j + ans = max(ans, tmp) + +print(ans)" +p02623,s063853403,Wrong Answer,"import bisect +N,M,K = map(int,input().split()) + +a = list(map(int,input().split())) +b = list(map(int,input().split())) +A = [0] +B = [0] +ans = 0 +for i in range(N): + if A[i]+a[i] <=K: + A.append(A[i]+a[i]) + else: + break + +for i in range(M): + if B[i]+b[i] <=K: + B.append(B[i]+b[i]) + else: + break + +if len(A)==1 and len(B)==1: + print(0) + exit() +for i in range(len(A)): + j = bisect.bisect(B,K-A[i]-0.1) + if ans k: + break + if a[i] <= b[j]: + k -= a[i] + books += 1 + i += 1 + else: + k -= b[j] + books += 1 + j += 1 +print(books)" +p02623,s870909658,Wrong Answer,"import bisect +N,M,K=map(int,input().split()) +SumA=[0]*(N+1) +SumB=[0]*(M+1) +A=list(map(int, input().split())) +B=list(map(int,input().split())) +for i in range(1,N+1): + SumA[i]= A[i-1]+SumA[i-1] +for i in range(1,M+1): + SumB[i] = B[i-1]+SumB[i-1] + +ans = 0 +for i in range(N+1): + num = i + rest = K-SumA[i] + if rest<=0: + break; + num += bisect.bisect_right(SumB, rest)-1 + ans = max(num, ans) + +print(ans) + +" +p02623,s068346487,Wrong Answer,"import sys +sys.setrecursionlimit(10 ** 9) +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +cnt = 0 +def dfs(a, b, t): + global cnt + cnt = max(cnt, a+b) + if a < N and t + A[a] <= K: + dfs(a+1, b, t+A[a]) + if b < M and t + B[b] <= K: + dfs(b+1, a, t+B[b]) + +dfs(0, 0, 0) +print(cnt) +" +p02623,s653802832,Wrong Answer,"import bisect + +n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +Acum = [A[0]] + [0]*(n-1) +Bcum = [B[0]] + [0]*(m-1) +for i in range(1,n): + Acum[i] = Acum[i-1] + A[i] +for i in range(1,m): + Bcum[i] = Bcum[i-1] + B[i] +maxn = 0 +for i in range(m): + if Bcum[i] < k: + maxn = max(maxn,i + 1 + bisect.bisect_left(Acum, k-Bcum[i])) + +print(maxn)" +p02623,s456185358,Wrong Answer,"n, m, k = map(int, input().strip().split()) + +a = list(map(int, input().strip().split()))[:n] +b = list(map(int, input().strip().split()))[:m] + +all = [] +all.extend(a) +all.extend(b) +print(*all) +counter = 0 +am = 0 +if(k - min(all) >= 0): + while(k > 0): + print(k) + am = min(all) + k-= am + counter += 1 + all.remove(am) + if(len(all) == 0): + break +else: + counter = 0 + + +print(counter) +" +p02623,s530281736,Wrong Answer,"[N,M,K]=list(map(int, input().split())) +alist=list(map(int, input().split())) +blist=list(map(int, input().split())) +clist=alist+blist +clist.sort() + +time=0 +ans=-1 +ci=0 +while time<=K : + ans+=1 + + #print(time,ans) + if ans == len(clist): + break + time+=clist[ans] + + +print(ans) +" +p02623,s598787189,Wrong Answer,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +ans = 0 +A_cumulative_sum = [A[0]] +B_cumulative_sum = [B[0]] +for i in range(1, N): + A_cumulative_sum.append(A[i] + A[i - 1]) +for i in range(1, M): + B_cumulative_sum.append(B[i] + B[i - 1]) + +for i in range(N): + if K < A_cumulative_sum[i]: + break + remaining_time = K - A_cumulative_sum[i] + idx = bisect.bisect_right(B_cumulative_sum, remaining_time) + ans = max(ans, i + 1 + idx) +print(ans)" +p02623,s971564300,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +a,b=[0],[0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +a.pop(0) +b.pop(0) +j=m-1 +x=0 +for i in range(n-1,-1,-1): + if a[i]>k: + continue + while j>=0 and b[j]>k-a[i]: + j-=1 + x=max(x,i+j+2) +print(x) +" +p02623,s908870270,Wrong Answer,"# coding: utf-8 +import math +import bisect +N, M, K = map(int,input().split()) +#N = int(input()) +#K = int(input()) +#S = input() +ans = 0 +flg = True +#l = list(map(int,input().split())) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +for i in range(N-1): + A[i+1] += A[i] +for i in range(M-1): + B[i+1] += B[i] + +na = bisect.bisect_right(A, K) +#print(na) +for i in range(na-1): + time_b = K-A[i] + nb = bisect.bisect_right(B, time_b) + ans = max(ans, i+nb+2) +print(ans)" +p02623,s725594502,Wrong Answer,"n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a = [sum(a[:i+1]) for i in range(len(a))] +b = [sum(b[:i+1]) for i in range(len(b))] +ans = 0 +for i in range(n): + for j in reversed(range(m)): + if a[i]+b[j]<=k: + ans = max(ans, i+j+2) + m=j+1 + break +print(ans)" +p02623,s669567506,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +time = 0 +cnt = 0 +while time <= K: + if len(A) == 0 and len(B) == 0: + break + if len(A) == 0: + tmp = B.pop(0) + elif len(B) == 0: + tmp = A.pop(0) + elif A[0] K: + break + cnt += 1 + # print(time,A,B) +print(cnt) +" +p02623,s708045419,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +C=list() +D=list() +c=0 +d=0 +for i in range(n): + c+=A[i] + C.append(k-c) +for i in range(m): + D.append(d+B[i]) + d+=B[i] +ans=0 +#C=[i for i in C if i>=0] +for i in range(n): + now=C[i] + s=0 + while D[s]<=now: + s+=1 + if s>=len(D): + break + if s>0: + ans=max(ans,i+s+1) +print(ans)" +p02623,s720563338,Wrong Answer,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +C = A+B +C.sort() +ans = 0 +for c in C: + if c <= k: + ans += 1 + k -= c +print(ans) + " +p02623,s008560507,Wrong Answer,"n,m,k=map(int,input().split()) +arr=list(map(int,input().split())) +brr=list(map(int,input().split())) + +sumA=sum(arr) +bpointer=0 +ans=0 +sumB=0 +for i in range(len(arr),-1,-1): + if i 10**9 or min(a_, b_) > k: + break + + if a_ <= b_: + k -= a.pop(0) + ans += 1 + else: + k -= b.pop(0) + ans += 1 +print(ans)" +p02623,s808875416,Wrong Answer,"from sys import stdin +input = stdin.readline + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +for i in range(1, N): + A[i] += A[i - 1] + +for i in range(1, M): + B[i] += B[i - 1] + +ans = 0 +k = M - 1 + +for i in range(N): + for j in range(k, -1, -1): + if K < A[i] + B[j]: + k -= 1 + continue + else: + ans = max(ans, i + j + 2) + break + +print(ans) +" +p02623,s929400225,Wrong Answer,"N, M, K = map(int, input().split()) +As = [int(i) for i in input().split()] +Bs = [int(i) for i in input().split()] +x = 0 +y = 0 +i = 0 +min = 0 +for x in range(N): + min += As[x] + i += 1 + if(min > K): + break + for y in range(M): + min += Bs[y] + i += 1 + if(min > K): + break +print(i) + " +p02623,s653250777,Wrong Answer,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +sum_list = [] +for i in range(N): + for j in range(M): + sum_ = sum(A[:i+1]) + sum(B[:j+1]) + if sum_ <= K: + sum_list.append(len(A[:i+1]) + len(B[:j+1])) + elif K < sum_: + break +if 1 <= len(sum_list): + print(max(sum_list)) +elif 0 == len(sum_list): + print(0)" +p02623,s551500232,Wrong Answer,"import bisect +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +sa,sb = [0],[0] +ans = 0 +for i in range(n): + sa.append(sa[i]+a[i]) +for i in range(m): + sb.append(sb[i]+b[i]) + + +for i in range(n+1): + sai = sa[i] + x = k-sai + if x>0: + ans = max(ans,bisect.bisect_right(sb,x)-1+i) +print(ans)" +p02623,s731073752,Wrong Answer,"n , m , k = map( int , input().split() ) + +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +list = a + b +list = sorted(list) + +l = n + m + +m = 0 +count = 0 + +for i in range(l): + if count + list[i] <= k: + count += list[i] + m += 1 + print(count) +print(m)" +p02623,s125437254,Wrong Answer,"n, m, k =map(int, input().split()) +a=list(map(int, input().split())) +b=list(map(int, input().split())) +ta=sum(a) +a.append(0) +tb=0 +ans=0 +j=0 +for i in range(n+1): + ta -= a[n-i] + if ta>k: + continue + while tb + ta0: + x=i+s-1 + if x>ans: + ans=x +print(ans)" +p02623,s272315548,Wrong Answer,"N, M, K = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) + +sum_A = [0, A[0]] +sum_B = [0, B[0]] + +for a in A[1:]: + sum_A.append(sum_A[-1] + a) + +for b in B[1:]: + sum_B.append(sum_B[-1] + b) + +ans = 0 +for i in range(N+1): + for j in range(M, 0, -1): + if sum_A[i] + sum_B[j] <= K: + ans = max(ans, i+j) + break + +print(ans) +" +p02623,s391125856,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +cntA = 0 +ans = 0 +for i in range(n): + if cntA+a[i] > k: + break + ans += 1 + cntA += a[i] +indA = ans-1 +nc = indA+1 +copyA = cntA+1 +for j in range(indA+1): + temp = 0 + adds = 0 + for v in b: + adds += v + if cntA + adds > k: + break + temp += 1 + cntA -= a[nc-1-j] + ans = max(ans,indA+1+temp) + indA -= 1 +print(ans)" +p02623,s987972499,Wrong Answer,"n,m,k=map(int,input().strip().split()) + +arr=list(map(int,input().strip().split())) +arr.extend(list(map(int,input().strip().split()))) +arr.sort() +i=0 +re=0 +x=[] +while(k>0): + if(k>=arr[i]): + k-=arr[i] + re+=1 + i+=1 + else: + break + +print(re) + " +p02623,s215696225,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=0 +while 1: + if len(a)==0 and len(b)==0: + break + elif len(a)==0: + read=b.pop(0) + elif len(b)==0: + read=a.pop(0) + elif a[0]>b[0]: + read=b.pop(0) + else: + read=a.pop(0) + if read<=k: + k-=read + ans+=1 + else: + break +print(ans)" +p02623,s920314406,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +ac = 0 +bc = 0 +ans = 0 +t = 0 + +while t<=k: + if bc<=m-1 and ac <=n-1: + if a[ac] > b[bc]: + t += b[bc] + bc +=1 + else: + t+= a[ac] + ac+=1 + elif ac >= n and bc<=m-1: + t += b[bc] + bc +=1 + elif bc == m and ac<=n-1: + t+= a[ac] + ac+=1 + ans+=1 + +if t>k: + ans -=1 + +print(ans)" +p02623,s449848059,Wrong Answer,"info = [int(i) for i in input().split()] +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +N = list() +M = list() +N.append(A[0]) +for i in range(1, info[0]): + N.append(N[i-1]+A[i]) +M.append(B[0]) +for i in range(1, info[1]): + M.append(M[i-1]+B[i]) + +ans = 0 +for i in range(info[0]-1, -1, -1): + if N[i] > info[2]: + continue + for j in range(info[1]-1, -1, -1): + if N[i]+M[j] <= info[2]: + ans = max(ans, i+j+2) + break + +print(ans)" +p02623,s351509563,Wrong Answer,"n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = a + b +c = sorted(c) +d = [0] +res = 0 + +for i, elem in enumerate(c): + d.append(d[i] + elem) + if d[i + 1] <= k: + res += 1 + else: + break +print(res)" +p02623,s213173795,Wrong Answer,"import numpy as np +from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +ac = np.cumsum(a) +bc = np.cumsum(b) +ans = 0 + +for i in range(n): + if k < ac[i]: + break + time = k - ac[i] + j = bisect_right(bc, time) + ans = max(ans, j + i + 1) +print(ans) +" +p02623,s803728163,Wrong Answer,"import sys +read = sys.stdin.read +readline = sys.stdin.readline +readlines = sys.stdin.readlines +import numpy as np +def main(): + n, m, k = map(int, input().split()) + a = np.array(readline().split(), np.int64) + b = np.array(readline().split(), np.int64) + aa = a.cumsum() + ba = b.cumsum() + r = np.searchsorted(ba, k) + aaa = k - aa + for i1, aaae in enumerate(aaa): + if aaae > 0: + r = max(r, np.searchsorted(ba, aaae) + i1 + 2) + print(r) + +if __name__ == '__main__': + main()" +p02623,s407768053,Wrong Answer,"def main(): + n, m, k = map(int,input().split()) + A = list(map(int,input().split())) + B = list(map(int,input().split())) + C = [] + for x in range(n+1): + sumA = int(sum(A[0:x])) + for y in range(m+1): + sumB = int(sum(B[0:y])) + if sumA + sumB < k: + C.append(x+y) + print(max(C)) +main()" +p02623,s148221394,Wrong Answer,"import itertools + + +n, m, k = input().split() +n = int(n) +m = int(m) +k = int(k) + +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] + +p = range(1,n+m+1) +#print(list(p)) +nmax = 0 +for i in p: + flag = False + for j in range(i+1): + x = j + y = i-j + sum_ = sum(a[:j]+b[:i-j]) + if sum_ <= k: + flag = True + nmax = i + #print(sum_, i) + if not flag: + break +print(nmax) + + + + + + + + + + + + + +" +p02623,s588711059,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +count = 0 +i = 0 +j = 0 +while k >= a[i] or k >= b[j]: + read = min(a[i],b[j]) + if read == a[i]: + i += 1 + count += 1 + k -= read + if i == n: + a.append(10**10) + else: + j += 1 + count += 1 + k -= read + if j == m: + b.append(10**10) +print(count)" +p02623,s255914093,Wrong Answer,"from collections import deque +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +t=0 +ans=0 +aq=deque(a) +bq=deque(b) +aq.append(k*100) +bq.append(k*100) +while tk: + print(ans-1) +else: + print(ans) +" +p02623,s633018917,Wrong Answer,"import numpy as np +param_list = np.array(input().split()).astype(int) +a_list = np.array(input().split()).astype(int) +b_list = np.array(input().split()).astype(int) +ans=0 +for i in range(param_list[0]+1): + for l in range(param_list[1]+1): + a = sum(a_list[:i]) + sum(b_list[:l]) + b= 0 + if a <= param_list[2]: + if b <= i+l: + b = i+l + +print(b)" +p02623,s980830372,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +cnt=0 +while cnt!=n+m: + if len(B)==0: + k-=A[0] + del A[0] + cnt+=1 + elif len(A)==0: + k-=B[0] + del B[0] + cnt+=1 + elif A[0]<=B[0] and k>A[0]: + k-=A[0] + del A[0] + cnt+=1 + elif B[0]B[0]: + k-=B[0] + del B[0] + cnt+=1 + else: + break +print(cnt)" +p02623,s624741884,Wrong Answer,"from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] +A = [0] +B = [0] +for i in range(n): + A.append(A[-1] + a[i]) +for j in range(m): + B.append(B[-1] + b[j]) + +ans = 0 +for i in range(n + 1): + time = A[i] + b_index = 0 + if time > k: + break + if k - time > 0: + b_index = bisect_right(B, k - time) + ans = max(ans, i + b_index - 1) +print(ans)" +p02623,s022256038,Wrong Answer,"n,m,k=map(int,input().split()) +a=sorted(map(int,input().split())) +b=sorted(map(int,input().split()))[::-1] +x=sum(a) +z=n +ans=0 +while a: + while b and b[-1]+x<=k: + c=b.pop() + x+=c + z+=1 + ans=max(ans,z) + c=a.pop() + x-=c + z-=1 + if x>k:continue + ans=max(ans,z) +print(ans) +" +p02623,s500227315,Wrong Answer,"from _collections import deque +n,m,k=map(int,input().split()) +A=deque(list(map(int,input().split()))) +B=deque(list(map(int,input().split()))) + +t=0 +ans=0 +while True: + if (not A) and (not B): + break + elif not A: + t+=B.popleft() + elif not B: + t+=A.popleft() + else: + if A[0]k: + break + ans+=1 +print(ans) +" +p02623,s706277838,Wrong Answer,"[N, M, K] = [int(i) for i in input().split()] +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +c = 0 + +A.append(10**10) +A.reverse() +B.append(10**10) +B.reverse() + +a = A.pop() +b = B.pop() + +while True: + if a < b: + if K >= a: + c += 1 + K -= a + a = A.pop() + else: + break + else: + if K >= b: + c += 1 + K -= b + b = B.pop() + else: + break + +print(c)" +p02623,s422304981,Wrong Answer,"a = [input() for l in range(0,3)] +a1 = [int(p) for p in a[0].split()] +a2 = [int(p) for p in a[1].split()] +a3 = [int(p) for p in a[2].split()] +a4 = a2 + a3 +b = sorted(a4) +s = 0 +t = 0 +while s <= a1[2] and t < len(b): + s = s + b[t] + t = t + 1 +print(t-1)" +p02623,s520657778,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +x = a + b +x.sort() +sum = 0 +for i in range(len(x)): + sum += x[i] + if sum > k: + print(i) + exit() + +print(len(x)) +" +p02623,s462486548,Wrong Answer,"N, M, K = [int(i) for i in input().split()] + +A = [10**10] * 100000 + [int(i) for i in input().split()][::-1] +B = [10**10] * 100000 + [int(i) for i in input().split()][::-1] + +t = 0 +c = 0 +while t < K: + a, b = A[-1], B[-1] + if min(a, b) <= (K-t): + if a <= b: + t += A.pop() + c += 1 + else: + t += B.pop() + c += 1 + else: + break +print(c) +" +p02623,s872782933,Wrong Answer,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +for i in range(1,N): + A[i] += A[i-1] +for i in range(1,M): + B[i] += B[i-1] + +ans = 0 +for i in range(N): + K1 = K - A[i] + if(K1 >= 0 and K1 < B[0]): + ans = max(ans, i+1) + elif(K1 >= 0): + j = bisect.bisect_right(B, K1) + ans = max(ans, i+j+1) +print(ans)" +p02623,s151319642,Wrong Answer,"from collections import deque + +n, m, k = map(int, input().split()) +INF = 10**18 +A = deque(list(map(int, input().split())) + [INF]) +B = deque(list(map(int, input().split())) + [INF]) +total = 0 +cnt = 0 +while True: + if A[0] < B[0]: + a = A.popleft() + total += a + else: + b = B.popleft() + total += b + if total > k: + break + cnt += 1 +print(cnt) +" +p02623,s458794228,Wrong Answer,"N,M,K = map(int, input().split()) +A = map(int, input().split()) +B = map(int, input().split()) + +sa = [0] +for i, val in enumerate(A): + sa.append(sa[i] + val) + +sb = [0] +for i, val in enumerate(B): + sb.append(sb[i] + val) + +max_num = 0 +ind_max = M +for i in range(N+1): + if(sa[i]>K): + break + for k in range(ind_max+1): + if(sb[ind_max-k]<=K-sa[i]): + break + ind_max -= 1 + max_num = max(max_num,i+ind_max) + + + +print(max_num)" +p02623,s314382076,Wrong Answer,"N,M,K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(10**9+7) +B.append(10**9+7) +ans = 0 + +while True: + if A[0] >= B[0]: + K = K- B[0] + B = B[1:] + ans +=1 + else: + K = K-A[0] + A = A[1:] + ans +=1 + if K <0: + break +print(ans-1)" +p02623,s448824277,Wrong Answer,"n,m,k = map(int,input().split()) +lsa = list(map(int,input().split())) +lsb = list(map(int,input().split())) +import numpy +na = [e for e in numpy.cumsum(numpy.array(lsa)) if e <= k] +nb = [e for e in numpy.cumsum(numpy.array(lsb)) if e <= k] +mx = 0 +for i in range(len(na)): + for j in range(len(nb)): + a = na[i]+nb[j] + if a <= k: + if i+j+2 > mx: + mx = i+j+2 +print(mx)" +p02623,s463355070,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +book = sorted(A + B) +#print(book) +count = 0 +ans = 0 +for bo in book: + if count + bo <= K: + #print(count) + count += bo + ans += 1 +print(ans) +" +p02623,s392086247,Wrong Answer,"x = input().split() +y = input().split() +z = input().split() +s = 0 +for nn in range(2000000): + y.append(10000000001) + z.append(10000000001) +for nn in range(2000000): + if int(x[2]) < 0: + break + if int(y[0]) <= int(z[0]) : + x[2] = int(x[2]) - int(y[0]) + del y[0] + s += 1 + else: + x[2] = int(x[2]) - int(z[0]) + del z[0] + s += 1 +print(s-1)" +p02623,s344643099,Wrong Answer,"a,c,v=map(int,input().split()) +arr1=list(map(int,input().strip().split()))[:a] +arr2=list(map(int,input().strip().split()))[:c] +arr3=arr1+arr2 +arr3.sort() +sum=0 +ct=0 +for x in range(0,(a+c)): + sum=sum+arr3[x] + ct+=1 + if(sum>=v): + break +if(sum>v): + print(ct-1) +else: + print(ct) + +" +p02623,s303456684,Wrong Answer,"import collections as cs + +N, M, K = map(int, input().split()) +A = cs.deque(map(int, input().split())) +B = cs.deque(map(int, input().split())) + +A.append(K + 1) +B.append(K + 1) + +print(A) + +count = 0 +time = 0 +num = len(A) + len(B) + +for i in range(num): + if A[0] <= B[0]: + if A[0] + time <= K: + time += A.popleft() + count += 1 + + elif A[0] > B[0]: + if B[0] + time <= K: + time += B.popleft() + count += 1 + +print(count)" +p02623,s279728069,Wrong Answer,"n,m,k,*x=map(int,open(0).read().split()) +s=sum(x[:n]) +z=i=j=n +while~i: + while j0: + if t>k: + j -= 1 + t -= b[j] + continue + ans = max(ans,i+j) + break + if i==n:break + t += a[i] + +print(ans) + " +p02623,s242862157,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +for i in range(1,n): + a[i] += a[i-1] +for i in range(1,m): + b[i] += b[i-1] +a = [0]+a +b = [0]+b + +ans = 0 +ALL = 0 +from bisect import bisect +for i in range(1,n+1): + ALL = a[i] + if ALL > k: + continue + else: + idx = bisect(b,k-ALL) + #print(i,ALL,idx) + ans = max(ans,i+idx-1) +print(ans)" +p02623,s431171326,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +reading = 0 +read_book = 0 +i = 0 +while reading < K: + if i+1 <= N: + reading += A[i] + if reading <= K: + read_book += 1 + else: + break + if i+1 <= M: + reading += B[i] + if reading <= K: + read_book += 1 + else: + break + i += 1 + +print(read_book)" +p02623,s271192793,Wrong Answer,"N,M,K = map(int,input().split()) + +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +sumA = sum(A) + +ans = [] +best = M + +for i in range(N): + sumB = sum(B) + for j in range(best): + S = sumA + sumB + if S <= K: + best = j + ans.append(N+M-i-j) + break + sumB -= B[M-1-j] + sumA -= A[N-1-i] + +if ans == []: + print(0) +else: + print(max(ans))" +p02623,s996298736,Wrong Answer,"import numpy as np +n,m,k = list(map(int, input().split())) +a_list = np.array(input().split()).astype(int) +b_list = np.array(input().split()).astype(int) +ans_list=[] +for i in range(n): + for l in range(m): + if sum(a_list[:i]) + sum(b_list[:l]) <= k: + ans_list.append(i+l) + + +print(max(ans_list))" +p02623,s218962462,Wrong Answer,"import numpy as np +N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +A_np = np.array(A) +B_np = np.array(B) + +C_np = np.append(A_np,B_np) +C_np = np.sort(C_np) +y=0 +for i in range(len(C_np)): + if K >= C_np[i]: + K -= C_np[i] + y += 1 + else: + break +print(y)" +p02623,s029690798,Wrong Answer,"n,m,k=list(map(int,input().split())) +A=list(map(int,input().split())) + [10**9+1] +B=list(map(int,input().split())) + [10**9+1] +time,ans = 0,0 +a_idx,b_idx=0,0 + +while time <= k and (a_idx != n or b_idx != m): + if A[a_idx] <= B[b_idx] and a_idx < n: + time += A[a_idx] + a_idx += 1 + ans += 1 + elif A[a_idx] > B[b_idx] and b_idx < m: + time += B[b_idx] + b_idx += 1 + ans += 1 + +if time > k: + print(ans-1) +else: + print(ans)" +p02623,s968582745,Wrong Answer,"M, N, K = map(int, input().split()) +A = map(int,input().split()) +B = map(int,input().split()) +C = list(A) + list(B) +H = 0 +N = 0 +if min(C) < K: + while H < K: + min_hour = min(C) + H += min_hour + if H <= K: + N += 1 + C.remove(min_hour) +print(N)" +p02623,s445802262,Wrong Answer,"n,m,k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +cnt = 0 +ans = -1 +while cnt <= k: + ans += 1 + if len(a) == 0 and len(b) == 0: + break + elif len(a) == 0: + cnt += b.pop(0) + elif len(b) == 0: + cnt += a.pop(0) + else: + if a[0] >= b[0]: + cnt += b.pop(0) + else: + cnt += a.pop(0) + +print(ans)" +p02623,s995522709,Wrong Answer,"N,M,K = input().split() +A = input().split() +B = input().split() + +cnt = 0 + +list = A + B +list = [int(s) for s in list] +list.sort() +ans = 0 + +for s in range(len(list)): + if list[s] <= int(K)-ans: + cnt += 1 + ans += list[s] + +print(cnt) +" +p02623,s698985878,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +sum = [] +a,b = [0],[0] +ans = 0 + +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +for i in range(N+M+1): + tmp = 0 + for j in range(i): + if a[j]+b[i-j] < K: + tmp = i+1 + ans = max(ans,i) + break + if tmp ==0: + break + +print(ans)" +p02623,s156430541,Wrong Answer,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +Asum = [0] +Bsum = [0] +a = 0 +b = 0 +for i in range(N): + a += A[i] + Asum.append(a) +for i in range(M): + b += B[i] + Bsum.append(b) +Asum.append(0) +Bsum.append(0) +res, j = 0, 0 +for i in range(N+1): + if Asum[i] > K: + break + while Asum[i] + Bsum[j] > K: + j += 1 + res = max(res,i+j) +print(res)" +p02623,s759247336,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +def sigma(func, frm, to): + result = 0; + for i in range(frm, to+1): + result += func[i-1] + return result + +a=list() +for i in range(N): + for j in range(M): + if sigma(A,1,i)+sigma(B,1,j)<=K: + a.append(i+j) +print(max(a))" +p02623,s927729795,Wrong Answer,"from itertools import zip_longest, count, accumulate +from bisect import bisect, bisect_left + +def LIST(): return list(map(int, input().split())) + +n, m, k = map(int, input().split()) +a = [0] + list(accumulate(LIST())) +b = list(accumulate(LIST())) + +num = 0 + +for i, a in enumerate(a): + time_rest = k - a + + if time_rest < 0: + continue + + num = max(num, i + bisect_left(b, time_rest)) + +print(num)" +p02623,s631307865,Wrong Answer,"n, m, k = map(int, input().split()) +a_list = list(map(int, input().split())) +b_list = list(map(int, input().split())) + +ans = 0 +ai = 0 +bi = 0 +t = 0 +for i in range(n+m): + if t > k: + break + if ai >= n: + t += b_list[bi] + bi += 1 + ans += 1 + elif bi >= m: + t += a_list[ai] + ai += 1 + ans += 1 + elif a_list[ai] > b_list[bi]: + t += b_list[bi] + bi += 1 + ans += 1 + else: + t += a_list[ai] + ai += 1 + ans += 1 +if t <= k: + print(ans) +else: + print(ans-1)" +p02623,s662901293,Wrong Answer,"n, m, k = map(int, input().split()) +an = list(map(int, input().split())) +bn = list(map(int, input().split())) +ls = an[::-1] + bn +l = 0 +r = 0 +s = 0 +ans = 0 +while r < n + m: + if s <= k: + ans = max(ans, r - l) + s += ls[r] + r += 1 + else: + s -= ls[l] + l += 1 +if s <= k: + ans = max(ans, r-l) +print(ans) + + " +p02623,s733310824,Wrong Answer,"N,M,K = map(int,input().split()) + +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +sumA = sum(A) + +ans = [] +print(A,B) + +for i in range(N): + sumB = 0 + sumB = sum(B) + for j in range(M): + S = sumA + sumB + sumB -= B[M-1-j] + if S > K: + continue + else: + ans.append(N+M-i-j) + break + sumA -= A[N-1-i] + +if ans == []: + print(0) +else: + print(max(ans))" +p02623,s258043859,Wrong Answer,"n,m,k = map(int,input().split()) +a_list = list(map(int,input().split())) +b_list = list(map(int,input().split())) +c_list = a_list + b_list +count = 0 +time = 0 +c_list.sort() +for i in range(n+m): + if time + c_list[i] <= k: + count += 1 + time += c_list[i] + +print(count)" +p02623,s040076614,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +mmax = 0 +pre = False +num = 0 +ans = 0 +ans2 = 0 +for i in range(N+1): + if i == 0: + ans = 0 + else: + ans += A[i-1] + if ans > K: + break + for j in range(M+1): + if j == 0: + ans2 = ans + else: + ans2 += B[j-1] + if ans2 > K: + break + else: + mmax = max(mmax, i+j) + print(i, j, ans2, mmax) + +print(mmax)" +p02623,s111412690,Wrong Answer,"from bisect import bisect_right + +n, m, k = map(int, input().split()) +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] +A = [0] +B = [0] +for i in range(n): + A.append(A[-1] + a[i]) +for j in range(m): + B.append(B[-1] + b[j]) + +ans = 0 +for i in range(n + 1): + time = A[i] + b_index = 0 + if time > k: + continue + if k - time > 0: + b_index = bisect_right(B, k - time) + ans = max(ans, i + b_index - 1) +print(ans)" +p02623,s450256703,Wrong Answer,"n,m,k = map(int, input().split()) +an = list(map(int, input().split())) +bn = list(map(int, input().split())) +book = n + m +nokori = k +Ans = book +an.append(1000000000) +bn.append(1000000000) +for i in range(book): + if an[0] <= bn[0]: + nokori = nokori - an[0] + del an[0] + elif an[0] > bn[0]: + nokori = nokori - bn[0] + del bn[0] + if nokori < 0: + Ans = i + break +print(Ans)" +p02623,s633794023,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a.extend(b) + +time = 0 +count = 0 +for x in a: + if time > k: + count -= 1 + break + time += x + count += 1 +print(count)" +p02623,s716132959,Wrong Answer,"N, M, K = input().split() +N, M, K = map(int, (N, M, K)) +a = input().split() +b = input().split() + +def to_init(list): + for i in range(len(list)): + list[i] = int(list[i]) + return list + +c = [] +c = a + b +# print(c) +# change for int +to_init(c) +d = sorted(c) +minuite = 0 +cnt_book = 0 +for i in d: + if minuite + i <= K: + minuite += i + cnt_book += 1 + else: + break + +print(cnt_book)" +p02623,s418274192,Wrong Answer,"import sys +sys.setrecursionlimit(10 ** 7) +input = sys.stdin.readline + +n, m, k = map(int, input().split()) +a = list( map(int, input().split())) +b = list( map(int, input().split())) + + +from itertools import accumulate +aacc = [0] + a +aacc = list(accumulate(aacc)) +bacc = [0] + b +bacc = list(accumulate(bacc)) + +from bisect import bisect_right +ans = 0 +for i, ac in enumerate(aacc): + if k-ac>0: + index = bisect_right(bacc, max(0,k-ac)) + ans = max(ans, i+index-1) + +print(ans) +" +p02623,s220315673,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +ac = 0 +bc = 0 +ans = 0 +t = 0 +while t b[bc]: + t += b[bc] + bc +=1 + else: + t+= a[ac] + ac+=1 + elif ac == n: + t += b[bc] + bc +=1 + print(t) + elif bc == m: + t+= a[ac] + ac+=1 + else: + break + ans+=1 + +print(ans)" +p02623,s595850736,Wrong Answer,"N ,M ,K = map(int, input().split()) +#K = int(K/10) +#print(K) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +m = 0 + +for i in range(1, N+1): + total = A[:i] + total = sum(total) + if total > K: + break + mi = i + for j in range(M): + total += B[j] + if total > K: + break + #print(total) + mi += 1 + + m = max(m, mi) + + +print(m)" +p02623,s560682144,Wrong Answer,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +ai = 0 +bi = 0 +ans = 0 + +for _ in range(n+m): + if ai < n: + a = A[ai] + else: + a = 10e10 + if bi < m: + b = B[bi] + else: + b = 10e10 + if a > b: + k -= b + bi += 1 + else: + k -= a + ai += 1 + if k < 0: + break + ans += 1 + + +print(ans) + + " +p02623,s720393320,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +s_a = [0] +s_b = [0] +for i in range(n): + s_a.append(s_a[i] + a[i]) +for i in range(m): + s_b.append(s_b[i] + b[i]) + +ans = 0 +ok = m +for i in range(n+1): + for j in range(ok+1)[::-1]: + if s_a[i] + s_b[j] <= k: + ans = max(ans, i+j) + tmp = j + ok = tmp + +print(ans)" +p02623,s895547578,Wrong Answer,"n,m,k = list(map(int,input().split())) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +max_n = 0 + +for i in range(n): + for j in range(m): + if sum(a[:i])+sum(b[:j]) > k: + max_n = max(i+j-1 ,max_n) + print(i,j,sum(a[:i])+sum(b[:j])) + break + +print(max_n)" +p02623,s863687650,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + + +ans, j = 0, M +anss = [] +for i in range(1, 1+N): + if a[i] > K: + break + while 1: + if a[i] + b[j] <= K: + break + j -= 1 + + ans = max(ans, i+j) + + +print(ans)" +p02623,s796643997,Wrong Answer,"n,m,k = map(int, input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +c = a + b +ans = 0 + +c.sort() +#print(c) + +for i in range(n+m): + if k - c[i] >= 0: + k -= c[i] + ans += 1 + else: + break +print(ans)" +p02623,s212917154,Wrong Answer,"import numpy +def main(): + N,M,K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + cumsA = numpy.cumsum(A) + cumsB = numpy.cumsum(B) + ans = 0 + for i,ca in enumerate(cumsA): + if ca<=K: + b=numpy.sum(cumsB<=(K-ca)) + ans=i+1+b + print(ans) + +main() +" +p02623,s709440752,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +read = 0 +count = 0 + +for i in range(len(a)+len(b)): + if read <= k: + if len(a) == 0: + read += b.pop(0) + count += 1 + elif len(b) == 0: + read += a.pop(0) + count += 1 + elif a[0] < b[0]: + read += a.pop(0) + count += 1 + else: + read += b.pop(0) + count += 1 + else: + count -= 1 + break + +print(count)" +p02623,s988170589,Wrong Answer,"import bisect +n,m,k = map(int,input().split()) +a= list(map(int,input().split())) +b= list(map(int,input().split())) +at=[0] +bt=[] +temp=0 +for i in a: + temp+=i + at.append(temp) +temp=0 +for i in b: + temp+=i + bt.append(temp) +ans=0 +for i in range(len(at)): + if at[1]>k and bt[0]>k: + break + ind= bisect.bisect_right(bt,k-at[i]) + ans= max(ans, ind+i) +print(ans) +" +p02623,s680314339,Wrong Answer,"import numpy as np + +def main(): + n,m,k=map(int,input().split()) + a=list(map(int,input().split())) + b=np.array(list(map(int,input().split()))) + b=np.cumsum(b) + k0=k+1 + b0=np.searchsorted(b,k) + r=b0 + i=0 + for i, ia in enumerate(a): + k0=k0-ia + if k0<0: + break + b0=np.searchsorted(b,k0) + b0+=i+1 + if b0 > r: + r=b0 + print(r) +main()" +p02623,s897066076,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +books = sorted(A + B) + +ans = len(books) +for i, t in enumerate(books): + if K < t: + ans = i + break + K -= t + +print(ans)" +p02623,s158587388,Wrong Answer,"N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = a + b +c.sort() +count = 0 +t = 0 +for i in range(len(c)): + t += c[i] + if t > K: + print(i) + exit() +print(len(c))" +p02623,s015909569,Wrong Answer,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +Asum = [0] +Bsum = [0] +a = 0 +b = 0 +for i in range(N): + a += A[i] + Asum.append(a) +for i in range(M): + b += B[i] + Bsum.append(b) +Asum.append(0) +Bsum.append(0) +res, j = 0, 0 +for i in range(N+1): + if Asum[i] > K: + break + while Asum[i] + Bsum[j] > K: + j -= 1 + res = max(res,i+j) +print(res)" +p02623,s310976586,Wrong Answer,"N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = [] +c = a + b +c.sort() +minuites = 0 +cnt_book = 0 +for min in c: + if minuites + min <= K: + minuites += min + cnt_book += 1 + else: + break +print(cnt_book)" +p02623,s840300622,Wrong Answer,"n, m, k = input().split() +a = input().split() +b = input().split() + +n = int(n) +m = int(m) +k = int(k) +a = list(map(int, a)) +b = list(map(int, b)) + +a.extend(b) +a.sort() + +add = 0 +cnt = 0 +for item in a: + if add > k: + break + add += item + cnt += 1 +print(cnt) +" +p02623,s605020004,Wrong Answer,"import bisect +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = A[0] +b = B[0] +a_lis = [a] +b_lis = [b] +for i in range(1,N): + a += A[i] + a_lis.append(a) +for j in range(1,M): + b += B[j] + b_lis.append(b) +ans = 0 +for i in range(N): + j = bisect.bisect_right(b_lis,K-a_lis[i]) + tmp_ans = i + j + 1 + if ans < tmp_ans: + ans = tmp_ans +print(ans)" +p02623,s628964332,Wrong Answer,"from collections import deque +n, m, k = map(int, input().split()) +a = deque(map(int, input().split())) +b = deque(map(int, input().split())) +t = 0 +c = 0 +while True: + if len(a) == 0 and len(b) == 0: + break + if len(a) == 0: + t += b.popleft() + elif len(b) == 0: + t += a.popleft() + else: + if a[0] >= b[0]: + t += b.popleft() + else: + t += a.popleft() + if t > k: + break + c += 1 +print(c)" +p02623,s100160218,Wrong Answer,"n,m,k = list(map(int,input().split())) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +c = 0 + +while k >= 0: + if len(a) != 0 and len(b) != 0: + p = a.pop(0) if a[0] < b[0] else b.pop(0) + elif len(a) == 0 and len(b) != 0: + p = b.pop(0) + elif len(a) != 0 and len(b) == 0: + p = a.pop(0) + else: + break; + k -= p + + if k >= 0: + c += 1 + +print(c)" +p02623,s871364595,Wrong Answer,"from collections import deque + +N, M, K = [int(n) for n in input().split()] +desk_a = deque([int(n) for n in input().split()]) +desk_b = deque([int(n) for n in input().split()]) + +print(2)" +p02623,s081197906,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +# k分以内 +ans=a+b +ans.sort() +i=0 +kotae=0 +while True: + if ans[i]+kotae>k: + break + else: + kotae+=ans[i] + i+=1 + if i>=len(ans): + print(len(ans)) + quit() +print(i)" +p02623,s893354934,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +ans = 0 +total = 0 +idx = -1 + +for i in range(N): + t = total + A[i] + if t > K: + break + total = t + ans += 1 + idx = i + +for j in range(M): + t = total + B[j] + if t > K: + # print(idx) + for k in range(idx, -1, -1): + t -= A[k] + if t <= K: + total = t + ans -= (idx - k - 1) + idx = k - 1 + else: + total = t + ans += 1 + +print(ans)" +p02623,s948246405,Wrong Answer,"from collections import deque +n, m, k = map(int, input().split()) +A = deque(map(int, input().split())) +B = deque(map(int, input().split())) + +cnt = 0 +while k >= 0: + if not A: + a = 10 ** 9 + else: + a = A.popleft() + if not B: + b = 10 ** 9 + else: + b = B.popleft() + if a <= b: + k -= a + B.appendleft(b) + cnt += 1 + else: + k -= b + A.appendleft(a) + cnt += 1 +print(cnt - 1) +" +p02623,s720092448,Wrong Answer,"from itertools import accumulate as ia +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = list(ia(A)) +b = list(ia(B)) +na = 0 +nb = 0 +for i in a: + if i <= K: + na += 1 + else: + break +for i in b: + if i <= K: + nb += 1 + else: + break +print(na, nb) +t = a[na-1] +for i in B: + if t + i > K: + break + else: + na += 1 + t += i +t = b[nb-1] +for i in A: + if t + i > K: + break + else: + nb += 1 + t += i +print(max(na, nb))" +p02623,s875058294,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +h, j = max(A), max(B) +fe = max(h,j) +c = 0 +time = 0 +num = N+M +while num > 0: + if A[0] < B[0]: + K -= A.pop(0) + elif A[0] > B[0]: + K -= B.pop(0) + c += 1 + if len(A) == 0: + A = A + [fe+1] + if len(B) == 0: + B = B + [fe+1] + num -= 1 +print(c)" +p02623,s633054922,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +t = 0 +cnt = 0 +i = 0 +j = 0 + +while True: + if i < N: + a = A[i] + else: + a = 10 ** 10 + if j < M: + b = B[j] + else: + b = 10 ** 10 + if t + a > K and t + b > K: + break + + if a < b: + t += a + i += 1 + else: + t += b + j += 1 + cnt += 1 +print(cnt)" +p02623,s501295893,Wrong Answer,"N, M, K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +list = [] +tmp = 0 +count = 0 +while len(A) != 0 and len(B) != 0: + if A[0] < B[0]: + list.append(A.pop(0)) + else: + list.append(B.pop(0)) + if len(A) == 0: + list.extend(B) + elif len(B) == 0: + list.extend(A) +while len(list) != 0: + tmp += list.pop(0) + if tmp > K: + break + count += 1 +print(count)" +p02623,s918275453,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +ans = 0 +for i in range(1, N+1): + for j in range(1, M+1): + a = sum(A[:i]) + b = sum(B[:j]) + if a + b <= K: + ans = max(ans, i + j) +print(ans)" +p02623,s942084669,Wrong Answer,"N,M,K=map(int,input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +ans1=0 +i=0 +while iK : + print(ans1) + ans1=ans1-A[i-1] + break +ans2=0 +j=0 +while jK : + ans2=ans2-B[j-1] + break +print(i+j)" +p02623,s323863682,Wrong Answer,"from collections import deque +n,m,k=map(int,input().split()) +A=deque(list(map(int,input().split()))) +B=deque(list(map(int,input().split()))) + +point=0 +while k>0: + try: + if len(A)!=0 and len(B)!=0: + if A[0]>B[0]:k -=B.popleft() + else:k -=A.popleft() + elif len(A)==0:k -=B.popleft() + elif len(B)==0:k -=A.popleft() + + if k>=0:point +=1 + else:break + except:break +print(point)" +p02623,s064490314,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ans = 0 + +a.append(10 ** 9 + 1) +b.append(10 ** 9 + 1) + +while True: + if min(a[0], b[0]) > 10 ** 9 or min(a[0], b[0]) > k: + break + + if a[0] <= b[0]: + k -= a.pop(0) + ans += 1 + else: + k -= b.pop(0) + ans += 1 +print(ans)" +p02623,s836831240,Wrong Answer,"import sys +stdin = sys.stdin +sys.setrecursionlimit(10**6) +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) +nn = lambda: list(stdin.readline().split()) +ns = lambda: stdin.readline().rstrip() + +n,m,k = na() +a = na() +b = na() +c = a+b +c.sort() +tl = 0 + +for i in range(n+m): + tl += c[i] + if tl > k: + print(i) + exit() + +print(n+m)" +p02623,s623571251,Wrong Answer,"N,M,K=map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +books = sorted(A+B) + +cnt=0 +max = N+M-1 + +while K >= 0: + + K-=books[cnt] + cnt+=1 + + if cnt > max: + cnt = N+M+1 + break + +print(cnt-1)" +p02623,s904029805,Wrong Answer,"a,b,c=map(int,input().split()) +li_a=list(map(int,input().split())) +li_b=list(map(int,input().split())) +for i in li_b: + li_a.append(i) +li_a.sort() +count=0 +while c>0: + + + c=c-li_a[count] + if c<0: + break + count+=1 + + +print(count)" +p02623,s492408508,Wrong Answer," +from bisect import bisect_left + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +x = [0] * (N + 1) +y = [0] * (M + 1) +for i in range(N): + x[i + 1] = x[i] + A[i] + +for i in range(M): + y[i + 1] = y[i] + B[i] + +ans = 0 +for i in range(N + 1): + if x[i] > K: + continue + j = bisect_left(y, K - x[i]) + if j < M and y[j] != K - x[i]: + j -= 1 + ans = max(ans, i + j) +print(ans) +" +p02623,s097961840,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +from itertools import accumulate +aa=list(accumulate(a)) +bb=list(accumulate(b)) + +from bisect import bisect_left,bisect + +kmax=0 +for i in range(n): + if k K))" +p02623,s972622829,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +cnt=0 +T=K +while(K>0): + if(A[0]=0): + K=last + cnt+=1 + else: + break +print(cnt) + + + + + +" +p02623,s044630323,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +a.sort() +b.sort() +ans=0 +i=0 +j=0 +while (k>=0 and i =0: + ans+=1 + +print(ans) + +" +p02623,s682053732,Wrong Answer,"N, M, K = map(int, input().split()) +As = [int(i) for i in input().split()] +Bs = [int(i) for i in input().split()] +x = 0 +i = 0 +while x < K: + if(As != [] and Bs != []): + if(As[0] >= Bs[0]): + x += Bs.pop(0) + i += 1 + elif(As[0] < Bs[0]): + x += As.pop(0) + i += 1 + elif(As == []): + x += Bs.pop(0) + i += 1 + elif(Bs == []): + x += As.pop(0) + i += 1 +print(i - 1)" +p02623,s046009937,Wrong Answer,"n, m, k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +total_time = 0 +num = 0 +i, j = 0, 0 +while num < (n+m): + if i == n and j < m: + total_time = total_time + B[j] + j += 1 + if j == m and i < n: + total_time = total_time + A[i] + i += 1 + if i < n and j < m: + if A[i] <= B[j]: + total_time = total_time + A[i] + i += 1 + else: + total_time = total_time + B[j] + j += 1 + if total_time > k: + break + num += 1 +print(num)" +p02623,s405828658,Wrong Answer," +def resolve(): + N, M, K = map(int, input().split()) + A = list(map(int, input().split())) + A += list(map(int, input().split())) + A.sort(reverse=True) + ans = 0 + time = 0 + while A: + a = A.pop() + if time+a > K: + break + time += a + ans += 1 + print(ans) + +if __name__ == ""__main__"": + resolve() +" +p02623,s864686987,Wrong Answer,"N, M ,K = [int(x) for x in input().split()] +A = [int(x) for x in input().split()] +B = list(map(int,input().split())) +newList = [] +z = 0 +while True: + if z < len(A): + newList.append(A[z]) + if z < len(B): + newList.append(B[z]) + z += 1 + if (z > len(A)) and (z > len(B)): + break + +while K >= 0: + if newList[0] > K: + break + K = K - newList[0] + newList.pop(0) + if len(newList) == 0: + break + + + +print((N+M) - len(newList)) + + +" +p02623,s143008996,Wrong Answer,"N, M, X = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +A.append(100000000000000000) +B.append(100000000000000000) +A.reverse() +B.reverse() + + +ans = 0 +c = 0 +while True: + if A[-1] > B[-1]: + b = B.pop() + if ans+b > X: + break + ans += b + c += 1 + else: + a = A.pop() + if ans+a > X: + break + ans += a + c += 1 +print(c) + +" +p02623,s695844376,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +a.append(10**9) +b.append(10**9) +# k分以内 +ans=0 +i=0 +while True: + if a[0]>b[0]: + ans+=b.pop(0) + else: + ans+=a.pop(0) + + if ans>k: + print(i) + quit() + i+=1" +p02623,s526230800,Wrong Answer,"import sys +input = sys.stdin.readline +N,M,K= [int(x) for x in sys.stdin.readline().split()] + +A = [int(x) for x in sys.stdin.readline().split()] + +B = [int(x) for x in sys.stdin.readline().split()] + +a = sorted(A + B) + +# print(a) + +time = 0 +i = 0 +ans = 0 +while True: + # print(i) + if i == len(a): + break + if time + a[i] <= K: + time += a[i] + i += 1 + continue + else: + break +print(i)" +p02623,s595334487,Wrong Answer,"# -*- coding: utf-8 -*- +n, m, k = map(int, input().split()) + +alist = input().split() +blist = input().split() + +work = k +acount = 0 +while (acount < n) and (work >= int(alist[acount])): + work -= int(alist[acount]) + acount += 1 + +maxCount = acount +bCount = 0 +for num in range(0, acount): + if (num > 1): + work += int(alist[acount-num]) + + while (bCount < m) and (work >= int(blist[bCount])): + work -= int(blist[bCount]) + bCount += 1 + maxCount = max(maxCount, acount-num+bCount) + + + + +print(maxCount) +" +p02623,s454101306,Wrong Answer,"A,B,Time=[int(x) for x in input().split()] +ArrayA=[int(x) for x in input().split()]+[10**10] +ArrayB=[int(x) for x in input().split()]+[10**10] +TotalTime=0 +x,y=0,0 +while TotalTime<=Time: + if ArrayA[x]>ArrayB[y]: + TotalTime+=ArrayB[y] + y+=1 + #print(x,y) + continue + if ArrayA[x]ans: + ans=an+bn+1 + an+=1 +print(ans)" +p02623,s833072172,Wrong Answer,"N,M,K=map(int, input().split()) +A=list(map(int, input().split())) +B=list(map(int, input().split())) + +A_sum=[sum(A[:_+1]) for _ in range(len(A))] +B_sum=[sum(B[:_+1]) for _ in range(len(B))] + +ans=0 + +for i in range(len(A_sum)): + for h in range(len(B_sum)): + if A_sum[i]+B_sum[h]>K and A_sum[i]+B_sum[h-1]<=K and h>0: + ans=max(ans,i+1+h) + +print(ans) +" +p02623,s155438327,Wrong Answer,"def main(): + M, N, K = map(int, input().split()) + A = list(map(int, input().split())) + B = list(map(int, input().split())) + spent_time = 0 + count = 0 + AB = A + B + AB.sort() + + while(True): + if count == M + N: + break + temp = AB[count] + #print(temp, spent_time) + if spent_time + temp > K: + break + spent_time = spent_time + temp + count += 1 + + #print('----') + #print(spent_time) + print(count) + +main() +" +p02623,s300290713,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +la=len(A) +lb=len(B) +ia=0 +ib=0 +c=10**10 +ans=0 +while(ia+ib=b: + ib+=1 + else: + ia+=1 + if k>=dk:k-=dk + else:break + ans+=1 +print(ans)" +p02623,s859516159,Wrong Answer,"n,m,k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a = [0] +b = [0] +for i in range(n): + a.append(a[i]+A[i]) +for i in range(m): + b.append(b[i]+B[i]) +ans = -100 +for i in range(n): + if(a[i]>k): + break + for j in range(1,m): + if(a[i]+b[(-1)*j]>k): + break + ans = max(ans,i+j) +print(ans) +" +p02623,s561173374,Wrong Answer,"from bisect import * + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +a_b=[0] +for i in range(1,n+1): + a_b.append(a_b[i-1]+a[i-1]) + +b_b=[0] +for i in range(1,m+1): + b_b.append(b_b[i-1]+b[i-1]) + +ans=0 +for i in range(n+1): + t_ans=i + if t_ans>k: + break + t_ans+=bisect_right(b_b,k-a_b[i])-1 + ans=max(ans,t_ans) + +print(ans)" +p02623,s266408382,Wrong Answer,"n,m,k=map(int,input().split()) +a=[0]+list(map(int,input().split())) +b=[0]+list(map(int,input().split())) +for i in range(n): + a[i+1]+=a[i] +for i in range(m): + b[i+1]+=b[i] +from bisect import bisect_right +ans=0 +for i in range(n+1): + if k-a[i]>0: + r=bisect_right(b,k-a[i]) + ans=max(r+i-1,ans) + else: + break +print(ans)" +p02623,s195589932,Wrong Answer,"N, M, K = map(int, input().split()) +Ai = list(map(int, input().split())) +Bi = list(map(int, input().split())) + +def p(x, k): + y = [] + n = 0 + for v in x: + n += v + if n > k: + break + y.append(n) + return y + +As = p(Ai, K) +Bs = p(Bi, K) + +n = 0 +for i in range(len(As)): + k = K - As[i] + n = max(n, i+1) + for j in range(len(Bs)): + if Bs[j] > k: + break + n = max(n, i+j+2) + +print(n) +" +p02623,s767159631,Wrong Answer,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +l = 0 +r = n + m + 1 +while r - l > 1: + p = (l + r) // 2 + total = min(sum(A[:i]) + sum(B[:p - i]) for i in range(p)) + if total <= k: + l = p + else: + r = p +print(l)" +p02623,s079875409,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +count = 0 + +for i in range(M+N): + if A[0] <= B[0]: + K = K - A[0] + if K < 0: + break + count += 1 + A.pop(0) + if not A: + A.append(10**9) + elif A[0] >= B[0]: + K = K - B[0] + if K < 0: + break + count += 1 + B.pop(0) + if not B: + B.append(10**9) + +print(count)" +p02623,s703017000,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +s=0 +t=0 +i=n+m +while s==0: + for j in range(n): + if i-(j+1)<=m: + t=sum(a[0:j])+sum(b[0:i-j]) + if 0k and j>=0: j-=1 + ans=max(i+j+2,ans) +print(ans)" +p02623,s568675476,Wrong Answer,"import itertools +import bisect +N, M, K = map(int,input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A_ = list(itertools.accumulate(A)) +B_ = list(itertools.accumulate(B)) + +ans = 0 +l = len(A_) + +for idx, i in enumerate(A_): + if i <= K: + ans = max(idx+1 + bisect.bisect_right(B_, K-i), ans) +print(ans)" +p02623,s478370315,Wrong Answer,"n, m, k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +a[0:0]=[0] +b[0:0]=[0] + +ans, j = 0, m + +for i in range(n + 1): + if a[i] > k: + break + while b[j] > k - a[i]: + j -= 1 + ans = max(ans, i + j) + +print(ans)" +p02623,s083538388,Wrong Answer,"n,m,k=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +ans=0 +for i in range(n+m+1): + for a in range(i+1): + b=i-a + t=sum(A[:a])+sum(B[:b]) + if t>k:continue + ans=max(ans,a+b) +print(ans)" +p02623,s606814748,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +calc_A = [0] +calc_B = [0] + +for i in range(N): + calc_A.append(calc_A[i] + A[i]) + +for j in range(M): + calc_B.append(calc_B[j] + B[j]) + +ans = 0 +j = M + +for i in range(N+1): + if calc_A[i] > K: + break + while calc_B[j] > K - calc_A[i]: + j -= 1 + ans = max(0, i+j) + +print(ans)" +p02623,s789142280,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ans = -1 +while k > 0: + if len(a)==0: + k -= b[0] + del b[0] + elif len(b)==0: + k -= a[0] + del a[0] + elif a[0] < b[0]: + k -= a[0] + del a[0] + else: + k -= b[0] + del b[0] + ans += 1 +if len(a)==0 and len(b)==0: + ans += 1 +print(ans)" +p02623,s618615979,Wrong Answer,"N,M,K = map(int, input().split()) +A = map(int, input().split()) +B = map(int, input().split()) + +sa = [0] +for i, val in enumerate(A): + sa.append(sa[i] + val) + +sb = [0] +for i, val in enumerate(B): + sb.append(sb[i] + val) + +max_num = 0 +ind_max = M +for i in range(N+1): + if(sa[i]>K): + break + for k in range(ind_max): + if(sb[M-k]<=K-sa[i]): + break + ind_max -= 1 + + max_num = max(max_num,i+M-k) + + + +print(max_num)" +p02623,s294719376,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +a.sort() +b.sort() + +s,c = 0,0 +if a[0] < k or b[0] < k: + for i in range(m+n): + if s < k and i < len(a): + s += a[i] + c += 1 + if s B[-1]: + A, B = B, A + x = A.pop() + if K >= x: + n += 1 + K -= x + else: + break + +print(n)" +p02623,s802065120,Wrong Answer,"from sys import stdin +from bisect import bisect +input = stdin.readline + +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +for i in range(1, N): + A[i] += A[i - 1] + +for i in range(1, M): + B[i] += B[i - 1] + +ans = 0 + +for i, a in enumerate(A): + time = K - a + if time < 0: + continue + cnt = i + 1 + cnt += bisect(B, time) + ans = max(ans, cnt) + +print(ans) +" +p02623,s270503433,Wrong Answer,"from collections import deque +n, m, k = map(int, input().split()) +A = deque(map(int, input().split())) +B = deque(map(int, input().split())) + +cnt = 0 +while k >= 0: + if not A: + a = 10 ** 11 + else: + a = A.popleft() + if not B: + b = 10 ** 11 + else: + b = B.popleft() + if a <= b: + k -= a + B.appendleft(b) + cnt += 1 + else: + k -= b + A.appendleft(a) + cnt += 1 +print(cnt - 1) +" +p02623,s532357584,Wrong Answer,"import bisect +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +for i in range(1, n): + a[i] += a[i-1] +for i in range(1, m): + b[i] += b[i-1] + +I = bisect.bisect_right(a, k) +ans = bisect.bisect_right(b, k) +li = list(range(I)) +li = li[::-1] +for i in li: + tmp = bisect.bisect_right(b, k-a[i]) + if a[i] + b[tmp-1] <= k: + ans = max(ans, i+tmp+1) + +print(ans)" +p02623,s073307010,Wrong Answer,"from itertools import accumulate as ia +N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +a = set(ia(A)) +b = set(ia(B)) +na = 0 +nb = 0 +ans = 0 +for i in a: + if i > K: + break + else: + na += 1 + nb = 0 + for j in b: + if i + j > K: + break + else: + nb += 1 + ans = max(ans, na + nb) +if ans == 0: + for i in b: + if i <= K: + ans += 1 +print(ans)" +p02623,s449800568,Wrong Answer,"import math +import sys +input=sys.stdin.readline +N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +idA,idB=0,0 +cnt,time=0,0 +mx=10000000000 +while(True): + if(idA>=N and idB>=M): + break + if(idA==N): + A.append(mx) + if(idB==M): + B.append((mx)) + if(time+min(A[idA],B[idB])>K): + break + elif(A[idA] K - ar[i]: + j -= 1 + max_read = max(max_read, i+j) + +print(max_read) +" +p02623,s491185506,Wrong Answer,"import itertools +import bisect + +n,m,k=map(int,input().split()) +a=[0]+list(map(int,input().split())) +b=list(map(int,input().split())) +aa=list(itertools.accumulate(a)) +bb=list(itertools.accumulate(b)) +r=0 +for i,ax in enumerate(aa): + bis=bisect.bisect_right(bb,k-ax) + if bis==0:print(r);exit() + r=max(r,i+bis) +print(r)" +p02623,s224932072,Wrong Answer,"from collections import deque +n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ad = deque(a) +ad.append(float('inf')) +bd = deque(b) +bd.append(float('inf')) +count = 0 +while True: + k = k - min(ad[0],bd[0]) + if k >= 0: + if ad[0] > bd[0]: + bd.popleft() + else: + ad.popleft() + count += 1 + else: + break +print(count)" +p02623,s310460770,Wrong Answer,"from itertools import accumulate + +n,m,k = [int(i) for i in input().split()] +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] + +la = [0] + list(accumulate(a)) +lb = [0] + list(accumulate(b)) + +ans = 0 +i = n +for j in range(m+1): + while la[i]+lb[j] > k and i>=0: + i -= 1 + if i==0 and lb[j] > k: + break + ans = max(ans, i+j) + +print(ans) +" +p02623,s461930122,Wrong Answer,"n,m,k = map(int,input().split("" "")) +a = list(map(int, input().split("" ""))) +b = list(map(int, input().split("" ""))) +total,count = 0,0 +for i in range(max(n,m)): + if i < n: + if total+a[i] > k: + break + else: + total += a[i] + count +=1 + if i < m: + if total+b[i] > k: + break + else: + total += b[i] + count += 1 +print(count)" +p02623,s306648613,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +idx=N-1 +ans=0 +for i in range(N-1): + A[i+1]+=A[i] +for i in range(M-1): + B[i+1]+=B[i] + +for i in range(N): + if A[i]>K: + idx=i-1 + break + +idx2=-1 +for i in range(idx,-1,-1): + while idx2 K: + break + n = bisect_right(B, K-a) + ans = max(ans, i+n+1) + +print(ans)" +p02623,s982293872,Wrong Answer,"N, M, K = map(int, input().split()) + +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +C = A + B +C.sort() + +count = 0 + +for i in C: + if i <= K: + K -= i + count += 1 + +print(count)" +p02623,s285936907,Wrong Answer,"from collections import deque as q +import bisect + +N,M,K=map(int,input().split()) +As=q(map(int,input().split())) +Bs=q(map(int,input().split())) + +s=[0]*(N+M) +c=0 +for i in range(N+M): + if len(As)==0: + book=Bs.popleft() + elif len(Bs)==0: + book=As.popleft() + else: + if As[0] < Bs[0]: + book=As.popleft() + else: + book=Bs.popleft() + c+=book + s[i]=c +i=bisect.bisect(s,K) +print(i)" +p02623,s379104987,Wrong Answer,"n,m,k=[int(_) for _ in input().split()] +A=[int(_) for _ in input().split()] +B=[int(_) for _ in input().split()] +jikan=0 +yomi=0 +while (A or B): + if A and B: + if A[0] e[0]: + c -= e[0] + e.pop(0) + else: + c -= d[0] + d.pop(0) + except IndexError: + if len(d) == 0 and len(e) == 0: + break + if len(d) == 0: + c -= e[0] + e.pop(0) + else: + c -= d[0] + d.pop(0) + n += 1 + if c < 0: + break +print(n) + " +p02623,s064256344,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=0 + +for x in range(n): + sum1=0 + ans1=0 + + sum1=sum(a[0:x]) + if sum1>k: + break + else: + ans1+=1 + for y in range(m): + + + sum1+=b[y] + if sum1>k: + break + else: + ans1+=1 + if ans1>ans: + ans=ans1 + +print(ans) + " +p02623,s373039102,Wrong Answer,"n,m,k = map(int,input().split()) +A = [int(p) for p in input().split()] +B = [int(p) for p in input().split()] +count = 0 + +for _ in range(n+m): + if A[0] > k and B[0] > k: + break + if A[0] < B[0]: + k -= A.pop(0) + count += 1 + else: + k -= B.pop(0) + count += 1 + if len(A)==0: + A.append((10**9)+1) + if len(B)==0: + B.append((10**9)+1) +print(count)" +p02623,s024332023,Wrong Answer,"import random +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ans=random.randint(0,n+m) +print(ans)" +p02623,s344131711,Wrong Answer,"n,m,k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a.append(300000) +b.append(300000) +c = [] +e = 0 +f = 0 +for i in range(len(a)): + b.append(a[i]) +while sum(c) < k: + if a[e] <= b[f]: + c.append(a[e]) + e += 1 + else: + c.append(b[f]) + f += 1 + +if 300000 in c: + c.remove(300000) +if sum(c) == k: + print(len(c)) +else: + print(len(c)-1)" +p02623,s779200706,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +from bisect import bisect_right +dpa = [0] +for a in A: + dpa.append(dpa[-1]+a) +dpb = [0] +for b in B: + dpb.append(dpb[-1]+b) +ans = 0 +for i in range(1, N+1): + t = dpa[i] + if t > K: + break + j = bisect_right(dpb, K-t) + ans = max(ans, i + j - 1) +print(ans)" +p02623,s722534582,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +a.append(10**9) +b.append(10**9) +# k分以内 +ans=0 +i=0 +while True: + ans+=min(a[0],b[0]) + if a[0]>b[0]: + b.pop(0) + else: + a.pop(0) + + if ans>k: + print(i) + quit() + i+=1" +p02623,s537123932,Wrong Answer,"[N, M, K] = [int(i) for i in input().split()] +A = [int(i) for i in input().split()] +B = [int(i) for i in input().split()] + +c = 0 + +A.append(10**10) +A.reverse() +B.append(10**10) +B.reverse() +a = A.pop() +b = B.pop() + +while True: + if a < b: + if K >= a: + c += 1 + K -= a + a = A.pop() + else: + break + else: + if K >= b: + c += 1 + K -= b + b = B.pop() + else: + break + +print(c)" +p02623,s890211407,Wrong Answer,"n,m,k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +from itertools import accumulate +import bisect +z = list(accumulate(sorted(a+b))) + +print(bisect.bisect_right(z, k))" +p02623,s681671892,Wrong Answer,"n,m,k = map(int, input().split()) +ln = list(map(int, input().split())) +lm = list(map(int, input().split())) + +def csum(l,ll): + s = 0 + res = [0] * ll + for i in range(ll): + s += l[i] + res[i] = s + return res + +csln = csum(ln,n) +cslm = csum(lm,m) + +import numpy as np + +lk = [k-x for x in csln if k-x >=0] +res = np.searchsorted(np.array(cslm), np.array(lk), side='right') +rmax = 0 +for i,j in zip(range(1,len(lk)+1), res): + rmax = max(rmax, i+j) +print(rmax)" +p02623,s091329013,Wrong Answer,"n,m,k=map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) + +ni = 0 +mi = 0 +ans = 0 + +for i in range(n+m): + if n == ni and m == mi: + break + elif n == ni: + ans += b[mi] + mi += 1 + elif m == mi: + ans += a[ni] + ni += 1 + elif a[ni] <= b[mi]: + ans += a[ni] + ni += 1 + else: + ans += b[mi] + mi += 1 + + if ans > k: + break + +cal = ni + mi +if k < ans : + cal -= 1 +print(cal) +" +p02623,s755048188,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +ans1 = 0 +for i in range(n-1): + a[i+1] = a[i]+a[i+1] +for i in range(m-1): + b[i+1] = b[i]+b[i+1] +import bisect +key = bisect.bisect(a,k) +for i in range(key+1): + ans = 0 + ans += key-i + time = a[key-i-1] + ans += bisect.bisect(b,k-time) + ans1 = max(ans1,ans) + + +print(ans1)" +p02623,s437151090,Wrong Answer,"import bisect +from itertools import accumulate + +n, m, k = map(int, input().split()) +a = tuple(accumulate(map(int, input().split()))) +b = tuple(accumulate(map(int, input().split()))) +s = 0 + +cnt = 0 +for i, j in enumerate(a): + s += j + if j <= k: + cnt = max(cnt, i + bisect.bisect_right(b, k - s) + 2) +print(cnt)" +p02623,s743005465,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +A.append(10**9+1) +A.append(10**9+1) +B.append(10**9+1) +B.append(10**9+1) +count=0 +time=0 +a_current=0 +b_current=0 +while time<=K: + if A[a_current]<=B[b_current]: + time+=A[a_current] + a_current=a_current+1 + else: + time+=B[b_current] + b_current+=1 + count+=1 +print(count-1)" +p02623,s900726515,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ruia=[0] +ruib=[0] +mx=0 +for (i,j) in zip(a,range(n)): + ruia.append(ruia[j]+i) + +for (i,j) in zip(b,range(m)): + ruib.append(ruib[j]+i) + +for i in range(n,-1,-1): + ans=-1 + if ruia[i]>k: + continue + for j in range(mx,m): + if ruia[i]+ruib[j]>k: + ans=i+j-1 + break + else: + ans=i+m + if ans>mx: + mx=ans +print(mx) +" +p02623,s548844437,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +sum = 0 +c = 0 +for i in range(n+m): + if len(a) and len(b) and a[0] < b[0]: + sum += a.pop(0) + elif len(b): + sum += b.pop(0) + else: + sum += a.pop(0) + if sum <= k: + c += 1 +print(c)" +p02623,s376681372,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +A.append(10**9) +B.append(10**9) +cnt=0 +for i in range(N+M): + if A[0]>B[0]: + K-=B[0] + B.pop(0) + else: + K-=A[0] + A.pop(0) + if K>=0: + cnt+=1 + else: + break +print(cnt)" +p02623,s681778151,Wrong Answer,"n,m,k=map(int,input().split()) + +L1=list(map(int,input().split())) +L2=list(map(int,input().split())) + +L=L1+L2 +L.sort() +result=0 +time=0 + +for i in range(n+m): + if result<=k: + result+=L[i] + time=i+1 + if result>k: + time=i + break + +print(time) + " +p02623,s853453850,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +A = A + [10 ** 10] +B = B + [10 ** 10] + +time = 0 +count = -1 +while time <= K: + if A[0] <= B[0]: + time += A.pop(0) + else: + time += B.pop(0) + count += 1 + +print(count) +" +p02623,s207654552,Wrong Answer,"def iteraccumulate(l): + from itertools import accumulate + return list(accumulate(l)) + + +def resolve(): + from bisect import bisect_right + n, m, k = map(int, input().split()) + a = list(map(int, input().split())) + b = list(map(int, input().split())) + aa = [0] + iteraccumulate(a) + bb = iteraccumulate(b) + ans = 0 + for index, i in enumerate(aa): + j = bisect_right(bb, k - i) + if i + bb[j - 1] <= k: + ans = max(ans, index + j) + print(ans) + + +if __name__ == '__main__': + resolve() +" +p02623,s986917668,Wrong Answer,"n, m, k = map(int,input().split()) +A = input().split() +B = input().split() +c = 0 +for i in range(len(B)): + if i < len(A): + if k >= int(A[i]): + k = k - int(A[i]) + c += 1 + if k >= int(B[i]): + k = k - int(B[i]) + c += 1 +print(c)" +p02623,s147694181,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +num = N+M +ans = 0 +for i in range(N): + for j in range(M): + total = sum(A[0:(i+1)]) + sum(B[0:(j+1)]) + if K >= total: + if i+j+2 > ans: + ans = i+j+2 +print(ans)" +p02623,s191927535,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) + +#1 + +import numpy as np +import bisect +acum=np.cumsum(a).tolist() +bcum=np.cumsum(b).tolist() + +ans=0 + +for i,c in enumerate(acum): + d=k-c + if d<0:break + j=bisect.bisect_right(bcum,d)-1 + + ans=max(ans,(i+1)+(j+1)) +print(ans)" +p02623,s766423569,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +timer = 0 +cnt = 0 +def append_float(tg_list): + if len(tg_list) == 0: + tg_list.append(float('inf')) + return tg_list +while timer <= k: + a = append_float(a) + b = append_float(b) + min_pop = min(a[0], b[0]) + if min_pop == a[0]: + timer += a.pop(0) + cnt += 1 + elif min_pop == b[0]: + timer += a.pop(0) + cnt += 1 +print(cnt)" +p02623,s851488004,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +sum = [] +a,b = [0],[0] +ans = 0 + +for i in range(N): + a.append(a[i]+A[i]) +for i in range(M): + b.append(b[i]+B[i]) + +for i in range(N+M+2): + tmp = 0 + for j in range(i): + if a[j]+b[i-j] < K: + tmp = 1 + ans = i + break + if tmp == 0: + break + +print(ans)" +p02623,s513918720,Wrong Answer,"n,m,k = list(map(int,input().split())) +a = list(map(int,input().split())) +b = list(map(int,input().split())) +c = 0 + +while k >= 0: + if len(a) == 0 and len(b) == 0: + break; + elif len(a) == 0: + p = b.pop(0) + elif len(b) == 0: + p = a.pop(0) + else: + p = a.pop(0) if a[0] > b[0] else b.pop(0) + + k -= p + if k >= 0: + c += 1 + +print(c)" +p02623,s272276448,Wrong Answer,"N,M,K=list(map(int,input().split())) +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +from itertools import accumulate +from collections import deque +A=deque(list(accumulate(A))) +B=deque(list(accumulate(B))) +A.appendleft(0) +B.appendleft(0) +ans1=0 +for i in range(N+1): + if A[i]>K: + ans1=i + break +else: + ans1=N +ans2=0 +ans3=0 +for i in range(ans1): + while i+ans2<=M and A[ans1-i]+B[i+ans2]<=K: + ans2+=1 + ans3=max(ans3,ans1+ans2-1) +print(ans3)" +p02623,s790032998,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +acc = sum(B) +j = M - 1 +if K >= acc + sum(A): + print(M + N) + exit() +ans = 0 if K < acc else M +for i in range(N): + acc += A[i] + if K >= acc: + ans = max(ans, i + j + 2) + continue + else: + while (K < acc) & (j > -1): + acc -= B[j] + j -= 1 + if K >= acc: + ans = max(ans, i + j + 2) +print(ans) +" +p02623,s550705254,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a.extend(b) + +time = 0 +count = 0 +for x in a: + if time > k: + break + time += x + count += 1 +print(count)" +p02623,s592723262,Wrong Answer,"N, M, K = map(int,input().split()) + +A = list(map(int,input().split())) +B = list(map(int,input().split())) + + +for i in range(M): + A.append(B[i]) + +A.sort() + +ans = 0 +count = 0 + +for i in range(N+M): + if ans + A[i] <= K: + ans += A[i] + count += 1 + else: + break + +print(count)" +p02623,s401607950,Wrong Answer,"N, M, K = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +arui = [0] * (N + 1) +brui = [0] * (M + 1) +for i in range(N): + arui.append(a[i] + arui[i]) +for i in range(M): + brui.append(b[i] + brui[i]) + +ans = 0 +for i in range(N + 1): + if arui[i] > K: + break + bcnt = M + while brui[bcnt] + arui[i] > K: + bcnt -= 1 + ans = max(ans, i + bcnt) + +print(ans)" +p02623,s318668883,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 +ans = max(ans, i + j) +print(ans) +" +p02623,s307638512,Wrong Answer,"import itertools +import bisect + +n, m, k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +cA = list(itertools.accumulate(A)) +cB = list(itertools.accumulate(B)) + +#print(cA) +#print(cB) + +ans = 0 +for i in range(n): + tmp = cA[-(i+1)] + if tmp <= k: + indb = bisect.bisect_left(cB, k - tmp) + #print(indb) + ans = max(ans, (n-i)+indb) + +print(ans)" +p02623,s413562487,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +ruia=[0] +ruib=[0] +mx=0 +for (i,j) in zip(a,range(n)): + ruia.append(ruia[j]+i) + +for (i,j) in zip(b,range(m)): + ruib.append(ruib[j]+i) +ans=0 +for i in range(n+1): + if ruia[i] > k: + break + while ruib[j] > k - ruia[i]: + m -= 1 + ans = max(ans, i + m) +print(ans) + +" +p02623,s441319861,Wrong Answer,"n,m,k = map(int,input().split()) +A=list(map(int,input().split()) ) +B=list(map(int,input().split()) ) + +for i in range(1,len(A)): + A[i] += A[i-1] +for i in range(1,len(B)): + B[i] += B[i-1] + +ans=0 + +for a in range(len(A)): + if A[a]>k: + break + ans = max(ans, a+1) + for b in range(len(B)): + if A[a] + B[b] > k: + break + + ans = max(ans, a+b+2) + +print(ans)" +p02623,s300164228,Wrong Answer,"import bisect +from itertools import accumulate + +N , M , K = map(int , input().split()) +a = list(map(int , input().split())) +b = list(map(int , input().split())) +a = list(accumulate(a)) +b = list(accumulate(b)) +a.insert(0,0) + +ans = 0 +for i in range(N + 1): + if a[i] > K: + break + ans = max(ans , bisect.bisect_right(b, K - a[i])) +print(ans) +" +p02623,s762132694,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +c=a+b +c.sort() +i=0 +sum=0 +while sum=0: + if n==i: + if m==j: + break + else: + k-=b[j] + j+=1 + elif m==j: + k-=a[i] + i+=1 + else: + mini=a[i] if a[i]b[j]: + j+=1 + else: + i+=1 + k-=mini + if k>=0: + ans+=1 +print(ans)" +p02623,s868992534,Wrong Answer,"n,m,k =map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +a.append(10**9+1) +b.append(10**9+1) +cnt = 0 +cnt2 = 0 +mo = 0 +for i in range(n+m): + if a[cnt] >= b[cnt2]: + mo += b[cnt2] + if mo > k: + print(cnt+cnt2) + exit(0) + cnt2+=1 + else: + mo += a[cnt] + if mo > k: + print(cnt+cnt2) + exit(0) + cnt += 1 +print(cnt+cnt2)" +p02623,s210066652,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +S=sum(A)+sum(B) +count=len(A)+len(B) + +for i in range(len(A)+len(B)): + if S > K: + if A[-1] >= B[-1]: + S -= A[-1] + count -= 1 + else: + S -= B[-1] + count -= 1 + +print(count)" +p02623,s713934930,Wrong Answer,"def main(): + n, m, k = map(int,input().split()) + A = list(map(int,input().split())) + B = list(map(int,input().split())) + C = [] + for x in range(n+1): + sumA = sum(A[0:x+1]) + for y in range(m+1): + sumB = sum(B[0:y+1]) + if sumA + sumB <= k: + C.append(sumA + sumB) + print(C) +main()" +p02623,s200868063,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) + +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) + +ans, j = 0, M +for i in range(N + 1): + if a[i] > K: + break + while b[j] > K - a[i]: + j -= 1 + ans = max(ans, i + j) +print(ans)" +p02623,s144361415,Wrong Answer,"import sys +N, M, K = map(int, input().split()) +A_list = list(map(int, input().split())) +B_list = list(map(int, input().split())) + +ans = 0 +for n in range(N): + for m in range(M): + if K < sum(A_list[:n+1]): + print(ans) + sys.exit() + + if K >= sum(A_list[:n+1])+sum(B_list[:m+1]): + ans = max(ans, n+m+2) + else: + break + +print(ans)" +p02623,s667085685,Wrong Answer,"from itertools import accumulate +import bisect +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +A=list(accumulate(a)) +B=list(accumulate(b)) + +ans=0 +for i in range(n): + if k-A[i]>=0: + c = bisect.bisect_right(B, k-A[i]) + ans = max(i+c+1,ans) +print(ans)" +p02623,s291854596,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ans = n + m +while sum(a) + sum(b) > k: + if len(a) == 0: + a.append(0) + if len(b) == 0: + b.append(0) + if sum(a) < sum(b): + del b[-1] + else: + del a[-1] + ans -= 1 +print(ans) +" +p02623,s180188754,Wrong Answer,"n, m, k = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +for _ in range(m): + A.append(10 ** 9 + 1) +for _ in range(n): + B.append(10 ** 9 + 1) +A.sort(reverse=True) +B.sort(reverse=True) +total = 0 +count = 0 +for i in range(n + m): + time = min(A[-1], B[-1]) + if A[-1] == time: + total += A.pop() + elif B[-1] == time: + total += B.pop() + if total > k: + break + count += 1 +print(count) +" +p02623,s965034943,Wrong Answer,"N, M, K = map(int, input().split()) +A = list(map(int, input().split())) +B = list(map(int,input().split())) +a,b = [0],[0] +for i in range(N): + a.append(a[i] + A[i]) + +for i in range(M): + b.append(b[i] + B[i]) +print(a) +print(b) + +totaltime = 0 +count,j = 0, M + +for i in range(N+1): + if a[i] > K: + break + while a[i] + b[j] > K: + j -= 1 + count = max(count,i + j) + +print(count)" +p02623,s169872746,Wrong Answer,"import itertools +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +sa = list(itertools.accumulate(a)) +sb = list(itertools.accumulate(b)) + +max = 0 + +for i in range(n + 1): + j = m -1 + while j > 0: + if (sa[i] + sb[j] <= k): + if i + j > max: + max = i + j + break + else: + j -= 1 +print(max)" +p02623,s448633624,Wrong Answer,"n,m,k=list(map(int,input().split())) +A=list(map(int,input().split())) + [10**9+1] +B=list(map(int,input().split())) + [10**9+1] +time,ans = 0,0 +a_idx,b_idx=0,0 + +while time < k and (a_idx != n or b_idx != m): + if A[a_idx] <= B[b_idx] and a_idx < n: + time += A[a_idx] + a_idx += 1 + ans += 1 + elif A[a_idx] > B[b_idx] and b_idx < m: + time += B[b_idx] + b_idx += 1 + ans += 1 + +if time > k: + print(ans-1) +else: + print(ans)" +p02623,s926352648,Wrong Answer,"a = input().split() +x = input().split() +y = input().split() +z = x + y +zz = [] +zz = list(map(lambda i: int(i), z)) +t = 0 +for i in range(len(zz)): + if t > int(a[2]): + break + t += sorted(zz)[i] +print(t)" +p02623,s106493193,Wrong Answer,"from itertools import accumulate + +n,m,k = [int(i) for i in input().split()] +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] + +la = [0] + list(accumulate(a)) +lb = [0] + list(accumulate(b)) + +ans = 0 +i = n +for j in range(m+1): + while la[i]+lb[j] > k and i>=0: + i -= 1 + ans = max(ans, i+j) + +print(ans) +" +p02623,s124755662,Wrong Answer,"from collections import deque + +N,M,K = map(int,input().split()) +Ali = list(map(int,input().split())) +Bli = list(map(int,input().split())) + +r = 0 +s = 0 +t = 0 + +for i in range(N): + if Ali[i] <= K-t: + r += 1 + t += Ali[i] + +for i in range(M): + if Bli[i] <= K-t: + r += 1 + t += Bli[i] + +for i in range(M): + if Bli[i] <= K-t: + s += 1 + t += Bli[i] + +for i in range(N): + if Ali[i] <= K-t: + s += 1 + t += Ali[i] + +print(max(r,s))" +p02623,s366976411,Wrong Answer,"import bisect + +n, m, k = map(int, input().split()) +a = [0] + list(map(int, input().split())) +b = [0] + list(map(int, input().split())) + +a_sum = [0]*(n+1) +b_sum = [0]*(m+1) + +for i in range(n): + a_sum[i+1] = a_sum[i] + a[i+1] +for j in range(m): + b_sum[j+1] = b_sum[j] + b[j+1] + +ans = 0 +for i in range(n+1): + j = bisect.bisect(b_sum, k - a_sum[i]) - 1 + tmp = i + j + ans = max(ans, tmp) + +print(ans)" +p02623,s712639423,Wrong Answer,"n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +c=sorted(a+b) +cnt=0 +ans=0 +flag=True +for i in c: + cnt+=i + if cnt>k: + flag=False + print(ans) + break + else: + ans+=1 +if flag: + print(n+m)" +p02623,s503768501,Wrong Answer,"import sys +# from math import sqrt, gcd, ceil, log +from bisect import bisect +from collections import defaultdict, Counter +inp = sys.stdin.readline +read = lambda: list(map(int, inp().strip().split())) + +# sys.setrecursionlimit(10**6) + + + +def solve(): + n, m, k = read() + arr1 = read(); arr2 = read() + for i in range(1, n):arr1[i] += arr1[i-1] + for i in range(1, m):arr2[i] += arr2[i-1] + i = 0; ans = 0 + while i < n and arr1[i] < k: + tem = i + bisect(arr2, k-arr1[i])+1 + ans = max(ans, tem) + i += 1 + print(ans) + + + + + + + + + +if __name__ == ""__main__"": + solve()" +p02623,s155216663,Wrong Answer,"import bisect +from itertools import accumulate +n,m,k=map(int,input().split()) +a=list(accumulate(map(int,input().split()))) +b=list(accumulate(map(int,input().split()))) +ans=0 +for i,x in enumerate(a): + y=k-x + if y>0: + j=bisect.bisect_right(b,y) + ans=max(ans,i+j+1) +print(ans) +" +p02623,s960718141,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +a, b = [0], [0] +for i in range(N): + a.append(a[i] + A[i]) +for i in range(M): + b.append(b[i] + B[i]) +res = 0 +output = 0 +for i in range(N + 1): + if K < a[i]: + break + else: + res = K - a[i] + #print(res) + num = 0 + j = 0 + while j <= M and b[j] <= res: + #print(""b:"",b[j]) + j += 1 + # print(j) + num = i + (j - 1) + if output <= num: + output = num +print(num)" +p02623,s594003339,Wrong Answer,"from sys import stdin,stdout +import bisect as bs +n,m,s=map(int, stdin.readline().split()) +dn=list(map(int, stdin.readline().split())) +dm=list(map(int, stdin.readline().split())) +pre=[dm[0]];s1=0 +for v in dm[1:]: + pre+=[dm[-1]+v] +m=bs.bisect_right(pre,s) +for i in range(n): + s1+=dn[i] + if s-s1>0:m=max(m,i+1+bs.bisect_right(pre,s-s1)) +print(m) +" +p02623,s819063814,Wrong Answer,"N,M,K=map(int,input().split()) +A=list(map(int,input().split())) +B=list(map(int,input().split())) +count=sum(B) +a=0 +ai = 0 +p=0 +for i in range(N): + print('s1:',count,ai,M) + while count>K: + count-=B[M-1] + M-=1 + print('s2:',count,ai,M) + count+=A[i] + a+=A[i] + ai+=1 + print('s3:',count,ai,M) + if count <= K: + p=max(p,ai+M) + print('s4',count,p,ai,M) + if a>K: + break +print(p) +" +p02623,s859748471,Wrong Answer,"from bisect import bisect_right + +def cumsum(a): + res = [] + res.append(a[0]) + for i in range(1, len(a)): + res.append(res[i - 1] + a[i]) + return res + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ca = cumsum(a) +cb = cumsum(b) + +ans = 0 +x = bisect_right(ca, k) +for i in range(x): + y = bisect_right(cb, k - ca[i]) + ans = max(ans, x + y) + +print(ans)" +p02623,s836270295,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) + +# print(a) +# print(b) +number = [] +for i in range(1, len(a)+1): + for j in range(1, len(b)+1): + if k >= sum(a[:i]) + sum(b[:j]): + number.append(i+j) + else: + break +if number == []: + print(0) +else: + print(max(number))" +p02623,s622196937,Wrong Answer,"n, m, k = list(map(int, input().split())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +count = 0 +ai = 0 +bi = 0 +while True: + if (len(a) != ai and len(b) != bi and a[ai] <= b[bi]) or (len(a) != ai and len(b) == bi): + k -= a[ai] + ai += 1 + elif (len(a) != ai and len(b) != bi and a[ai] > b[bi]) or (len(a) == ai and len(b) != bi): + k -= b[bi] + bi += 1 + else: + break + if k < 0: + break + count += 1 +print(count) +" +p02623,s983027438,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = sorted(a+b) +ans = 0 +tmp = 0 +for i in c: + tmp += i + if(tmp > k):print(ans);exit() + ans+=1 +else:print(ans) +" +p02623,s865340633,Wrong Answer,"n, m, k = map(int, input().split()) +a = list(map(int, input().split()))+[float('inf')] +b = list(map(int, input().split()))+[float('inf')] +ans = 0 +i, j = 0, 0 +while ans <= k: + if a[i] <= b[j]: + ans += a[i] + i += 1 + else: + ans += b[j] + j += 1 +if ans == float('inf'): + print(len(a)+len(b)-2) +else: + print(i+j-1) + +" +p02623,s906550499,Wrong Answer,"from itertools import accumulate + +n, m, k = map(int, input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +ans = 0 + +a_accum = list(accumulate(a)) +b_accum = list(accumulate(b)) + +for j in range(len(a_accum)): + for i in range(len(b_accum)): + t = a_accum[-(j+1)] + b_accum[-(i+1)] + candi = (n-j) + (m-i) + if ans >= candi: + break + if t <= k: + ans = candi + break + +print(ans)" +p02623,s638564958,Wrong Answer,"N, M, K = map(int, input().split()) +*A, = map(int, input().split()) +*B, = map(int, input().split()) +AB = A + B +AB.sort() +ans = 0 +for ab in AB: + if K - ab > 0: + K = K - ab + ans += 1 + else: + break +print(ans)" +p02623,s420783706,Wrong Answer,"N,M,K=map(int,input().split()) +A=[] +B=[] +A=list(map(int,input().split())) +B=list(map(int,input().split())) + +for i in range(len(B)): + A.append(B[i]) + +A.sort +goukei=0 +if(K=alist[-1]: + khun -= alist[-1] + count += 1 + alist.pop(-1) + elif khun >= blist[-1]: + khun -= blist[-1] + count += 1 + blist.pop(-1) + else: + break; +print(count)" +p02623,s487531621,Wrong Answer,"a,b,c = map(int,input().split()) +z = list(map(int,input().split())) +x = list(map(int,input().split())) +if c>=sum(z)+ sum(x): + print(a+b) +else: + i,j,q,r=0,0,0,0 + while q<=c and i+j<=(a+b): + if i<=(a-1) and j<=(b-1): + if z[i]<=x[j]: + q+=z[i] + i+=1 + else: + q+=x[j] + j+=1 + else: + if j==b: + q+=z[i] + i+=1 + if i==a: + q+=x[j] + j+=1 + r+=1 + print(r-1)" +p02623,s567631982,Wrong Answer,"import sys + +n,m,k=map(int,input().split()) +a=list(map(int,input().split())) +b=list(map(int,input().split())) +count=sum(b) +i=0 +j=m +ls=[] +if sum(a)==k: + print(n) + sys.exit() + +while (i0): + if count>=k: + j-=1 + count-=b[j] + + elif count0 else 0)" +p02623,s705216340,Wrong Answer,"import bisect +from itertools import accumulate +n,m,k=map(int,input().split()) +a=list(accumulate([0] + list(map(int,input().split())))) +b=list(accumulate([0] + list(map(int,input().split())))) +ans=0 +for i,x in enumerate(a): + y=k-x + if y>0: + j=bisect.bisect_right(b,y) + ans=max(ans,i+j-1) +print(ans) +" +p02623,s209533395,Wrong Answer,"n,m,k = map(int,input().split()) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +A = [0] +B = [0] + +for i in range(len(a)): + A.append(a[i] + A[i]) +for i in range(len(b)): + B.append(b[i] + B[i]) + +loop = False +num = 0 +x = m + +for i in range(1,len(A)): + while A[i] + B[x] > k and x > 0 and A[i] <= k: + x -= 1 + loop = True + + if loop: + num = max(num, i + x) + + +print(num) + + +" +p02623,s984159996,Wrong Answer,"import sys +import math +from collections import deque + +n,m,k=map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +a=[0] +b=[0] + +for i in range(n): + a.append(A[i]+a[i]) +for i in range(m): + b.append(B[i]+b[i]) + +ans,j=0,m + +for i in range(n): + if a[i] > k : + break + while b[j] > k-a[i] : + j-=1 + ans = max(ans, i+j) + +print(ans) + +" +p02623,s626642159,Wrong Answer,"N,M,K = map(int,input().split("" "")) +#print(K) +A = list(map(int,input().split("" ""))) +B = list(map(int,input().split("" ""))) + +time_A = [0]*(N+1) +time_B = [0]*(M+1) + +for i in range(N): + time_A[i+1] = time_A[i] + A[i] +print(time_A) +for j in range(M): + time_B[j+1] = time_B[j] + B[j] + +ans = 0 +l = M + +for k in range(N+1): + if time_A[k] > K: + break + while time_A[k] + time_B[l] > K: + l -= 1 + ans = max(ans,k+l) + +print(ans)" +p02623,s580907306,Wrong Answer,"N,M,K = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) +A.append(10**9+10) +B.append(10**9+10) + +i_a = 0 +i_b = 0 +ans = 0 +while 1: + if K < A[i_a] and K < B[i_b]: + break + if A[i_a] < B[i_b]: + K -=A[i_a] + i_a += 1 + else: + K -= B[i_b] + i_b += 1 + ans += 1 + +print(ans) + + + + +" +p02623,s191562949,Wrong Answer,"import itertools +import bisect + +n, m, k = map(int,input().split()) +A = list(map(int,input().split())) +B = list(map(int,input().split())) + +cA = list(itertools.accumulate(A)) +cB = list(itertools.accumulate(B)) + +#print(cA) +#print(cB) + +ans = 0 +for i in range(n): + tmp = cA[-(i+1)] + if tmp < k: + indb = bisect.bisect_right(cB, k - tmp) + #print(indb) + ans = max(ans, (n-i)+indb) + +print(ans)" +p02646,s756608533,Accepted," +[A,V] = list(map(int,input().split())) +[B,W] = list(map(int,input().split())) +T = int(input()) + +if A= B+W*T: + out='YES' + else: + out='NO' + +else: + if B-W*T >= A-V*T: + out='YES' + else: + out='NO' +print(out)" +p02646,s513910534,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if abs(a-b)+w*t <= v*t: + print(""YES"") +else: + print(""NO"")" +p02646,s288740384,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) +if v <= w: + print(""NO"") +elif abs(a-b) > t*(v-w): + print(""NO"") +else: + print(""YES"")" +p02646,s113298787,Accepted,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if A == B or V-W > 0 and abs(A-B) <= T*(V-W): + print('YES') +else: + print('NO') + +" +p02646,s194579870,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +# if (v-w)*t>=(b-a):print(""YES"") +# else:print(""NO"") +q = abs(a-b) +e = (v-w)*t +if q<=e: + print(""YES"") +else: + print(""NO"")" +p02646,s562694094,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a > b: + aa = a - t * v + bb = b - t * w + if aa > bb: + print('NO') + else: + print('YES') +elif a < b: + aa = a + t * v + bb = b + t * w + if aa < bb: + print('NO') + else: + print('YES') +else: + print('YES') +" +p02646,s796095230,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if ab: + print(""NO"") + else: + print(""YES"") + " +p02646,s565810906,Accepted,"A=list(map(int,input().split())) +B=list(map(int,input().split())) +T=int(input()) + +if abs(A[0]-B[0])+B[1]*T>A[1]*T: + print(""NO"") +else: + print(""YES"") +" +p02646,s199591825,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +ans = [""YES"",""NO""] + +distance = abs(b-a) +speed = v-w + +result = distance - speed * t +if result <= 0: + print(ans[0]) +elif result > 0: + print(ans[1]) + +" +p02646,s707309590,Accepted,"import sys +input = sys.stdin.readline +def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + if A <= B: + r = (B+ W*T) - (A + V*T) + if r <= 0: + print(""YES"") + else: + print(""NO"") + else: + r = (B- W*T)-(A - V*T) + if r >= 0: + print(""YES"") + else: + print(""NO"") + +if __name__ == '__main__': + main()" +p02646,s205219557,Accepted," +a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if a < b: + b1 = w*t + b + a1 = v*t + a + if a1 >= b1: + flag = 1 + else: + flag = 0 +elif a > b: + b1 = -w*t + b + a1 = -v*t + a + if a1 <= b1: + flag = 1 + else: + flag = 0 +if flag == 0: + print(""NO"") +else: + print(""YES"")" +p02646,s280557762,Accepted,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +if V > W and T >= (abs(A - B) / abs(V - W)): + print('YES') +else: + print('NO')" +p02646,s964732896,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if (v - w) * t >= abs(a - b): + print(""YES"") +else: + print(""NO"") +" +p02646,s892879403,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + ans = ""NO"" +else: + if abs(A - B) / (V - W) <= T: + ans = ""YES"" + else: + ans = ""NO"" +print(ans) +" +p02646,s216493713,Accepted,"numsA = [int(e) for e in input().split()] +numsB = [int(e) for e in input().split()] +T = int(input()) +if abs(numsA[0]-numsB[0])<=(numsA[1]-numsB[1])*T: + print(""YES"") +else: + print(""NO"") +" +p02646,s062207644,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T=int(input()) + +place_A=A+(T*V) +place_B=B+(T*W) + +place_A_1=A-(T*V) +place_B_1=B-(T*W) + +if A=place_B: + print(""YES"") + + else: + print(""NO"") + +else: + if place_A_1<=place_B_1: + print(""YES"") + else: + print(""NO"") +" +p02646,s016433610,Accepted,"a,v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if a < b: + if a + v * t >= b + w * t : + print(""YES"") + else: + print(""NO"") +else : + if a - v * t <= b - w * t : + print(""YES"") + else: + print(""NO"")" +p02646,s723707574,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a == b: + print(""YES"") +elif a < b: + a_new = a + v * t + b_new = b + w * t + if a_new >= b_new: + print(""YES"") + else: + print(""NO"") +else: + a_new = a - v * t + b_new = b - w * t + if a_new <= b_new: + print(""YES"") + else: + print(""NO"")" +p02646,s387244216,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dis = abs(A - B) +if V <= W: + print('NO') +else: + if (dis / (V - W)) <= T: + print('YES') + else: + print('NO')" +p02646,s076317848,Accepted,"a, v1 = map(int, input().split()) +b, v2 = map(int, input().split()) +t = int(input()) +l = abs(a-b) +delta_v = v1-v2 +if delta_v <= 0: + print(""NO"") + exit() + +if delta_v * t >= l: + print(""YES"") +else: + print(""NO"")" +p02646,s560102130,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +S = V - W +print('NO' if S <= 0 or abs(A - B) > T * S else 'YES')" +p02646,s222034162,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + + +c=abs(a-b)-v*t+w*t +if c<=0: + print(""YES"") +else: + print(""NO"")" +p02646,s518186565,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a == b: + print(""YES"") + exit() + +if v <= w: + print(""NO"") + exit() + +if (v - w) * t >= abs(a - b): + print(""YES"") +else: + print(""NO"")" +p02646,s300492429,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + if a != b: + print('NO') + else: + print('YES') +else: + if abs(a - b) <= abs(v - w) * t: + print('YES') + else: + print('NO') +" +p02646,s057665576,Accepted,"(A, V) = map(lambda a: float(a), input().split()) +(B, W) = map(lambda a: float(a), input().split()) +T = float(input()) + +D = abs(A - B) +X = V - W + +if (X*T >= D): + print(""YES"") +else: + print(""NO"") + +" +p02646,s970330283,Accepted,"a, v = list(map(int, input().split(' '))) +b, w = list(map(int, input().split(' '))) +t = int(input()) + +distance = b - a +relative_velocity = w - v +if relative_velocity > 0: + print('NO') +else: + if (abs(relative_velocity)*t >= abs(distance)): + print('YES') + else: + print('NO')" +p02646,s865572776,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v-w <= 0: + print('NO') + exit() +ans=abs(a-b)/(v-w) +if ans <= t: + print('YES') +else: + print('NO') + " +p02646,s830801373,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dist = abs(B-A) +spd = V-W +ans = ""YES"" + +if spd*T < dist: + ans = ""NO"" + +print(ans) +" +p02646,s240143154,Accepted,"import sys + +sys.setrecursionlimit(10**7) +def I(): return int(sys.stdin.readline().rstrip()) +def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり +def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし +def S(): return sys.stdin.readline().rstrip() +def LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり +def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし + +A,V = map(int,S().split()) +B,W = map(int,S().split()) +T = I() + +if V > W and T*abs(V-W) >= abs(A-B): + print('YES') +else: + print('NO')" +p02646,s473799850,Accepted,"def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + dis = abs(B - A) + if W >= V: + print('NO') + exit() + dis_V = V - W + time = dis // dis_V if dis % dis_V == 0 else (dis // dis_V) + 1 + + if T >= time: + print('YES') + else: + print('NO') + + + +if __name__ == ""__main__"": + main()" +p02646,s670999119,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + + +if A < B: + A_sum = A + (V * T) + B_sum = B + (W * T) + if A_sum >= B_sum: + print('YES') + else: + print('NO') + +else: + A_sum = A - (V * T) + B_sum = B - (W * T) + if A_sum <= B_sum: + print('YES') + else: + print('NO') +" +p02646,s305661765,Accepted,"a,asp=map(int, input().split("" "")) +b,bsp=map(int, input().split("" "")) +t=(int)(input()) +if asp > bsp: + print(""YES"") if abs(b-a)/(asp-bsp) <= t else print(""NO"") +else: + print(""NO"")" +p02646,s900426356,Accepted,"a, v = list(map(int, input().strip().split())) +b, w = list(map(int, input().strip().split())) +t = int(input()) + +if a == b: print(""YES"") +else: + if w >= v: print(""NO"") + else: + tt = abs(a-b)/(v-w) + + if tt <= t: print(""YES"") + else: print(""NO"")" +p02646,s392106075,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if B < A: + dist = A - B + if dist <= (V - W)*T: + print('YES') + else: + print('NO') +else: + dist = B - A + if dist <= (V - W)*T: + print('YES') + else: + print('NO')" +p02646,s259972677,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if abs(a-b) <= t*(v-w): + print(""YES"") +else: + print(""NO"")" +p02646,s850613430,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if abs(A - B) <= (V - W) * T: + print('YES') +else: + print('NO')" +p02646,s157076832,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +d=abs(b-a) +dv=v-w +if d<=t*dv: + print('YES') +else: + print('NO')" +p02646,s464073044,Accepted," +def main(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + + if a == b: + print(""YES"") + return + + dis = abs(a - b) + s = v - w + dis -= s * t + + if dis <= 0: + print(""YES"") + else: + print(""NO"") + + +main() +" +p02646,s970045199,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) +if a= new_b: + print(""YES"") + elif new_a < new_b: + print(""NO"") +elif a>b: + new_a = a - v*t + new_b = b - w*t + if new_a <= new_b: + print(""YES"") + elif new_a > new_b: + print(""NO"") +" +p02646,s597295851,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +print('YES' if abs(a-b)<=t*(v-w) else 'NO')" +p02646,s312685729,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + # 追いつけない + print(""NO"") +else: + dx = abs(A - B) + dv = V - W + t = dx / dv + if t <= T: + print(""YES"") + else: + print(""NO"") + +" +p02646,s665203118,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if(b > a): + if(b + w*t <= a + v*t): + print('YES') + else: + print('NO') +if(b < a): + if(b - w*t >= a - v*t): + print('YES') + else: + print('NO') +" +p02646,s207798754,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if V<=W: + print('NO') +else: + if abs(A-B)<=abs(V-W)*T: + print('YES') + else: + print('NO')" +p02646,s703387715,Accepted," +def main(): + A, V = map(int,input().split(' ')) + B, W = map(int,input().split(' ')) + T = int(input()) + + if A > B: + if A-(V*T) <= B-(W*T): + print('YES') + else: + print('NO') + else: + if A+V*T >= B+W*T: + print('YES') + else: + print('NO') + + + +if __name__ == ""__main__"": + main() +" +p02646,s508230086,Accepted,"B,W = map(int,input().split()) +A,V = map(int,input().split()) +T = int(input()) +if A < B: + if A-V*T >= B-W*T: + print('YES') + else: + print('NO') +elif A > B: + if A+V*T <= B+W*T: + print('YES') + else: + print('NO')" +p02646,s800229939,Accepted,"import sys +input = lambda: sys.stdin.readline().rstrip() + +def main(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + if a < b: + if b + (w * t) <= a + (v * t): + print('YES') + else: + print('NO') + else: + if b + -(w * t) >= a + -(v * t): + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main()" +p02646,s344861722,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v*t + a >= w*t + b and a < b: + print(""YES"") +elif -v*t + a <= -w*t + b and a > b: + print(""YES"") +else: + print(""NO"")" +p02646,s154375512,Accepted,"a, v = map(int, input().strip().split()) +b, w = map(int, input().strip().split()) +t = int(input().strip()) + +if w>=v or t= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s161849130,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +L = abs(A-B) +S = V - W +if S * T >= L: + print(""YES"") +else: + print(""NO"") +" +p02646,s054342393,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +dist = abs(A - B) +velocity = V - W +if velocity * T >= dist: + print('YES') +else: + print('NO') +" +p02646,s930528757,Accepted,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + + +if V*T >= W*T+abs(B-A): + print(""YES"") +else: + print(""NO"")" +p02646,s089567473,Accepted,"A,V=list(map(int,input().split(' '))) +B,W=list(map(int,input().split(' '))) +T=int(input()) +if A= B+T*W: + print('YES') + else: + print('NO') +if A>B: + if A-T*V<= B-T*W: + print('YES') + else: + print('NO')" +p02646,s974299146,Accepted,"from sys import stdin +import math +import re +import queue + +input = stdin.readline + +MOD = 1000000007 +INF = 122337203685477580 + + +def solve(): + + A,V = map(int, input().split()) + B,W = map(int, input().split()) + T = int(input().rstrip()) + if(B < A): + V *= -1 + W *= -1 + if (A-B)*(A + T*V - B -T*W) <= 0: + print(""YES"") + else: + print(""NO"") + +if __name__ == '__main__': + solve() +" +p02646,s833475990,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if abs(A-B) <= T*(V-W): + print('YES') +else: + print('NO') +" +p02646,s581092152,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +max_A = A + V*T +min_A = A - V*T +max_B = B + W*T +min_B = B - W*T + +if max_A >= max_B and min_A <= min_B: + print(""YES"") +else: + print(""NO"")" +p02646,s033638529,Accepted,"a,v = map(lambda x: int(x), input().split()) +b,w = map(lambda x: int(x), input().split()) +t = int(input()) +if a == b or abs(a-b) <= (v-w)*t: print(""YES"") +else: print(""NO"") +" +p02646,s870651221,Accepted,"x,y = input().split() +q,w = input().split() +a =int(x) +b=int(y) +c= int(q) +d =int(w) +e =int(input()) + +if c-a >0: + if c-a <=e*(b-d): + print('YES') + + else: + print('NO') + +else: + if a-c<=e*(b-d): + print('YES') + + else: + print('NO')" +p02646,s663375567,Accepted,"a, v = (int(i) for i in input().split(' ')) +b, w = (int(i) for i in input().split(' ')) +t = int(input()) + +flag = False +if a < b: + l1 = a + v * t + l2 = b + w * t + if l1 >= l2: + flag = True +else: + l1 = a + (v * -1) * t + l2 = b + (w * -1) * t + if l1 <= l2: + flag = True +print(""YES"" if flag else ""NO"")" +p02646,s988624090,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +v = V - W +sa = abs(A-B) +if v <= 0: + print(""NO"") +else: + if sa / v <= T: + print(""YES"") + else: + print(""NO"") +" +p02646,s729092278,Accepted,"input_a = input().split() +a = int(input_a[0]) +v = int(input_a[1]) +input_b = input().split() +b = int(input_b[0]) +w = int(input_b[1]) +t = int(input()) + +distance = abs(a - b) +relative_velocity = v - w + +if relative_velocity <= 0: + print(""NO"") +elif distance / relative_velocity > t: + print(""NO"") +else: + print(""YES"")" +p02646,s322794893,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a>b: + t *= -1 +if abs(b + w*t) <= abs(a + v*t): + print(""YES"") +else: + print(""NO"") +" +p02646,s170365583,Accepted,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) + +d = abs(a-b) +v_diff = abs(v-w) + +if w >= v: + print('NO') +elif d > t * v_diff: + print('NO') +else: + print('YES')" +p02646,s417274871,Accepted,"def resolve(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + T = int(input()) + if v <= w: + print(""NO"") + return + if abs(a - b) <= T * abs(v - w): + print(""YES"") + else: + print(""NO"") + +resolve()" +p02646,s460694348,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if av: + print(""NO"") +else: + if abs(b-a)<=t*abs(v-w): + print(""YES"") + else: + print(""NO"") +" +p02646,s482954436,Accepted,"ma = lambda :map(int,input().split()) +ni = lambda:int(input()) +import collections +import math +import itertools +gcd = math.gcd +a,v = ma() +b,w = ma() +t = ni() +if w>=v: + print(""NO"") + exit() +d = abs(a-b) +if d + w*t <=v*t: + print(""YES"") +else: + print(""NO"") +" +p02646,s226805474,Accepted,"oni = list(map(int, input().split())) +nige = list(map(int, input().split())) +time = int(input()) + +if nige[1]>=oni[1]: + print(""NO"") +else: + distance = abs(oni[0]-nige[0]) + diff = oni[1]-nige[1] + need_time = distance / diff + if need_time > time: + print(""NO"") + else: + print(""YES"")" +p02646,s647889475,Accepted,"import io,sys +sys.setrecursionlimit(10**6) + + +def main(): + a,v = map(int,sys.stdin.readline().rstrip().split()) + b,w = map(int,sys.stdin.readline().rstrip().split()) + t = int(input()) + + l = abs(a-b) + p = v-w + + if p > 0 and l/p <= t: + print(""YES"") + else: + print(""NO"") +main()" +p02646,s282989432,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +distance = abs(B-A) +diff = V-W + +if distance - diff * T <= 0: + print('YES') +else: + print('NO') +" +p02646,s622725103,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if abs(A-B)>(V-W)*T: + print(""NO"") +else: + print(""YES"")" +p02646,s159074151,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +k = v-w +m = abs(a-b) +if k*t >= m: + print(""YES"") +else: + print(""NO"")" +p02646,s809336961,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') +else: + if t*(v-w) >= abs(a-b): + print(""YES"") + else: + print(""NO"") +" +p02646,s650052247,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +print('YES' if abs(a - b) <= t * (v - w) else 'NO') +" +p02646,s168411633,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +yes = True +if v <= w: + yes = False +elif abs(b - a) / (v - w) > t: + yes = False +if yes: + print(""YES"") +else: + print(""NO"")" +p02646,s718614286,Accepted,"A,V = list(map(int, input().split())) +B,W = list(map(int, input().split())) +T = int(input()) +if V - W <= 0: + print(""NO"") +else: + remain = abs(A-B) + r, q = divmod(remain, V-W) + if r == T and q == 0: + print(""YES"") + elif r < T: + print(""YES"") + else: + print(""NO"")" +p02646,s287497727,Accepted,"import sys +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + sys.exit() + +V = v - w +R = abs(a-b) +if V*t >= R: + print('YES') +else: + print('NO')" +p02646,s292608267,Accepted,"import sys +sys.setrecursionlimit(700000) + +def s_in(): + return input() + +def n_in(): + return int(input()) + +def l_in(): + return list(map(int, input().split())) +a,v=l_in() +b,w=l_in() +t=n_in() + +if b > a: + if b + w*t <= a + v*t: + print(""YES"") + else: + print(""NO"") +elif a > b: + if b - w*t >= a - v*t: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"") +" +p02646,s639877428,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if abs(a-b)<=(v-w)*t: + print(""YES"") +else: + print(""NO"")" +p02646,s236476467,Accepted,"a, v = list(map(int, input().split(' '))) +b, w = list(map(int, input().split(' '))) +time = int(input()) +if a>b: + x1 = a - v*time + x2 = b - w*time + if x1 <= x2: + print('YES') + else: + print('NO') +elif a= x2: + print('YES') + else: + print('NO') + + + +" +p02646,s277183607,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +ans = ""YES"" +if(V<=W): + ans = ""NO"" +elif(abs(A-B)>T*abs(V-W)): + ans = ""NO"" +print(ans)" +p02646,s310692391,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +d = abs(a-b) +s = v - w + +if s <= 0: + print('NO') + exit(0) + +if (t * s) >= d: + print('YES') +else: + print('NO')" +p02646,s429860734,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if abs(b-a)<=(v-w)*t: + print('YES') +else: + print('NO')" +p02646,s785105379,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +dif = abs(b-a) +waru = v - w +if waru <= 0: + print('NO') + exit() +tmp = dif/waru +#print(tmp) +if tmp<=t: + print('YES') +else: + print('NO')" +p02646,s842344666,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A != B and V <= W: + print(""NO"") +else: + dist = abs(A - B) + v = V - W + t = dist / v + if t <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s603778311,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + + +if a > b: + av = a - (v * t) + bw = b - (w * t) + if av <= bw: + print('YES') + else: + print('NO') + +elif a < b: + av = a + (v * t) + bw = b + (w * t) + if av >= bw: + print('YES') + else: + print('NO')" +p02646,s874116775,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') +else: + diff_start = abs(b - a) + diff_speed = v - w + if diff_start <= diff_speed*t: + print(""YES"") + else: + print(""NO"")" +p02646,s876915119,Accepted,"import sys +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v<=w: + print('NO') + sys.exit() +else: + d=abs(a-b) + s=v-w + if d<=t*s: + print('YES') + sys.exit() +print('NO')" +p02646,s568037119,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + print(""NO"") + exit() + +dist = abs(A - B) +if V*T - W*T < dist: + print(""NO"") +else: + print(""YES"")" +p02646,s163638062,Accepted,"a, v= map(int,input().split()) +b, w= map(int,input().split()) +t = int(input()) +if b < a: + a*=-1 + b*=-1 +if a+v*t >= b+w*t: + print('YES') +else: + print('NO')" +p02646,s436839802,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +D = abs(A - B) +S = V - W +if V - W <= 0: + print(""NO"") +else: + if D / S > T: + print(""NO"") + else: + print(""YES"")" +p02646,s721166562,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v-w==0 or w>v: + print(""NO"") + quit() +if abs(a-b)/(v-w)>t: + print(""NO"") +else: + print(""YES"")" +p02646,s116199543,Accepted,"def tag(a,b,v,w,t): + res = (v*t)-(abs(b-a)+(w*t)) + if res>=0: + return ""YES"" + return ""NO"" + +if __name__ == ""__main__"": + a,v = map(int,input().split()) + b,w = map(int,input().split()) + t = int(input()) + print(tag(a,b,v,w,t))" +p02646,s288948809,Accepted,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if A <= B: + B += W*T + A += V*T + if A >= B: + ans = ""YES"" + else: + ans = ""NO"" +else: + B -= W*T + A -= V*T + if A <= B: + ans = ""YES"" + else: + ans = ""NO"" +print(ans)" +p02646,s430224526,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +dist = abs(b - a) +mys = v - w + +if mys * t >= dist: + print(""YES"") +else: + print(""NO"")" +p02646,s152511106,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + print('NO') + exit() + +tmp = abs(B - A) +k = V - W +if tmp <= k * T: + print('YES') +else: + print('NO') +" +p02646,s494745643,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if abs(b - a) <= (v - w) * t: + print(""YES"") +else: + print(""NO"") + +" +p02646,s559058651,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v <= w: + print(""NO"") +elif a <= b: + if a+v*t >= b+w*t: + print(""YES"") + else: + print(""NO"") +else: + if a-v*t <= b-w*t: + print(""YES"") + else: + print(""NO"")" +p02646,s662260366,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +d = abs(a-b) + +if d <= t*(v - w): + print(""YES"") +else: + print(""NO"")" +p02646,s413036394,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v > w: + print(""YES"" if abs(a - b) / (v - w) <= t else ""NO"") +elif w > v: + print(""NO"") +else: + print(""YES"" if abs(a - b) == 0 else ""NO"")" +p02646,s331423965,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + + +if B > A: + if A - B + (V - W) * T >= 0: + print(""YES"") + else: + print(""NO"") +else: + if B - A + (V - W) * T >= 0: + print(""YES"") + else: + print(""NO"")" +p02646,s469552395,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +gap=abs(a-b) +if v>w: + c=gap/(v-w) + if t>=c: + print('YES') + else: + print('NO') +else: + print('NO')" +p02646,s022732470,Accepted,"a, v = [int(i) for i in input().split()] +b, w = [int(i) for i in input().split()] +T = int(input()) +if w >= v: + print(""NO"") +elif abs(a-b) <= T*(v-w): + print(""YES"") +else: + print(""NO"")" +p02646,s285327881,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +T=int(input()) +if abs(a-b)<=T*(v-w): + print(""YES"") +else: + print(""NO"")" +p02646,s468069371,Accepted,"A, V = [int(x) for x in input().split()] +B, W = [int(x) for x in input().split()] +T = int(input()) + +if W >= V: + print('NO') +elif abs(A - B) <= (V - W) * T: + print('YES') +else: + print('NO')" +p02646,s686770228,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +p = abs(a-b) +if p > (v-w)*t: + print(""NO"") +else: + print(""YES"")" +p02646,s397820477,Accepted,"a,b=map(int,input().split()) +v,w=map(int,input().split()) +t=int(input()) +if a<=v: + d1 = a + t*b + d2 = v + t*w + if d1>=d2: + print('YES') + else: + print('NO') +else: + d1 = a - t*b + d2 = v - t*w + if d1<=d2: + print('YES') + else: + print('NO')" +p02646,s578461070,Accepted,"A,V = list(map(int, input().split())) +B,W = list(map(int, input().split())) +T = int(input()) +print(""YES"" if (V-W) * T >= abs(B-A) else ""NO"")" +p02646,s778478341,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + if A == B: + print('YES') + exit() + else: + print('NO') + exit() +else: + t = abs(A-B)/(V-W) + if T >= t: + print('YES') + else: + print('NO') +" +p02646,s738564655,Accepted,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if A == B: + print('YES') + exit() +if W >= V: + print('NO') + exit() + +if (abs(A-B)+(V-W)-1)//(V-W) <= T: + print('YES') +else: + print('NO')" +p02646,s545136737,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t = int(input()) +kyori = abs(b - a) +sokudo = w - v +if kyori + sokudo * t <= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s271065510,Accepted,"import copy + +def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + if V <= W: + print('NO') + elif (abs(A-B) / (V-W)) <= T: + print('YES') + else: + print('NO') + +main()" +p02646,s151721360,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +firstDis = abs(A - B) +steps = (V - W)*T +print(""YES"" if firstDis <= steps else ""NO"") +" +p02646,s006783621,Accepted,"#!/usr/bin/env python3 + + +def judge(a, v, b, w, t): + return abs(b - a) <= t * (v - w) + + +def main(): + a, v = (int(z) for z in input().split()) + b, w = (int(z) for z in input().split()) + t = int(input()) + if judge(a, v, b, w, t): + print(""YES"") + else: + print(""NO"") + + +if __name__ == '__main__': + main()" +p02646,s508560338,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v-w<=0: + print(""NO"") +else: + if abs(a-b)/(v-w)<=t: + print(""YES"") + else: + print(""NO"")" +p02646,s025010240,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if (V - W) * T >= abs(A - B): + print(""YES"") +else: + print(""NO"")" +p02646,s946536035,Accepted,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) +print('YES' if (V-W)*T >= abs(B-A) else 'NO') +" +p02646,s362756281,Accepted,"import numpy as np + + +def main(A, B, V, W, T): + if abs(B-A) <= T*(V-W): + return ""YES"" + return ""NO"" + + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +print(main(A, B, V, W, T)) +" +p02646,s408142773,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +dv = V - W +dist = abs(B - A) +if dv*T >= dist: + print(""YES"") +else: + print(""NO"")" +p02646,s434343717,Accepted,"import sys +def input(): return sys.stdin.readline().rstrip() + +def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + if W >= V: + print('NO') + elif abs((A - B) / (W - V)) <= T: + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main() +" +p02646,s537623367,Accepted,"a, v = map(int,input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v < w: + print('NO') +elif abs(a-b) <= (v-w)*t: + print('YES') +else: + print('NO')" +p02646,s160508128,Accepted,"import sys + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + sys.exit() + +time = abs((a-b)/(v-w)) + +if t= b + t * w: + print('YES') + else: + print('NO') +else: + if a - t * v <= b - t * w: + print('YES') + else: + print('NO') +" +p02646,s437984937,Accepted,"from sys import exit +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if w >= v: + print(""NO"") + exit() + +time = abs(a - b) / (v - w) +if time > t: + print(""NO"") +else: + print(""YES"")" +p02646,s108741756,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if A==B: + print('YES') +else: + if A>B: + if A-(V*T)<=B-(W*T): + print('YES') + else: + print('NO') + else: + if A+(V*T)>=B+(W*T): + print('YES') + else: + print('NO')" +p02646,s379352246,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if a >= b: + if v <= w: + print(""NO"") + else: + print(""YES"" if abs(v-w)*t >= abs(a-b) else ""NO"") +else: + if v <= w: + print(""NO"") + else: + print(""YES"" if abs(v-w)*t >= abs(a-b) else ""NO"")" +p02646,s185889657,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if a>b: + v = -v + w = -w + if b - v*t >= a - w*t: + print('YES') + else: + print('NO') +else: + if b - v*t <= a - w*t: + print('YES') + else: + print('NO')" +p02646,s576653890,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t=int(input()) + +rev = v-w +if rev*t >= abs(b-a): + print(""YES"") +else: + print(""NO"")" +p02646,s393317460,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A > B: + T = -T + +posA = A + V*T +posB = B + W*T + + +if T <= 0: + if posA <= posB: + print('YES') + else: + print('NO') +else: + if posA >= posB: + print('YES') + else: + print('NO') +" +p02646,s721906478,Accepted,"A_V = input().split() +A = int(A_V[0]) +V = int(A_V[1]) +B_W = input().split() +B = int(B_W[0]) +W = int(B_W[1]) +T = int(input()) + +if V - W <= 0: + print('NO') +elif T < abs(B-A)/(V-W): + print('NO') +else: + print('YES')" +p02646,s446946367,Accepted,"a,b=map(int,input().split()) +c,d=map(int,input().split()) +e=int(input()) + +n=abs(c-a) +m=b-d +if m<=0: + print('NO') +elif e>=n/m: + print('YES') +else: + print('NO')" +p02646,s658532546,Accepted,"import sys + +def solve(): + input = sys.stdin.readline + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + if V <= W: print(""NO"") + else: + diff = abs(A - B) + if (V - W) * T >= diff: print(""YES"") + else: print(""NO"") + + return 0 + +if __name__ == ""__main__"": + solve()" +p02646,s872769185,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +L = abs(a - b) +s = v - w +if s <= 0 or L / s > t: + result = ""NO"" +else: + result = ""YES"" +print(result)" +p02646,s253956562,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if(VT*(V-W)): + print(""NO"") +else: + print(""YES"")" +p02646,s758378617,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if A W and abs(A - B) / (V - W) <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s014944509,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +distance = b - a +speed_remainder = v - w + +if speed_remainder < 0: + print(""NO"") +elif abs(distance) <= t * speed_remainder: + print(""YES"") +else: + print(""NO"") +" +p02646,s533563799,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +m = abs(a-b) +if a>b: + if (v-w)*t>=m: + print(""YES"") + else: + print(""NO"") +else: + if (v-w)*t>=m: + print(""YES"") + else: + print(""NO"") + " +p02646,s576210462,Accepted,"def main(): + import sys + input = sys.stdin.readline + A, V = [int(x) for x in input().strip().split()] + B, W = [int(x) for x in input().strip().split()] + T = int(input()) + if A == B: + print('YES') + return + if W > V: + print('NO') + return + if (V - W) * T >= abs(A - B): + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main()" +p02646,s861406202,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +w = abs(A-B) +s = V-W + +if s * T >= w: + print(""YES"") +else: + print(""NO"") +" +p02646,s642019066,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +flag = 0 + +if A < B: + a = V*T + A + b = W*T + B + if a >= b: + flag = 1 + + +else: + a = A - V*T + b = B - W*T + if a <= b: + flag = 1 + +if flag==1: + print(""YES"") +else: + print(""NO"")" +p02646,s075381415,Accepted,"a,v=[int(x) for x in input().rstrip().split()] +b,w=[int(x) for x in input().rstrip().split()] +t=int(input()) + + +if b+w*t<=a+v*t and a-v*t<=b-w*t: + print(""YES"") +else: + print(""NO"") +" +p02646,s293283245,Accepted,"a,v,b,w,t=map(int,open(0).read().split()) +print('YNEOS'[abs(b-a)>(v-w)*t::2])" +p02646,s831823338,Accepted,"def read_int(): + return int(input()) + + +def read_ints(): + return map(int, input().split(' ')) + + +a, v = read_ints() +b, w = read_ints() +t = read_int() +if w >= v: + print('NO') +elif abs(a - b) / (v - w) <= t: + print('YES') +else: + print('NO') +" +p02646,s848824801,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +L = abs(A - B) +S = V - W +if S * T >= L: + print(""YES"") +else: + print(""NO"")" +p02646,s382873142,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if w < v and (v-w)*t >= abs(a-b): + print(""YES"") +else: + print(""NO"")" +p02646,s672567617,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + print(""NO"") + exit() + +dist = abs(A - B) +vel = abs(V - W) + +if T * vel >= dist: + print(""YES"") +else: + print(""NO"")" +p02646,s075158765,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +flg = True +r = v - w +y = abs(b - a) +if r < 0: + flg = False + +if t * r < y: + flg = False + +if flg: + print(""YES"") +else: + print(""NO"")" +p02646,s871473931,Accepted,"a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +distance = abs(a-b) +sa = v - w + +if distance <= t*sa: + print('YES') +else: + print('NO')" +p02646,s593458537,Accepted,"a,v,b,w,t=map(int,open(0).read().split()) +if v==w: + print(""YES"" if a==b else ""NO"") +elif v>w: + print(""YES"" if abs(a-b)/(v-w)<=t else ""NO"") +else: + print(""NO"")" +p02646,s156196324,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +start1 = a +end1 = a+v*t +start2 = b +end2 = b+w*t +if(a==b): + print(""YES"") + exit() +if(w>=v): + print(""NO"") + exit() + +dist = abs(a-b) +rv = abs(v-w) + +if(dist <= t*rv): print(""YES"") +else: print(""NO"")" +p02646,s336947358,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +distance = abs(A - B) +speed = V - W +if (distance <= speed * T): + print(""YES"") +else: + print(""NO"") +" +p02646,s654257049,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if A < B: + A += V*T + B += W*T + print(""YES"" if A >= B else ""NO"") +else: + A -= V*T + B -= W*T + print(""YES"" if A <= B else ""NO"")" +p02646,s832117568,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +Vf = V - W +D = abs(A - B) +Df = D - Vf * T +if Df <= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s648828471,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +print('YES' if abs(a - b) <= (v - w) * t else 'NO')" +p02646,s783947753,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +dist = abs(A-B) +v = V-W +if T*v>=dist:print('YES') +else:print('NO')" +p02646,s348038420,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if V <= W: + print(""NO"") +elif (abs(A-B)/abs(V-W)) <= T: + print(""YES"") +else: + print(""NO"")" +p02646,s133395335,Accepted,"a,v,b,w,t=map(int,open(0).read().split()) +print('YNEOS'[v-w w and (v - w) * t >= x: + print(""YES"") +else: + print(""NO"") +" +p02646,s194048934,Accepted,"A,V = (int(x) for x in input().split()) +B,W = (int(x) for x in input().split()) +T = int(input()) + +if V>W and abs(A-B)/(V-W)<=T: + Flag = True +else: + Flag = False + +if Flag: + print('YES') +else: + print('NO')" +p02646,s590012833,Accepted,"x=[0,0,0] +for i in range(3): + x[i]=list(map(int, input().split())) + +l=abs(x[0][0]-x[1][0]) +v=x[0][1]-x[1][1] +if l>v*x[2][0]: + print('NO') +else: + print('YES')" +p02646,s780607785,Accepted,"import sys +x=input() +y=input() +x0=x.split() +a=int(x0[0]) +v=int(x0[1]) +y0=y.split() +b=int(y0[0]) +w=int(y0[1]) +t=int(input()) +l=abs(a-b) +r=v-w +if r<=0: + print(""NO"") + sys.exit() +if l/r<=t: + print(""YES"") +else: + print(""NO"")" +p02646,s337950520,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if a<=b: + if a+v*t>=b+w*t: + print('YES') + else: + print('NO') +else: + if a-v*t<=b-w*t: + print('YES') + else: + print('NO')" +p02646,s602603466,Accepted,"import math +import itertools +import collections +import bisect +import heapq + +def IN(): return int(input()) +def sIN(): return input() +def MAP(): return map(int,input().split()) +def LMAP(): return list(map(int,input().split())) +def TATE(n): return [input() for i in range(n)] +MOD = 10**9 + 7 + +a,v = MAP() +b,w = MAP() +t = IN() + +if b > a: + if a+v*t >= b+w*t: + print('YES') + else: + print('NO') +else: + if a-v*t <= b-w*t: + print('YES') + else: + print('NO') +" +p02646,s775193733,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') +elif ((a-b)/(v-w))**2 <=t**2: + print('YES') +else: + print('NO')" +p02646,s475940994,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if abs(A-B) <= (V-W) * T: + print(""YES"") +else: + print(""NO"") +" +p02646,s052814849,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v==w: + print('NO') + exit() +c=abs(a-b)/(v-w) +print('YES' if 0<=c and c<=t else 'NO')" +p02646,s899398944,Accepted,"a,v=map(int,input().split()) +b,w = map(int,input().split()) +t=int(input()) + + +if a<=b: + + dist_a = a + t*v + + dist_b = b + t*w + + if dist_a>=dist_b: + print('YES') + else: + print('NO') +else: + + dist_a = a - t*v + + dist_b = b - t*w + + if dist_a<=dist_b: + print('YES') + else: + print('NO') + " +p02646,s112628702,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +print(""YES"" if abs(A-B)<=(V-W)*T else ""NO"")" +p02646,s594323183,Accepted,"A,V = input().split() +B,W = input().split() + +A = int(A) +V = int(V) +B = int(B) +W = int(W) + +T = int(input()) + + + +def solve(): + + distance = abs(B-A) + closer = abs(V-W) + + if V <= W: + print(""NO"") + return + + time = distance/closer + if time <= T: + print(""YES"") + return + else: + print(""NO"") + return + + +solve() +" +p02646,s365224245,Accepted,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) + +if V <= W: + print('NO') + exit() + +d = abs(A - B) + +if V > W and d <= (V - W) * T: + print('YES') +else: + print('NO')" +p02646,s958071884,Accepted,"import sys +input=lambda: sys.stdin.readline().rstrip() +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if t*(v-w)>=abs(a-b): + print(""YES"") +else: + print(""NO"")" +p02646,s738770670,Accepted,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) +if abs(a-b) <= (v-w)*t : + print(""YES"") +else: + print(""NO"")" +p02646,s999649704,Accepted,"a,v=map(int,input(). split()) +b,w = map(int,input(). split()) +t=int(input()) + + +if a<=b: + + dist_a = a + t*v + + dist_b = b + t*w + + if dist_a>=dist_b: + print('YES') + else: + print('NO') +else: + + dist_a = a - t*v + + dist_b = b - t*w + + if dist_a<=dist_b: + print('YES') + else: + print('NO')" +p02646,s174292167,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if A>B: + D=A-B +else: + D=B-A +if V<=W: + print(""NO"") +elif (V-W)*T>=D: + print(""YES"") +else: + print(""NO"")" +p02646,s978027966,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') +else: + if abs(a - b) /(v - w) <= t: + print('YES') + else: + print('NO') +" +p02646,s231275337,Accepted,"A,V=list(map(int,input().split())) +B,W=map(int,input().split()) +T=int(input()) + +diff_x=abs(A-B) +diff_a=max(V-W,0) + +if T*diff_a>=diff_x: + print('YES') +else: + print('NO')" +p02646,s548559728,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if t*(v-w)>=abs(a-b): + print(""YES"") +else: + print(""NO"")" +p02646,s210581054,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +judge=bool(abs(a-b)<=(v-w)*t) +if judge: + print(""YES"") +else: + print(""NO"")" +p02646,s021258011,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +num1=abs(a-b) +if v<=w: + print(""NO"") +else: + num2=v-w + num3=num1/num2 + if num3<=t: + print(""YES"") + else: + print(""NO"") +" +p02646,s390414161,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t=int(input()) + +if abs(b - a) <= (v - w) * t: + print('YES') +else: + print('NO')" +p02646,s710642399,Accepted,"num_input = [input() for i in range(3)] +a = int(num_input[0].split()[0]) +v = int(num_input[0].split()[1]) +b = int(num_input[1].split()[0]) +w = int(num_input[1].split()[1]) +t = int(num_input[2].split()[0]) + +hoge=b-a +if hoge<0: + hoge=hoge*-1 + +if v-w<=0: + ans=""NO"" +elif t*(v-w)>=hoge: + ans=""YES"" +else: + ans=""NO"" + +print(ans)" +p02646,s497122870,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if a==b: + print('YES') +elif v<=w: + print('NO') +elif abs(a-b)/ abs(v-w) <= t: + print('YES') +else: + print('NO')" +p02646,s795007507,Accepted,"A,V =[int(i) for i in input().split()] +B,W = [int(i) for i in input().split()] +T = int(input()) +if V > W: + if abs(A - B) / abs(V - W) <= T: + print(""YES"") + else: + print(""NO"") +else: + if V == W and A == B: + print(""YES"") + else: + print(""NO"")" +p02646,s822218928,Accepted,"#鬼 +a,v=map(int,input().split()) + +#逃げている +b,w=map(int,input().split()) + +#t秒以内 +t=int(input()) + +if v>w: + if abs(a-b)<=(v-w)*t: + print(""YES"") + exit() + +print(""NO"")" +p02646,s968190948,Accepted,"A, V = map(int, input().split()) +B, W= map(int, input().split()) +T = int(input()) + + +diff1 = abs(A - B) +diff2 = (V - W)*T + +if ( diff1 <= diff2): + print(""YES"") +else: + print(""NO"")" +p02646,s786239941,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +s = 'YES' +if abs((B-A))<=(V-W)*T: + print('YES') +else: + print('NO')" +p02646,s962812333,Accepted,"a, v = list(map(int,input().strip().split())) +b, w = list(map(int,input().strip().split())) +t = int(input()) +ansa = a + v * t +ansb = b + w * t +ansa2 = a - v * t +ansb2 = b - w * t +if a < b: + if ansb <= ansa: + print(""YES"") + else: + print(""NO"") +else: + if ansa2 <= ansb2: + print(""YES"") + else: + print(""NO"")" +p02646,s760138737,Accepted," +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a == b: + print('YES') + exit() +if b - a > 0: + if (v - w) * t >= b - a: + print('YES') + exit() + else: + print('NO') + exit() +else: + if (v - w) * t >= a - b: + print('YES') + exit() + else: + print('NO') + exit() + +print('NO')" +p02646,s671853703,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +l = abs(b-a) +r = v-w +if l-(r*t)<=0: + print(""YES"") +else: + print(""NO"")" +p02646,s848472582,Accepted,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if A < B: + Ap = A + V*T + Bp = B + W*T + + if Ap >= Bp: + print('YES') + else: + print('NO') +else: + Ap = A + (-V*T) + Bp = B + (-W*T) + + if Ap <= Bp: + print('YES') + else: + print('NO') +" +p02646,s290174992,Accepted,"a, v = list(map(int, input().split())) +b, w = list(map(int, input().split())) +t = int(input()) +if a > b: + a, b = a-v*t, b-w*t + # a = -1 * 10**9 if a < -1 * 10**9 else a + # b = -1 * 10**9 if b < -1 * 10**9 else b + if a <= b: + print('YES') + else: + print('NO') +else: + a, b = a+v*t, b+w*t + # a = 10**9 if a > 10**9 else a + # b = 10**9 if b > 10**9 else b + if a >= b: + print('YES') + else: + print('NO') +" +p02646,s739217655,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if (w - v) >= 0: + print(""NO"") + exit() +else: + if (abs(a - b) + (v - w - 1))//(v - w) <= t: + print(""YES"") + else: + print(""NO"") +" +p02646,s707784054,Accepted,"#B - Tag +A,V= map(int,input().split()) +B,W= map(int,input().split()) +T= int(input()) + +k = abs(B-A) +a = V*T +b = W*T + + + +if a >= k + b: + print(""YES"") +else: + print(""NO"")" +p02646,s588188349,Accepted,"x,a=map(int,input().split()) +y,b=map(int,input().split()) +t=int(input()) +if(abs(x-y)<=t*(a-b)): + print('YES') +else: + print(""NO"") +" +p02646,s948433763,Accepted,"def LI():return list(map(int,input().split())) +def yes():print(""YES"") +def no():print(""NO"") + +a,v=LI() +b,w=LI() +t=int(input()) + +if a=b+w*t: + yes() + else: + no() +if a>b: + if a-v*t<=b-w*t: + yes() + else: + no() +" +p02646,s017400253,Accepted,"def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + d = abs(A - B) + s = V - W + print('YES' if T * s >= d else 'NO') + + +if __name__ == '__main__': + main() +" +p02646,s595176913,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +dist = abs(B-A) +r_vel = V - W + +if r_vel * T >=dist: + print(""YES"") + +else: + print(""NO"")" +p02646,s130751820,Accepted,"#coding: utf-8 +a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) + +dist = abs(a-b) +dist += (t*w) + +if dist <= v*t: + print('YES') +else: + print('NO')" +p02646,s142079434,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if (b > a): + if (b + w * t > a + v * t): + print(""NO"") + else: + print(""YES"") +else: + if (b - w * t < a - v * t): + print(""NO"") + else: + print(""YES"")" +p02646,s106239729,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +T = int(input()) +if abs(b-a) <= (v-w)*T: + print('YES') +else: + print('NO')" +p02646,s569900469,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t =int(input()) +x = v-w +c = abs(a-b) +if x * t >= c: + print(""YES"") +else: + print(""NO"")" +p02646,s226793381,Accepted,"a, v = map(int,input().split()) +b, w = map(int, input().split()) +t = int(input()) + + +if w >= v: + print(""NO"") +else: + if abs(b-a) > (v-w) * t: + print(""NO"") + else: + print(""YES"")" +p02646,s424258362,Accepted,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +d = abs(A - B) +s = V - W + +if s <= 0: + print(""NO"") + exit() + +if d / s <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s353795946,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if W >= V: + print(""NO"") +else: + diff = abs(A-B) + if V*T - W*T >= diff: + print(""YES"") + else: + print(""NO"")" +p02646,s234763418,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +ok = False +if a < b: + if a + v*t >= b + w*t: + ok = True +else: + if a - v*t <= b - w*t: + ok = True + +if ok: + print('YES') +else: + print('NO') +" +p02646,s352702613,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dist = abs(A-B) + +if dist+W*T-V*T<=0: + print(""YES"") +else: + print(""NO"")" +p02646,s163556916,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if abs(b-a) - (v-w)*t <= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s691173422,Accepted,"A,V=map(int,input().strip().split()) +B,W=map(int,input().strip().split()) +T=int(input()) + +if abs(B-A)<=(V-W)*T: + print(""YES"") +else: + print(""NO"")" +p02646,s796995159,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if a>b: + r=a-t*v + s=b-t*w + if sr: + print('NO') + else: + print('YES') +" +p02646,s189664989,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +d = abs(a - b) +s = v - w + +if s <= 0 or d / s > t: + print(""NO"") +else: + print(""YES"")" +p02646,s470911879,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +diffVW = V - W # m/s +diffAB = abs(A - B) # m + +if diffVW <= 0: + print(""NO"") + exit(0) +else: + diffVW = abs(diffVW) + +if (diffAB / diffVW) <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s764179977,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if b==a: print('YES');exit() +if v-w<=0:print('NO');exit() +dist = abs(b-a) +velocity = v-w +if dist/velocity <=t:print('YES') +else: print('NO') + +" +p02646,s100425106,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +if (V <= W): + print(""NO"") +elif(T < abs(A - B)/(V-W)): + print(""NO"") +else: + print(""YES"") +" +p02646,s504959039,Accepted,"import sys +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v==w or w>v: + print('NO') + sys.exit() +else: + tp=(b-a)/(v-w) + tm=(a-b)/(v-w) + if b>a: + if t>=tp: + print('YES') + else: + print('NO') + else: + if t>=tm: + print('YES') + else: + print('NO') + +" +p02646,s026750664,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +kyori = abs(a-b) +if kyori<= (v-w)*t: + print('YES') +else: + print('NO')" +p02646,s998968580,Accepted," +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if a>b: + x=a-v*t + y=b-w*t + if x<=y: + print('YES') + else: + print('NO') +else: + x=a+v*t + y=b+w*t + if x>=y: + print('YES') + else: + print('NO')" +p02646,s318551487,Accepted,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +if A == B: + print(""YES"") + exit() + +if V == W: + print(""NO"") + exit() + +time = abs(A - B) / (V - W) +if 0 <= time and time <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s933676615,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +X = abs(A-B) +Y = abs(V-W) + +if W>=V: + print(""NO"") +elif X<=Y*T: + print(""YES"") +else: + print(""NO"")" +p02646,s719771562,Accepted,"ax, av = map(int, input().split()) +bx, bv = map(int, input().split()) +t = int(input()) + +x = abs(ax - bx) +v = av - bv +dis = v * t + +if dis >= x: + print(""YES"") +else: + print(""NO"") +" +p02646,s334117461,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs(a-b) <= (v-w) * t: + print(""YES"") +else: + print(""NO"")" +p02646,s415073143,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if abs(a-b)>(v-w)*t: + print(""NO"") +else: + print(""YES"") +" +p02646,s199835285,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a > b: + oni = a + (-1*v) * t + nige = b + (-1*w) * t + if oni <= nige: + print(""YES"") + else: + print(""NO"") +else: + oni = a + v*t + nige = b + w * t + if oni >= nige: + print(""YES"") + else: + print(""NO"")" +p02646,s594042191,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if a B: + if A - V*T <= B - W*T: + print(""YES"") + else: + print(""NO"") +else: + if A + V*T >= B + W*T: + print(""YES"") + else: + print(""NO"")" +p02646,s509115577,Accepted,"A,V = [int(i) for i in input().split()] +B,W = [int(i) for i in input().split()] +T = int(input()) + +if A < B: + if A+V*T >= B+W*T: + print('YES') + else: + print('NO') +else: + if A-V*T <= B-W*T: + print('YES') + else: + print('NO') +" +p02646,s179141047,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v > w: + if abs(a-b) <= t*(v-w): + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s852562143,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if (v-w)*t>=abs(b-a): + print(""YES"") +else: + print(""NO"")" +p02646,s489669578,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if w>=v: + print(""NO"") + exit() +x=abs(a-b) +n=x//(v-w) +if (v-w)*t>=x: + print(""YES"") +else: + print(""NO"") + + +" +p02646,s902008458,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if abs(B-A) <= T*(V-W): + print(""YES"") +else: + print(""NO"") +" +p02646,s413400523,Accepted,"A,V = [int(i) for i in input().split() ] +B,W = [int(i) for i in input().split() ] +T = int(input()) + +print (""YES"" if V-W > 0 and abs(A-B) / (V-W) <= T else ""NO"" ) +" +p02646,s412065395,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +dist = abs(a - b) +vd = v - w + +if vd > 0: + if 0 <= dist/vd/t <= 1: + print(""YES"") + else: + print(""NO"") +elif vd == 0 and dist == 0: + print(""YES"") +else: + print(""NO"")" +p02646,s248021390,Accepted,"a, v = [int(i) for i in input().split()] +b, w = [int(i) for i in input().split()] +t = int(input()) + +if v <= w: + print('NO') +else: + if abs(a - b) <= t * (v - w): + print('YES') + else: + print('NO')" +p02646,s113590101,Accepted,"# coding: utf-8 +import sys + +stdin = sys.stdin +ns = lambda: stdin.readline().rstrip() # ignore trailing spaces +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) + + +def main(): + a,v = na() + b,w = na() + t = ni() + if abs(a-b) <= (v-w)*t: + print('YES') + else: + print('NO') + return + + +if __name__ == '__main__': + main()" +p02646,s098142413,Accepted,"# -*- coding: utf-8 -*- +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w and a != b: + print('NO') +elif abs(b-a) / (v-w) <= t: + print('YES') +else: + print('NO')" +p02646,s606567809,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +s = a+v*t +u = b+w*t +ss = a - v*t +uu = b - w*t + +if b >= a: + if s >= u: + print ('YES') + else: + print ('NO') +else: + if ss <= uu: + print ('YES') + else: + print ('NO')" +p02646,s440294743,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +d=abs(a-b) +u = v-w +if d-u*t<=0: + print(""YES"") + +else: + print('NO')" +p02646,s270622064,Accepted,"a = list(map(int, input().split())) +b = list(map(int, input().split())) +num = int(input()) +c = a[0] - b[0] +if c < 0: + c *= -1 +if a[1] <= b[1]: + print(""NO"") +else: + if (a[1] - b[1]) * num >= c: + print(""YES"") + else: + print(""NO"")" +p02646,s860799161,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +if W >= V: + print('NO') +elif abs(B-A)/(V-W) <= T: + print('YES') +else: + print('NO')" +p02646,s719577430,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +d = abs(b - a) +u = v - w + +if d == 0: + print(""YES"") +elif u <= 0: + print(""NO"") +elif d <= t * u: + print(""YES"") +else: + print(""NO"")" +p02646,s879433071,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if (V-W) * T >= abs(A-B): + print('YES') +else: + print('NO') +" +p02646,s537427405,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if V <= W: + print(""NO"") +else: + if abs(A-B)/(V-W) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s326425785,Accepted,"A, a = input().split() +B, b = input().split() +T = input() + +A = int(A) +a = int(a) +B = int(B) +b = int(b) +T = int(T) + +distance = abs(A-B) +speed = a-b + +if distance - speed * T <= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s297475096,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +dif =abs(A - B) +if W >= V: + print(""NO"") +else: + oni = V*T - W*T + if oni >= dif: + print(""YES"") + else: + print(""NO"") +" +p02646,s796654079,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() +else: + if (v - w) * t >= abs(b - a): + print('YES') + else: + print('NO')" +p02646,s310934655,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if (V-W)*T>=abs(A-B): + print('YES') +else: + print('NO')" +p02646,s480746917,Accepted,"A, V = map(int, input().split(' ')) +B, W = map(int, input().split(' ')) +T = int(input()) + +d = abs(A - B) +v = abs(V - W) + +if d <= v * T: + if V > W: + print('YES') + else: + print('NO') +else: + print('NO') +" +p02646,s609827973,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +a_dis = t*v +b_dis = abs(a-b) + t*w + +if a_dis >= b_dis: + print(""YES"") +else: + print(""NO"")" +p02646,s114289619,Accepted,"import sys +input = sys.stdin.readline + + +def main(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + + d = v - w + + if abs(a-b) <= t * d: + print(""YES"") + else: + print(""NO"") + + +if __name__ == ""__main__"": + main() +" +p02646,s759590227,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +K=int(input()) +Apos=A +Bpos=B +count=0 +rev=False +if B>A: + pass +else: + rev=True + +if rev==False: + + + + A=A+V*K + B=B+W*K + if A>=B: + print(""YES"") + exit() + + + +else: + A=A-V*K + B=B-W*K + if A<=B: + print(""YES"") + exit() + +print(""NO"")" +p02646,s408813861,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if V-W<=0: + print(""NO"") +else: + t = abs(A-B)/(V-W) + if T>=t: + print(""YES"") + else: + print(""NO"")" +p02646,s898681893,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v<=w: + print(""NO"") +else: + print(""YES"" if abs(a-b)/(v-w)<=t else ""NO"")" +p02646,s289771631,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if(A < B): + oni = A + V*T + chi = B + W*T + if(oni>=chi): + print('YES') + else: + print('NO') +else: + oni = B + V*T + chi = A + W*T + if(oni>=chi): + print('YES') + else: + print('NO')" +p02646,s425032585,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if (v-w)*t>=abs(a-b): + print(""YES"") +else: + print(""NO"") +" +p02646,s584085387,Accepted,"from sys import stdin +A, V = [int(_) for _ in stdin.readline().rstrip().split()] +B, W = [int(_) for _ in stdin.readline().rstrip().split()] +T = int(stdin.readline().rstrip()) +if abs(A-B) <= (V-W)*T: + print(""YES"") +else: + print(""NO"")" +p02646,s531923506,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) +if (v<=w): + print(""NO"") +else: + if (abs(a-b)/(v-w) <= t): + print(""YES"") + else: + print(""NO"")" +p02646,s739546017,Accepted,"A,V = list(map(int,input().split())) +B,W = list(map(int,input().split())) +T = int(input()) +if abs(A-B)- (V-W)*T <= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s614224593,Accepted,"A,V= map(int,input().split()) +B,W= map(int,input().split()) +T = int(input()) + +if A == B: + print('YES') + exit() + +if V <= W: + print('NO') + exit() + +L = abs(A-B) +rV = V - W + +if L <= rV*T: + print('YES') +else: + print('NO') +" +p02646,s700756505,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +m = abs(A-B) +if V*T >= m+W*T: + print('YES') +else: + print('NO')" +p02646,s154056512,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if a==b: + print(""YES"") +elif b W and abs(A - B) <= abs((W - V) * T): + print(""YES"") +else: + print(""NO"") +" +p02646,s567528546,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +print(['NO', 'YES'][a == b or ((v-w) > 0 and abs(b-a)/(v-w) <= t)])" +p02646,s217128364,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V == W: + print(""NO"") + exit() +if A > B: + t1 = A + A = B + B = t1 +if V < W: +# print(""A"") + print(""NO"") + exit() +if (A + V*T) - (B + W*T) >= 0: + print(""YES"") + exit() +else: + print(""NO"") + exit()" +p02646,s364963102,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if V <= W: + print(""NO"") +else: + if abs((B-A))/(V-W) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s933288410,Accepted,"A = list(map(int, input().split())) +B = list(map(int, input().split())) +S = int(input()) +if abs(A[0]-B[0]) <= ((A[1]-B[1]) * S): + print(""YES"") +else: + print(""NO"")" +p02646,s227811881,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +a_spot = a + (v*t) +b_spot = b + (w*t) +A_spot = a - (v*t) +B_spot = b - (w*t) +if a <= b: + + if a_spot >= b_spot: + print(""YES"") + else: + print(""NO"") + +else: + if A_spot <= B_spot: + print(""YES"") + else: + print(""NO"")" +p02646,s099612776,Accepted,"A,V = list(map(int,input().split())) +B,W = list(map(int,input().split())) +T = int(input()) + +if A= B+T*W: + print(""YES"") + else: + print(""NO"") +elif A>B: + if A-T*V <= B-T*W: + print(""YES"") + else: + print(""NO"") +else: + print(""YES"")" +p02646,s266398925,Accepted,"import sys + +A, V = [int(x) for x in input().strip().split("" "")] +B, W = [int(x) for x in input().strip().split("" "")] +T = int(input().strip()) + +if V <= W: + print(""NO"") + sys.exit(0) + +distance = abs(A - B) +diff = abs(V - W) + +t, distance = divmod(distance, diff) +T -= t +if distance == 0 and T >= 0: + print(""YES"") + sys.exit(0) +elif T > 0: + print(""YES"") + sys.exit(0) +print(""NO"") +sys.exit(0) +" +p02646,s076527102,Accepted,"import sys + +A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if V <= W: + print('NO') + sys.exit() +if 0 < abs((B-A))/(V-W) <= T: + print('YES') +else: + print('NO') + +" +p02646,s511956316,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a < b: + if a+v*t >= b+w*t: + print(""YES"") + else: + print(""NO"") +else: + if a-v*t <= b-w*t: + print(""YES"") + else: + print(""NO"")" +p02646,s153586346,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v <= w: + print(""NO"") + exit() +if (v-w)*t >= abs(b-a): + print(""YES"") +else: + print(""NO"") + + +" +p02646,s805784261,Accepted," +A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +D = abs(A-B) + +d = V-W + +if D - d*T <= 0: + print(""YES"") +else: + print(""NO"")" +p02646,s097992901,Accepted,"a,V = map(int,input().split()) +b,W = map(int,input().split()) +T = int(input()) + +d = abs(a-b) + +v = max(V-W,0) + +print('YES' if v*T >= d else 'NO') + +" +p02646,s509183270,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a <= b: + print(""YES"" if a + v * t >= b + w * t else ""NO"") +else: + print(""YES"" if b - w * t >= a - v * t else ""NO"") +" +p02646,s591553775,Accepted,"a, x = map(int,input().split()) +b, y = map(int,input().split()) +t = int(input()) + +if (x-y)*t >= abs(a-b): + print(""YES"") +else: + print(""NO"") +" +p02646,s165691431,Accepted,"import numpy as np + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + print(""NO"") +elif np.abs(A - B) / (V - W) <= T: print(""YES"") +else: + print(""NO"")" +p02646,s174142488,Accepted,"A = list(map(int, input().split())) +B = list(map(int, input().split())) +T = int(input()) +x=abs(A[0]-B[0]) +v=A[1]-B[1] + +if v*T>=x: + print('YES') +else: + print('NO')" +p02646,s981148792,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V <= W: + print(""NO"") + exit() +dis = abs(A - B) +step = abs(W - V) +print(""YES"" if dis <= step * T else ""NO"")" +p02646,s459114196,Accepted,"import sys +input = lambda : sys.stdin.readline().rstrip() +sys.setrecursionlimit(max(1000, 10**9)) +write = lambda x: sys.stdout.write(x+""\n"") + + +a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) +if v>w and abs(a-b)<=(v-w)*t: + print(""YES"") +else: + print(""NO"")" +p02646,s216135352,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +ans = ""NO"" +if a <= b: + if v * t + a >= w * t + b: + ans = ""YES"" +else: + if a - (v * t) <= b - (w * t): + ans = ""YES"" +print(ans)" +p02646,s625694049,Accepted,"A,V=list(map(int,input().split())) +B,W=list(map(int,input().split())) +T=int(input()) + + +if V<=W : + ans = ""NO"" +else: + if abs(B-A) <= abs(V-W)*T: + ans = ""YES"" + else: + ans = ""NO"" + +print(ans) + +" +p02646,s508439733,Accepted,"import sys +input = sys.stdin.readline + +A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if V<=W: + print(""NO"") +else: + D=abs(A-B) + if (V-W)*T>=D: + print(""YES"") + else: + print(""NO"")" +p02646,s984135162,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +dist = abs(a-b) +x = v-w +if t*x >= dist: + ans = ""YES"" +else: + ans = ""NO"" +print(ans)" +p02646,s591505840,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +S=V-W +d=abs(A-B) +if S <=0: + print(""NO"") +elif d<=T*S: + print(""YES"") +else: + print(""NO"") +" +p02646,s092510312,Accepted,"import sys + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w >= v: + print('NO') + sys.exit() + +min_a = -1 * v * t + a +max_a = v * t + a +min_b = -1 * w * t + b +max_b = w * t + b + +if min_a <= min_b and max_b <= max_a: + print('YES') +else: + print('NO')" +p02646,s126615249,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +d = abs(A - B) +dV = V - W + +if dV == 0: + print(""NO"") +elif dV < 0: + print(""NO"") + +elif d / dV <= T: + print('YES') +else: + print(""NO"")" +p02646,s327962842,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +L=abs(A-B) +if W > V: + print('NO') + exit() + +C = T * (V-W) + +if L > C: + print('NO') +else: + print('YES') + +" +p02646,s362980101,Accepted," +l=list(map(int, input().split(' '))) +a=l[0] +v=l[1] +l=list(map(int, input().split(' '))) +b=l[0] +w=l[1] +s=int(input()) +ans=True +if a>b: + ans=a-v*s<=b-w*s +else: + ans=a+v*s>=b+w*s +if ans: + print(""YES"") +else: + print(""NO"") + + +" +p02646,s243412302,Accepted,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +kyori = abs(A - B) + +if kyori + W * T <= V * T: + print('YES') +else: + print('NO') +" +p02646,s622084216,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if a > b: + if a - v * t <= b - w * t: + print('YES') + else: + print('NO') +elif a == b: + print('YES') +else: + if a + v * t >= b + w * t: + print('YES') + else: + print('NO') + + +" +p02646,s632457722,Accepted,"#import math + +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +ans=a+t*v>=b+t*w and a-t*v<=b-t*w +print('YES' if ans else 'NO') +" +p02646,s507498965,Accepted,"#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import array +from bisect import * +from collections import * +import fractions +import heapq +from itertools import * +import math +import random +import re +import string +import sys + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dA = V * T +dB = W * T +d = dA - dB +if d >= abs(A - B): + print(""YES"") +else: + print(""NO"") + + +" +p02646,s736740352,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) + +t = int(input()) + +if v <= w: + print(""NO"") + +else: + ans = (b - a) / (v - w) + if t >= abs(ans): + print(""YES"") + else: + print(""NO"")" +p02646,s070973931,Accepted,"import sys +input = sys.stdin.readline +import numpy as np + +a, v = map(int, input().strip().split()) +b, w = map(int, input().strip().split()) +t = int(input()) + +dis = abs(b-a) +hayasa = v-w +ikeru = 0 +if hayasa<= 0: + pass +else: + if t*hayasa >= dis: + ikeru = 1 + else: + pass + +if ikeru == 1: + print(""YES"") +else: + print(""NO"") +" +p02646,s786337722,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if a < b: + if a + v * t >= b + w * t: + print(""YES"") + else: + print(""NO"") +elif a > b: + if a - v * t <= b - w * t: + print(""YES"") + else: + print(""NO"") +" +p02646,s395569132,Accepted,"a, v = map( int, input().split() ) +b, w = map( int, input().split() ) +t = int( input() ) + +if abs( b - a ) / t <= v - w: + print( ""YES"" ) +else: + print( ""NO"" )" +p02646,s010278512,Accepted,"a,v=map(int, input().split()) +b,w=map(int, input().split()) +t=int(input()) +dist=abs(b-a) +dist2=(v-w)*t +if dist>dist2: + print(""NO"") +else: + print(""YES"")" +p02646,s340815491,Accepted,"ax, va = [int(v) for v in input().split()] +bx, vb = [int(v) for v in input().split()] +t = int(input()) + +if vb >= va: + print(""NO"") +else: + vd = va - vb + x = abs(ax - bx) + if x <= vd * t: + print(""YES"") + else: + print(""NO"") +" +p02646,s029159741,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v <= w: + print(""NO"") + exit() +else: + if abs(b-a) <= (v-w)*t: + print(""YES"") + else: + print(""NO"") + " +p02646,s064972645,Accepted,"def main() -> None: + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + if W >= V: + print(""NO"") + else: + print(""YES"" if (V - W) * T >= abs(B - A) else ""NO"") + + +if __name__ == '__main__': + main() +" +p02646,s103005264,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +d = abs(a-b) +if v <= w: + print('NO') +else: + if (v-w)*t < d: + print('NO') + else: + print('YES') +" +p02646,s154696952,Accepted,"A,V = map(int, input().split()) +B,W= map(int, input().split()) +T = int(input()) +print('YES' if abs(A-B) <= (V-W)*T else 'NO')" +p02646,s362272856,Accepted,"import math + +def a(): + s = input() + print(s[:3]) + + +def b(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + if v > w: + if abs(a-b) / (v -w) <= t: + print('YES') + else: + print('NO') + else: + print('NO') + + +def c(): + print('') + + + +def d(): + print('') + + +b()" +p02646,s261441336,Accepted,"a, v = list(map(int, input().split())) +b, w = list(map(int, input().split())) +t = int(input()) + +if v - w > 0 and abs(b-a)/(v-w)<=t: + print('YES') +else: + print('NO')" +p02646,s842687082,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if b > a: + t_b = b + t*w + t_a = a + t*v + if t_a >= t_b: + print('YES') + else: + print('NO') +else: + t_b = b - t*w + t_a = a - t*v + if t_a <= t_b: + print('YES') + else: + print('NO') +" +p02646,s575262189,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if abs(a-b) <= (v*t - w*t): + print('YES') +else: + print('NO')" +p02646,s670487478,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if W>=V: + print('NO') +else: + key=abs(A-B) + if key+W*T>V*T: + print('NO') + else: + print('YES')" +p02646,s605416290,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs(a-b) <= (v-w)*t: + print(""YES"") + +else: + print(""NO"")" +p02646,s083783858,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +check1=abs(A-B) +check2=(V-W)*T +print(""YES"" if check1<=check2 else ""NO"") +" +p02646,s256987821,Accepted,"from sys import stdin +input = stdin.readline + +A,V = input().rstrip().split() +B,W = input().rstrip().split() +T = int(input().rstrip()) +A,V,B,W = int(A),int(V),int(B),int(W) +s=0 +L1=A-B +L2=B-A +S=V-W +if V<=W: + print('NO') + s=1 +else: + if B= br: + ans = ""YES"" +elif B < A: + if al <= bl: + ans = ""YES"" +else: + ans = ""YES"" + +print(ans) +" +p02646,s692950845,Accepted,"A,V=map(int, input().split()) +B,W=map(int, input().split()) +T=int(input()) +sa=abs(A-B) +hayasa=V-W +if hayasa*T>=sa: + print(""YES"") +else: + print(""NO"")" +p02646,s192134994,Accepted,"a,v = [int(x) for x in input().split()] +b,w = [int(x) for x in input().split()] +t = int(input()) +if abs(a-b) <= (v-w) * t: + print(""YES"") +else: + print(""NO"")" +p02646,s549465814,Accepted,"a, v = [int(i) for i in input().split()] +b, w = [int(i) for i in input().split()] +t = int(input()) + +if w >= v: + print(""NO"") + exit() +#print((b-a) / (v-w)) + +if b > a: + if a + v*t >= b + w*t: + print(""YES"") + else: + print(""NO"") +else : + if a - v*t <= b - w*t: + print(""YES"") + else: + print(""NO"") +" +p02646,s736289677,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +zzz = abs(a - b) +yyy = v - w + +if yyy <= 0: + print('NO') + +elif zzz / yyy <= t: + print('YES') +else: + print('NO') +" +p02646,s618576186,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if abs(a-b)<=(v-w)*t: + print('YES') +else: + print('NO') +" +p02646,s476953931,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +D = float(abs(A-B)) +E = float(V - W) + +if E <= 0: + print(""NO"") + exit() +time = D/E +if time <= T: + print(""YES"") +else: + print(""NO"")" +p02646,s033491811,Accepted,"# coding: utf-8 +import sys + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +A, V = lr() +B, W = lr() +if A == B: + print('YES'); exit() +T = ir() +speed = V - W +if speed <= 0: + print('NO'); exit() + +bl = abs(A-B) / speed <= T +print('YES' if bl else 'NO') +" +p02646,s723448250,Accepted,"a,v= map(int, input().split()) +b,w= map(int, input().split()) +t=int(input()) + +if w>=v: + print(""NO"") + +elif (abs(a-b)/abs(v-w))<=t: + print(""YES"") + +else : + print(""NO"")" +p02646,s257846463,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if abs(a-b) <= t*(v-w): + print('YES') +else: + print('NO')" +p02646,s192097781,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if w>=v: + print('NO') + exit() +if abs(a-b)-t*(v-w)<=0: + print('YES') +else: + print('NO')" +p02646,s726270054,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +y=abs(B-A) +x=V-W +if x*T-y>=0: + print(""YES"") +else: + + print(""NO"")" +p02646,s938448926,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +D = abs(B - A) +S = abs(V - W) + +if V <= W: + print('NO') +else: + X = S*T + if X >= D: + print('YES') + else: + print('NO')" +p02646,s406278175,Accepted,"import random as rng +import itertools as it +import collections as col +import heapq as hq +import sys +import copy as cp +sys.setrecursionlimit(10**9) + + +def dump_impl(*objects): + print(*objects, file=sys.stderr) + + +def dump_dummy(*objects): + pass + + +dump = dump_impl if ""DEBUG"" in sys.argv else dump_dummy + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +print(""YES"" if abs(A-B)+W*T <= V*T else ""NO"") +" +p02646,s212012774,Accepted,"a, v=map(int, input().split()) +b, w=map(int, input().split()) +t=int(input()) + +distance=abs(a-b) +speed=v-w + +if speed<=0: + print(""NO"") +else: + if distance/speed <=t: + print(""YES"") + else: + print(""NO"")" +p02646,s814049622,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if b > a: + av = a + v * t + bw = b + w * t + + if av >= bw: + print(""YES"") + else: + print(""NO"") +else: + av = a - v * t + bw = b - w * t + + if av <= bw: + print(""YES"") + else: + print(""NO"")" +p02646,s397410097,Accepted,"a=list(map(int,input().split())) +b=list(map(int,input().split())) +t=int(input()) +sa=a[1]-b[1] +d=abs(a[0]-b[0]) +if sa<=0: + print('NO') +elif sa*t w: + # 1秒あたり距離はv-wだけ縮まる + # t秒の時の距離は(v-w)*t + # それが|a-b| の距離に間に合うor追い越せるかどうか + if abs(a - b) <= (v - w) * t: + # if t <= abs(a - b): + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s604424784,Accepted,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +distance = abs(A-B) +speed = V - W + +if speed > 0: + if distance / speed <= T: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s180178933,Accepted," + +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +l=abs(a-b) +v=v-w +if v<=0: + print(""NO"") +elif l/v<=t: + print(""YES"") +else: + print(""NO"") + +" +p02646,s396136588,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +d = v - w +if d <= 0: + print(""NO"") + exit() + +if abs(a-b) <= t * d: + print(""YES"") +else: + print(""NO"") +" +p02646,s547778334,Accepted,"# encoding:utf-8 +import copy +import random +import bisect #bisect_left これで二部探索の大小検索が行える +import fractions #最小公倍数などはこっち +import math +import sys +import collections + +mod = 10**9+7 +sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000 + +d = collections.deque() +def LI(): return list(map(int, sys.stdin.readline().split())) + +A,V = LI() +B,W = LI() +T = int(input()) + +if abs(A-B) <= (V-W) * T: + print(""YES"") +else: + print(""NO"")" +p02646,s178457244,Accepted,"# + +import sys +input=sys.stdin.readline + +def main(): + A,V=map(int,input().split()) + B,W=map(int,input().split()) + T=int(input()) + y=0 + d=abs(A-B) + if V!=W: + t=d/(V-W) + if 0<=t<=T: + y=1 + + if y==1: + print(""YES"") + else: + print(""NO"") + + + +if __name__==""__main__"": + main() +" +p02646,s385073064,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +dist = abs(A-B) + +vel = abs(W-V) + +if V*T >= W*T + dist: + print(""YES"") +else: + print(""NO"")" +p02646,s125069775,Accepted,"A,V = [int(v) for v in input().split()] +B,W = [int(v) for v in input().split()] +T = int(input()) + +if A > B: + V *= -1 + W *= -1 + +A_d = V * T + A +B_d = W * T + B + +if A < B: + if A_d >= B_d: + print(""YES"") + else: + print(""NO"") +elif A > B: + if A_d <= B_d: + print(""YES"") + else: + print(""NO"") +else: + print(""YES"") +" +p02646,s958298724,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +print('YES' if (V - W) * T >= abs(B - A) else 'NO') +" +p02646,s328870050,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +ans = ""NO"" +if a < b: + if a + v * t >= b + w * t: + ans = ""YES"" +else: + if b - w * t >= a - v * t: + ans = ""YES"" +print(ans) +" +p02646,s253774799,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a < b: + if v <= w: + print('NO') + else: + if b - a <= t * (v - w): + print('YES') + else: + print('NO') +elif a > b: + if v <= w: + print('NO') + else: + if a - b <= t * (v - w): + print('YES') + else: + print('NO')" +p02646,s978286009,Accepted,"A , V = map(int, input().split()) +B , W = map(int, input().split()) +T = int(input()) +flag = 0 + +if (V - W) <= 0: + flag = 0 +else: + if ((V - W) * T) >= abs(A - B): + flag = 1 + +if flag == 1: + print(""YES"") +else: + print(""NO"")" +p02646,s273688215,Accepted,"import sys +a,v = map(int, sys.stdin.readline().rstrip(""\n"").split()) +b,w = map(int, sys.stdin.readline().rstrip(""\n"").split()) +t = int(sys.stdin.readline().rstrip(""\n"")) +between = abs(b - a) +speed = v-w +if between <= speed*t: + print('YES') +else: + print('NO')" +p02646,s797903687,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V >= W and abs(A - B) <= (V - W) * T: + print(""YES"") +else: + print(""NO"") +" +p02646,s163387040,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +X = abs(B-A) +Y = V-W + +if Y <= 0: + print('NO') + exit() + +if Y == 0: + print('NO') +else: + if Y*T >= X: + print('YES') + else: + print('NO')" +p02646,s355402842,Accepted,"A, V=map(int,input().split()) +B, W=map(int,input().split()) +T =int(input()) +D = abs(A-B) + +if (V-W)*T>=D: + print(""YES"") +#elif 10**9-A<=V*T and AB: +# print(""YES"") +else: + print(""NO"") +" +p02646,s852917990,Accepted,"a,v=[int(x) for x in input().split()] +b,w=[int(x) for x in input().split()] +t=int(input()) +delta_v=v-w +if delta_v <= 0: + print(""NO"") +else: + T=(abs(b-a))/delta_v + if T <= t: + print(""YES"") + else: + print(""NO"")" +p02646,s268866016,Accepted,"import sys + +readline = sys.stdin.readline +readall = sys.stdin.read +ns = lambda: readline().rstrip() +ni = lambda: int(readline().rstrip()) +nm = lambda: map(int, readline().split()) +nl = lambda: list(map(int, readline().split())) +prn = lambda x: print(*x, sep='\n') + +def solve(): + a, v = nm() + b, w = nm() + t = ni() + if abs(a - b) <= (v - w) * t: + print('YES') + else: + print('NO') + return + +solve() +" +p02646,s541434479,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v>w: + if (v-w)*t>=abs(a-b): + print('YES') + else: + print('NO') +else: + print('NO')" +p02646,s035812135,Accepted,"a, v, = map(int, input().split()) +b, w, = map(int, input().split()) +t = (int)(input()) + +# 方向 +dir = 1 +if b < a: + dir = -1 + +# 移動先 +pos_a = a + v * dir * t +pos_b = b + w * dir * t + +ret = ""NO"" +if dir == 1 and pos_a >= pos_b: + ret = ""YES"" +elif dir == -1 and pos_b >= pos_a: + ret = ""YES"" + +print(""{}"".format(ret))" +p02646,s404883116,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if abs(A-B) <= T*(V-W): + print(""YES"") +else: + print(""NO"") +" +p02646,s030020734,Accepted," +A,V = map(int,input().split()) + +B,W = map(int,input().split()) + +T = int(input()) + +dif = abs(A-B) + +if dif <= (V-W)*T: + print (""YES"") +else: + print (""NO"") +" +p02646,s904545034,Accepted,"import sys + +a,v=map(int, input().split()) +b,w=map(int, input().split()) +t=int(input()) +if b > a: + dif = b - a +elif b < a: + dif = a - b + +if v <= w: + print(""NO"") + sys.exit(0) + +nowdif = v - w +if dif <= nowdif * t: + print(""YES"") + sys.exit(0) + +print(""NO"") +" +p02646,s394967606,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) +if v-w>0: + if abs(a-b)/(v-w) <= t: + print('YES') + exit() +print('NO') + +" +p02646,s604453028,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if abs(b-a)<= (v-w)*t: + print (""YES"") + +else: + print(""NO"") +" +p02646,s546179643,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +d = abs(b-a) +d2 = v-w +print('YES' if d <= d2*t else 'NO')" +p02646,s319542419,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs(a - b) <= (v - w) * t: + print('YES') +else: + print('NO')" +p02646,s974467646,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A < B: + if (A+V*T >= B+ W*T): + print(""YES"") + else: + print(""NO"") +else: + if (A-V*T <= B - W*T): + print(""YES"") + else: + print(""NO"")" +p02646,s382929163,Accepted,"A, V= map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +def hantei(A,B,V,W,T): + if V <= W: + return('NO') + else: + if abs(B - A)/(V - W) <= T: + return('YES') + else: + return('NO') + +print(hantei(A,B,V,W,T))" +p02646,s852311017,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + + +if (a*b) < 0: + child = max(a,b) - min(a,b) +else: + child = abs(b-a) + +mother = v-w +if mother <= 0: + print('NO') + exit() + +n = child/mother +if n>0 and n<=t: + print('YES') +else: + print('NO')" +p02646,s723671204,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + print(""NO"") + exit() + +d = abs(A - B) +s = V - W + +if d <= s * T: + print(""YES"") +else: + print(""NO"") +" +p02646,s396214030,Accepted,"import sys +input = sys.stdin.readline +# sys.setrecursionlimit(100000) + + +def main(): + A, V = [int(i) for i in input().strip().split()] + B, W = [int(i) for i in input().strip().split()] + T = int(input().strip()) + if abs(A - B) <= (V - W) * T: + return ""YES"" + else: + return ""NO"" + + +if __name__ == ""__main__"": + print(main()) +" +p02646,s939540560,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if (v-w)*t>=abs(a-b): + print(""YES"") +else: + print(""NO"")" +p02646,s856693395,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +dis = abs(A-B) +n = V-W +if dis <= n*T: + print('YES') +else: + print('NO')" +p02646,s804426713,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +if A < B: + ans = A+V*T >= B+W*T +else: + ans = A-V*T <= B-W*T + +if ans: + print(""YES"") +else: + print(""NO"")" +p02646,s999011504,Accepted,"a, v = map(int,input().split()) + +b, w = map(int,input().split()) + +t = int(input()) + +at = abs(v*t) +bt = abs(w*t) +if v<=w: + print('NO') +elif v>w and (at-bt < abs(a-b)): + print('NO') +else: + print('YES')" +p02646,s192599627,Accepted,"A , V = map(int, input().split()) +B , W = map(int, input().split()) +T = int(input()) +if A < B: + Am = A + (V * T) + Bm = B + (W * T) + if Am >= Bm: + print(""YES"") + else: + print(""NO"") +if A > B: + Am = A - (V * T) + Bm = B - (W * T) + if Am <= Bm: + print(""YES"") + else: + print(""NO"") +" +p02646,s077338616,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +speed_dif = (v - w) * t +dis_dif = abs(a - b) + +if dis_dif <= speed_dif: + print('YES') +else: + print('NO')" +p02646,s507427080,Accepted,"if __name__ == '__main__': + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + l =abs(a - b) + s=abs(v - w) + + if w >= v or l / s > t: + print(""NO"") + else: + print(""YES"") +" +p02646,s964322370,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +k=abs(a-b) +if w-v>0: + print(""NO"") +elif w==v: + if k==0: + print(""YES"") + else: + print(""NO"") +else: + if k<=(v-w)*t: + print(""YES"") + else: + print(""NO"")" +p02646,s597823680,Accepted,"A , V = map(int, input().split()) +B , W = map(int, input().split()) +T = int(input()) +if A < B: + if A+T*V < B+T*W: + print(""NO"") + else: + print(""YES"") +else: + if A-T*V > B - T*W: + print(""NO"") + else: + print(""YES"") +" +p02646,s245777287,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w-v < 0 and (abs(b-a))/(abs(w-v)) <= t: + print('YES') +else: + print('NO') + + +" +p02646,s384705178,Accepted,"import sys + + +def input(): + return sys.stdin.readline().strip() + + +sys.setrecursionlimit(20000000) + +MOD = 10 ** 9 + 7 +INF = float(""inf"") + + +def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + diff = abs(A - B) + mov = V - W + if mov <= 0: + print(""NO"") + elif mov * T < diff: + print(""NO"") + else: + print(""YES"") + + +if __name__ == ""__main__"": + main() +" +p02646,s147344157,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if((b-a) > 0): + a = a+v*t + b = b+w*t + if(a >= b): + print(""YES"") + else: + print(""NO"") + +elif((b-a) < 0): + a = a-v*t + b = b-w*t + if(a <= b): + print(""YES"") + else: + print(""NO"") + " +p02646,s902845854,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs(a-b) > (v-w)*t: + print(""NO"") +else: + print(""YES"")" +p02646,s632645984,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +k=abs(b-a) +s=w-v + +print(""YES"" if s<=0 and k+t*s<=0 else ""NO"")" +p02646,s343465827,Accepted,"AV = input().split() +BW = input().split() +T = int(input()) + +if(int(AV[0]) > int(BW[0])): + T *= -1 + +a = int(AV[0]) + int(AV[1]) * T +b = int(BW[0]) + int(BW[1]) * T + +if(T >=0 and a >= b): + print('YES') +elif(T <= 0 and a <= b): + print('YES') +else: + print('NO') +" +p02646,s491222318,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if V-W<=0 or abs(B-A)/(V-W)>T: + print('NO') +else: + print('YES')" +p02646,s076060624,Accepted,"A, V = list(map(int,input().split())) +B, W = list(map(int,input().split())) +N = int(input()) +dis = abs(B - A) +if W >= V: + print(""NO"") +else: + dx = V - W + if dis <= N * (V - W): + print(""YES"") + else: + print(""NO"")" +p02646,s333569564,Accepted,"def input_int(): + return map(int, input().split()) + +def one_int(): + return int(input()) + +def one_str(): + return input() + +def many_int(): + return list(map(int, input().split())) + +A, V = input_int() +B, W = input_int() + +T = one_int() + +speed = (V-W) + +kyori = abs(B-A) + +if speed*T >= kyori: + print(""YES"") +else: + print(""NO"")" +p02646,s883206513,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v == w: + print(""NO"") +else: + if w > v: + print(""NO"") + else: + if abs(b-a) / (v-w) <= t: + print(""YES"") + else: + print(""NO"")" +p02646,s660304259,Accepted,"# coding: utf-8 + +a, v = map(int, input().rstrip().split()) +b, w = map(int, input().rstrip().split()) +t = int(input().rstrip()) + +length = abs(a-b) +diff = (v-w)*t + +if length <= diff: + print('YES') +else: + print('NO') +" +p02646,s117232442,Accepted,"import sys +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +ri = lambda: int(sys.stdin.readline()) +a, v = rm() +b, w = rm() +t = ri() +if v - w == 0: + print('NO') + exit() +if 0 <= abs(a-b) / (v-w) <= t: + print('YES') +else: + print('NO') + +" +p02646,s051045096,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a < b: + a += v * t + b += w * t + if a >= b: + print(""YES"") + else: + print(""NO"") +else: + a -= v * t + b -= w * t + if a <= b: + print(""YES"") + else: + print(""NO"")" +p02646,s085947435,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if A=B_T: + print('YES') + else: + print('NO') +else: + A_T=A-V*T + B_T=B-W*T + if A_T<=B_T: + print('YES') + else: + print('NO')" +p02646,s707240172,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +dist = abs(A-B) +delta = V-W +res = 'YES' +if W>V: + res = 'NO' +else: + if delta*T >= dist: + res = 'YES' + else: + res = 'NO' +print(res) + + + +" +p02646,s565385795,Accepted,"A, V = [int(i) for i in input().split()] +B, W = [int(i) for i in input().split()] +T = int(input()) + +print('YES' if V > W and abs(A - B) <= T * (V - W) else 'NO')" +p02646,s854641030,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V > W: + t = max(A-B, B-A) / (V-W) + if t <= T: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s431662680,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +dis = abs(B - A) +speed = V - W + + +if dis <= speed*T: + print(""YES"") +else: + print(""NO"") +" +p02646,s093077105,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dist = abs(B - A) +relv = W - V +if relv == 0: + print(""NO"") +elif relv < 0 and dist/abs(relv) <= T: + print(""YES"") +else: + print(""NO"")" +p02646,s886205745,Accepted,"a, v= map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if t*(v-w) >= abs(a-b): + print('YES') +else: + print('NO')" +p02646,s555148341,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +ans=""NO"" +if v>w: + if abs(b-a)/abs(w-v)<=t: + ans=""YES"" +print(ans) +" +p02646,s350184474,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +if (V-W)*T >= abs(A-B): + print(""YES"") +else: + print(""NO"") +# +" +p02646,s909698393,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +diff = (V - W)*T; +if abs(A-B) <= diff: + print(""YES"") +else: + print(""NO"") + " +p02646,s758522913,Accepted,"def resolve(): + A, V = [int(i) for i in input().split()] + B, W = [int(i) for i in input().split()] + T = int(input()) + if (V - W) * T >= abs(B - A): + print(""YES"") + else: + print(""NO"") + + +resolve() +" +p02646,s436791466,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if A < B and B+W*T <= A+V*T: + print(""YES"") +elif A > B and B-W*T >= A-V*T: + print(""YES"") +else: + print(""NO"") +" +p02646,s037483713,Accepted,"def resolve(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + ans = 'NO' + + if V > W: + if A > B: + t = (B-A)/(W-V) + else: + t = (B - A) / (V - W) + + if t <= T: + ans = 'YES' + + print(ans) + +if __name__ == '__main__': + resolve()" +p02646,s434078929,Accepted,"from decimal import Decimal +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if v==w: + print(""NO"") + exit() +atai = Decimal(abs(b-a))/Decimal(abs(v-w)) +if atai<=t and a+v*t>=b+w*t: + print(""YES"") +else: + print(""NO"") +" +p02646,s971912895,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if A <= B and A+T*V >= B+T*W: + print(""YES"") +elif A >=B and A-T*V <= B-T*W: + print(""YES"") +else: + print(""NO"")" +p02646,s089043199,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V<=W: + print(""NO"") + import sys + sys.exit() +import math +if abs(B-A)/(V-W) <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s000205899,Accepted,"A, V = [int(_) for _ in input().split()] +B, W = [int(_) for _ in input().split()] +T = int(input()) + +if V <= W: + print(""NO"") +else: + X = abs(A - B) + Y = V - W + if X > Y * T: + print(""NO"") + else: + print(""YES"") +" +p02646,s657400330,Accepted,"a, v = map(int, input().split()) + +b, w = map(int, input().split()) + +t = int(input()) + +if abs(a - b) <= (v - w) * t: + print(""YES"") +else: + print(""NO"") +" +p02646,s475477106,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T=int(input()) +if (V-W)<=0: + print('NO') +else: + if (V-W)*T>=abs(A-B): + print('YES') + else: + print('NO') +" +p02646,s900532635,Accepted,"A,V,B,W,T=map(int, open(0).read().split()) +if W==V: + print(""NO"") + exit() +ans=W b: + if a - v*t <= b - w*t: + print('YES') + else: + print('NO') +else: + if a + v*t >= b+w*t: + print('YES') + else: + print('NO')" +p02646,s546066624,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +x=abs(b-a) +y=v-w +z=x-t*y +if z<=0: + print(""YES"") +else: + print(""NO"")" +p02646,s160993549,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if(A=B1): + print('YES') + else: + print('NO') + +else: + A1=A-V*T + B1=B-W*T + + if(A1<=B1): + print('YES') + else: + print('NO')" +p02646,s390739272,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if W >= V: + print('NO') +elif (V - W) * T >= abs(A - B): + print('YES') +else: + print('NO')" +p02646,s333183960,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if abs(a-b)>(v-w)*t: + print('NO') +else: + print('YES')" +p02646,s031082563,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +d = abs(a-b) +closing_speed = v - w +print(""YES"" if closing_speed * t >= d else ""NO"")" +p02646,s305082307,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if v <= w: + print(""NO"") +elif (v-w) * t >= abs(a-b): + print(""YES"") +else: + print(""NO"")" +p02646,s107546352,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +print('YES' if abs(b-a) <= (v-w) * t else 'NO')" +p02646,s014534065,Accepted,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) + + +if (abs(a-b) <= t*(v-w)): + print(""YES"") +else: + print(""NO"")" +p02646,s167362571,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +R = abs(A - B) +R2 = (V - W) * T + +if R2 >= R: + print(""YES"") +else: + print(""NO"") + +" +p02646,s497720151,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t =int(input()) + +l = abs(a-b) +if t*(v-w) >= l: + print(""YES"") +else: + print(""NO"")" +p02646,s880364438,Accepted,"a, v = tuple(map(int, input().split())) +b, w = tuple(map(int, input().split())) +t = int(input()) + +if v-w <= 0: + print('NO') + exit() + +ans = abs(b-a) / (v-w) + +if ans <= t: + print('YES') +else: + print('NO')" +p02646,s073345996,Accepted,"A, V = (int(i) for i in input().split()) +B, W = (int(i) for i in input().split()) +T = int(input()) + +if V <= W: + print(""NO"") +else: + if abs(A - B) / (V - W) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s153776498,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +if(V <= W): + print(""NO"") +else: + if(abs(B-A) <= T*(V-W)): + print(""YES"") + else: + print(""NO"") + +" +p02646,s097017865,Accepted,"A,V= map(int , input().split()) +B,W= map(int , input().split()) +T = int(input()) +if V>W: + S = (abs(B-A)) /(V-W) + if S<=T: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s697439125,Accepted,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +D = abs(A - B) + +if (V - W) * T >= D: + print('YES') +else: + print('NO')" +p02646,s860234080,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if a > b: + a,b = b,a +x = a+v*t +y = b+w*t +if x= abs(b-a): + print('YES') +else: + print('NO') +" +p02646,s772503872,Accepted,"A,V=(int(x) for x in input().split()) +B,W=(int(x) for x in input().split()) +T=int(input()) + +kyori=abs(A-B) +sokudo=V-W +if kyori<=sokudo*T: + print('YES') +else: + print('NO') +" +p02646,s284032267,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if abs(a-b) <= t * (v-w): + print('YES') +else: + print('NO')" +p02646,s271635706,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if (v-w)*t>=abs(a-b): + print(""YES"") +else: + print(""NO"") " +p02646,s964354245,Accepted,"a, v = list(map(int, input().split())) +b, w = list(map(int, input().split())) +t = int(input()) + +if abs(a - b) <= (v - w) * t: + print('YES') +else: + print('NO') +" +p02646,s554082070,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +s=int(input()) +if(abs(a-b)>(v-w)*s): + print(""NO"") +else: + print(""YES"")" +p02646,s254925693,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +C = abs(A - B) +if C + W * T <= V * T: + print(""YES"") +else: + print(""NO"")" +p02646,s062373967,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if vw: + t0 = abs((a-b)/(v-w)) + if t0<=t: + print(""YES"") + else: + print(""NO"")" +p02646,s860649964,Accepted,"A, V = tuple(int(c) for c in input().split(' ')) +B, W = tuple(int(c) for c in input().split(' ')) +T = int(input()) + +delta = V - W + +if A == B: + print('YES') + exit() +elif delta <= 0: + print('NO') + exit() +else: + d = abs(A-B) + time = d / delta + if time <= T: + print('YES') + else: + print('NO') + " +p02646,s562521494,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +Kyori = abs(A-B) + +if Kyori == 0: + print('YES') + exit() + +if Kyori <= (V-W)*T: + print('YES') +else: + print('NO')" +p02646,s900334360,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T=int(input()) +if V<=W: + print(""NO"") +elif abs(A-B)/abs(V-W)<=T: + print(""YES"") +else: + print(""NO"")" +p02646,s061072440,Accepted,"import sys +import copy +from collections import deque +stdin = sys.stdin + +mod = 10**9+7 + +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) +ns = lambda: stdin.readline().rstrip() # ignore trailing spaces + +a, v = na() +b, w = na() +t = ni() + +if w-v>=0: + print(""NO"") +else: + diff = v-w + if abs(a-b) <= diff*t: + print(""YES"") + else: + print(""NO"")" +p02646,s202673265,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +dis=abs(b-a) +speed=v-w +if t*speed >= dis: + print(""YES"") +else: + print(""NO"")" +p02646,s177675444,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w >= v or abs(a - b) > t * abs(v - w): + print(""NO"") +else: + print(""YES"") +" +p02646,s431064455,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +la, ra = a - t * v, a + t * v + 1 +lb, rb = b - t * w, b + t * w + 1 + + +l, r = min(la, lb), max(ra, rb) +if l == la and r == ra: + print(""YES"") +else: + print(""NO"")" +p02646,s569445939,Accepted,"A, V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if(A=b_ans): + print(""YES"") + else: + print(""NO"") +else: + a_ans = A - V*T + b_ans = B - W*T + if(a_ans<=b_ans): + print(""YES"") + else: + print(""NO"") + + + +#print(a_ans,b_ans)" +p02646,s801865255,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V == W: + sec = T + 1 +else: + sec = abs(A - B) / (V - W) + +if W >= V: + print(""NO"") +else: + if sec <= T: + print(""YES"") + else: + print(""NO"") +" +p02646,s269654648,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a > b: + a, b = b, a + +oni = a + v * t +nige = b + w * t + +if oni >= nige: + print('YES') +else: + print('NO') +" +p02646,s022258863,Accepted,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +ans = ""NO"" +if a > b: a,b = a*(-1), b*(-1) +if a == b: ans = ""YES"" +elif a < b: + if v > w and (b-a) <= (v-w)*t: ans = ""YES"" +print(ans)" +p02646,s276512713,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +G = abs(a-b) +H = (v-w)*t +print(""YES"" if G<=H else ""NO"")" +p02646,s906982222,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if (v-w)*t >= abs(b-a): + print(""YES"") +else: + print(""NO"") + " +p02646,s551031386,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if( t*v >= t*w + abs(a-b)): + print(""YES"") +else: + print(""NO"")" +p02646,s060196897,Accepted,"A, V = [int(i) for i in input().split()] +B, W = [int(i) for i in input().split()] +T = int(input()) + +if W >= V: + print('NO') + exit() + +if abs(A-B)/(V-W) <= T: + print('YES') +else: + print('NO')" +p02646,s056056552,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +length = abs(A - B) +speed = V - W +if (speed * T) >= length: + ans = 'YES' +else: + ans = 'NO' + +print(ans) +" +p02646,s885557559,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +dist = abs(b - a) +r_vel = v - w + +if r_vel * t >= dist: + print(""YES"") +else: + print(""NO"")" +p02646,s163424504,Accepted,"import sys +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + print('NO') + sys.exit() + +kyori = abs(A-B) +speed = abs(W-V) +ans = kyori / speed +if ans <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s521440469,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if V <= W: + print(""NO"") +elif (V - W) * T < abs(B - A): + print(""NO"") +else: + print(""YES"")" +p02646,s818465049,Accepted," +a = list(map(int,input().split())) +b = list(map(int,input().split())) +c = list(map(int,input().split())) +dist = abs(b[0] - a[0]) +speed = a[1] - b[1] +if speed * c[0] >= dist: + print(""YES"") +else: + print(""NO"") + +" +p02646,s581340454,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dis = abs(max(A,B) - min(A,B)) +velo = V - W +if velo <= 0: + print('NO') + exit() + +if (dis/velo) <= T: + print('YES') +else: + print('NO') +" +p02646,s816515096,Accepted,"A,V = map(int,input().split()) +B,W = map(int, input().split()) +T = int(input()) +if A=W*T+B: + print('YES') +elif A>B and A-T*V<=B-T*W: + print('YES') +else: + print('NO')" +p02646,s272848720,Accepted,"A,V=list(map(int,input().split())) +B,W=list(map(int,input().split())) +T=int(input()) +if A==B: + print(""YES"") + exit() +if A>B: + h0 = -1*V * T + A + h1 = -1*W * T + B + if h0 <= h1: + print(""YES"") + else: + print(""NO"") +else: + h0 = V * T + A + h1 = W * T + B + if h0 >= h1: + print(""YES"") + else: + print(""NO"") +" +p02646,s976710234,Accepted,"a,v = map(float,input().split()) +b,w = map(float,input().split()) +t = float(input()) + +if a= V: + print('NO') +else: + if abs(B-A) > (V-W)*T: + print('NO') + else: + print('YES')" +p02646,s442985039,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if a==b: + print(""YES"") +else: + if v>w: + if abs(a-b)<=t*(v-w): + print(""YES"") + else: + print(""NO"") + else: + print(""NO"") + " +p02646,s530678061,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print(""NO"") +else: + if a < b: + time = (b-a)/(v-w) + if time <= t: + print(""YES"") + else: + print(""NO"") + if b < a: + time = (a-b)/(v-w) + if time <= t: + print(""YES"") + else: + print(""NO"") +" +p02646,s637811266,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if (V-W)<=0: + print (""NO"") + exit(0) +if A > B: + if (A-B) / (V-W) <= T: + print(""YES"") + else: + print(""NO"") +else: + if (B-A) / (V-W) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s970637478,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() +else: + that = abs(b-a)/(v-w) + if 0 <= that <= t: + print('YES') + else: + print('NO')" +p02646,s022477574,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a == b: + print(""NO"") + +As = v * t + a +Bs = w * t + b + +if v > w: + if abs(a - b)/abs(v - w) <= t: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s821480598,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if a=(b-a): + print(""YES"") + else: + print(""NO"") + else: + print(""NO"") +else: + if w=(a-b): + print(""YES"") + else: + print(""NO"") + else: + print(""NO"")" +p02646,s560509580,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if w>=v: + print(""NO"") +elif abs(a-b) <= t*(v-w): + print(""YES"") +else: + print(""NO"")" +p02646,s386746393,Accepted,"a, v = map (int, input().split()) +b, w = map (int, input().split()) +t = int(input()) +if b > a: + if v <= w: + print(""NO"") + elif v > w: + if a+v*t >= b + w*t: + print(""YES"") + else: + print(""NO"") +else: + if v <= w: + print(""NO"") + elif v > w: + if a+(-v)*t <= b + (-w)*t: + print(""YES"") + else: + print(""NO"")" +p02646,s351606211,Accepted,"from math import * + +a,v=[int(x) for x in input().split()] +b,w=[int(x) for x in input().split()] +t=int(input()) + +if (v-w)>0: + tm=(abs(b-a))/(v-w) + if tm<=t: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s346891530,Accepted,"a,v=list(map(int,input().split())) +b,w=list(map(int,input().split())) +t=int(input()) + +if abs(a-b)<=t*(v-w): + print(""YES"") +else: + print(""NO"")" +p02646,s842180069,Accepted,"a,v=map(int, input().split()) +b,w=map(int, input().split()) +t=int(input()) + +dis=abs(a-b) +vel=v-w + +if vel>0 and vel*t>=dis: + print('YES') +else: + print('NO')" +p02646,s853407405,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w >= v: + print(""NO"") +elif (v-w)*t>=abs(b-a): + print(""YES"") +else: + print(""NO"")" +p02646,s067426648,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +# if (b - a) <= (v-w)*t: +# print(""YES"") +# else: +# print(""NO"") + +# if b+1000000000+w*t > a+1000000000+v*t: +# print(""NO"") +# else: +# print(""YES"") + + +if a v: + print(""NO"") +elif dis <= dif*t: + print(""YES"") +else: + print(""NO"") +" +p02646,s388135639,Accepted,"import sys + +sys.setrecursionlimit(10 ** 7) +input = sys.stdin.readline +f_inf = float('inf') +mod = 10 ** 9 + 7 + + +def resolve(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + dist = abs(a - b) + sokudo = v - w + if sokudo <= 0: + print(""NO"") + else: + T = dist / sokudo + print(""YES"" if T <= t else ""NO"") + + +if __name__ == '__main__': + resolve() +" +p02646,s585107172,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +dis = abs(a - b) +sb = v - w +if sb <= 0: + print(""NO"") + exit() +time = dis / sb +if time > t: + print(""NO"") +else: + print(""YES"")" +p02646,s210654050,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if abs(a-b)<= (v-w)*t: + print(""YES"") +else: + print(""NO"")" +p02646,s858925228,Accepted,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if W >= V: + print(""NO"") + exit() + +dis = abs(A-B) +vel = abs(V-W) + +c = vel*T + +if dis <= c: + print(""YES"") +else: + print(""NO"")" +p02646,s529193560,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +d = V-W +if d <= 0: + print(""NO"") +else: + if abs(A-B) <= (d*T): + print(""YES"") + else: + print(""NO"") +" +p02646,s439796812,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A < B: + a = A + T * V + b = B + T * W + +else: + b = A - T * V + a = B - T * W + +if b <= a: + ans = 'YES' +else: + ans = 'NO' + +print(ans)" +p02646,s712702356,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +dist = abs(a-b) + +if a == b: + print(""YES"") + exit() + +if v <= w: + print(""NO"") + exit() + +speed = v-w + +if dist <= speed*t: + print(""YES"") +else: + print(""NO"")" +p02646,s209129755,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A == B: + print(""YES"") +elif A < B: + if A + V * T >= B + W * T: + print(""YES"") + else: + print(""NO"") +else: + if A - V * T <= B - W * T: + print(""YES"") + else: + print(""NO"")" +p02646,s170592703,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if a < 0: + b += abs(a) + a = 0 +if b < 0: + a += abs(b) + b = 0 + +if abs(a-b) <= (v-w)*t: + print('YES') +else: + print('NO')" +p02646,s827669104,Accepted,"import math +A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if V!=W: + if V>W and math.ceil(abs(B-A)/(V-W))<=T: + print(""YES"") + exit() +print(""NO"")" +p02646,s456796919,Accepted,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +flag = """" +dist = abs(A-B) +speed = V-W +if(dist <= (V-W) * T): + flag = ""YES"" +else: + flag = ""NO"" + +if dist == 0: flag = ""YES"" +print(flag) +" +p02646,s979260428,Accepted,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +D=abs(A-B) +S=V-W +if (S<=0): + print(""NO"") +elif (D / S <= T): + print(""YES"") +else: + print(""NO"")" +p02646,s599530344,Accepted,"# N = int(input()) +A, V = [int(i) for i in input().split()] +B, W = [int(i) for i in input().split()] +T = int(input()) +if A < B: + if A + V * T >= B + W * T: + print(""YES"") + else: + print(""NO"") +elif A > B: + if A - V * T <= B - W * T: + print(""YES"") + else: + print(""NO"") + +" +p02646,s455308737,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +ans = ""NO"" +if A < B: + x = A + V * T + y = B + W * T + if x >= y: + ans = ""YES"" +else: + x = A - V * T + y = B - W * T + if x <= y: + ans = ""YES"" +print(ans)" +p02646,s935667229,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if abs(a-b)>t*(v-w): + print(""NO"") +else: + print(""YES"")" +p02646,s189900644,Accepted,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +d=abs(b-a) +s=v-w +if d<=s*t: + print('YES') +else: + print('NO')" +p02646,s956560711,Accepted,"import math +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v>w and abs(a-b)/(v-w)<=t: + print(""YES"") +else: + print(""NO"")" +p02646,s487797560,Accepted,"a,v=map(int,input().split()) +b,w = map(int,input().split()) +t=int(input()) + + +if a<=b: + + dist_a = a + t*v + + dist_b = b + t*w + + if dist_a>=dist_b: + print('YES') + else: + print('NO') +else: + + dist_a = a - t*v + + dist_b = b - t*w + + if dist_a<=dist_b: + print('YES') + else: + print('NO')" +p02646,s294427846,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +l = abs(a - b) +u = v-w +# print(l) +# print(u*t) +if l > u * t: + print('NO') +else: + print('YES') +" +p02646,s938400898,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +dist = abs(a-b) +speed = v-w +if speed<=0: + print('NO') + exit() +if dist<=speed*t: + print('YES') +else: + print('NO') + + +" +p02646,s116660579,Accepted,"import sys + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if (a == b): + print('YES') + sys.exit(0) +if (v <= w): + print('NO') + sys.exit(0) +res = abs(a - b) / (v - w) +if (res > t): + print('NO') +else: + print('YES') +sys.exit(0) + +" +p02646,s219840865,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +dif = abs(a-b) +if (v-w)*t >= dif: + print(""YES"") +else: + print(""NO"")" +p02646,s414411267,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +ds = v - w + +if ds <= 0: # 逃げている方が早い + print(""NO"") +else: + dd = abs(a-b) + + dt = float(dd)/float(ds) + + if dt <= t: + print(""YES"") + else: + print(""NO"")" +p02646,s590311668,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +kyori = abs(a-b) +sokudo = (v-w) + +if sokudo > 0: + if (kyori/sokudo)<=t: + print(""YES"") + exit() +elif sokudo == 0: + if kyori == 0: + print(""YES"") + exit() + +print(""NO"")" +p02646,s617564510,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v <= w: + print('NO') + exit(0) +if abs(a-b)%(v-w) == 0: + f = abs(a-b)//(v-w) +else: + f = abs(a-b)//(v-w)+1 +if f <= t: + print('YES') +else: + print('NO')" +p02646,s325997857,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v-w>0 and abs(a-b)/(v-w)<=t: + print(""YES"") +else: + print(""NO"") +" +p02646,s652233038,Accepted,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +d = abs(a-b) +if w-v >= 0: + print(""NO"") +else: + if t*(v-w) >= d: + print(""YES"") + else: + print(""NO"")" +p02646,s028369773,Accepted,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +d = abs(A - B) +if d <= (V - W) * T: + print(""YES"") +else: + print(""NO"")" +p02646,s305277013,Accepted,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a < b: + if a + v * t >= b + w * t: + print(""YES"") + else: + print(""NO"") +else: + if a - v * t <= b - w * t: + print(""YES"") + else: + print(""NO"") +" +p02646,s729899031,Accepted,"A, V = map(int, input().split(' ')) +B, W = map(int, input().split(' ')) +T = int(input()) + +distance = abs(A - B) +speed = V - W + +if V - W <= 0: + print('NO') + exit(0) + +t = distance // speed +if distance % speed == 0: + if t <= T: + print('YES') + else: + print('NO') +else: + if t + 1 <= T: + print('YES') + else: + print('NO')" +p02646,s471885187,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +ans=""No"" +if v<=w: + ans=""No"" +else: + if a>b: + (a-b)//(v-w)+1<=t + ans=""Yes"" + else: + (b-a)//(v-w)+1<=t + ans=""Yes""" +p02646,s350539418,Wrong Answer,"a,v = input().split() +b,w = input().split() +t = input() + +a_kyori = int(t) * int(v) + int(a) +b_kyori = int(t) * int(w) + int(b) + +if a_kyori >= b_kyori: + print(""Yes"") +else: + print(""No"")" +p02646,s560596579,Wrong Answer,"import sys +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a>b or w>v: + print('NO') + sys.exit() +for tt in range(1,t): + res = (w - v) * tt + (b - a) + if res == 0: + print('YES') + sys.exit() + +print('NO')" +p02646,s337065146,Wrong Answer,"# -*- coding: utf-8 -*- + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +T = int(input()) + +k = b - a +flag = False + +if k >= 0: + l = T*v - T*w + if (k <= l): + flag = True + +if k < 0: + k = a - b + l = T*w - T*v + if (k <= l): + flag = True + + +if (flag == True): + print('YES') +else: + print('NO') + + " +p02646,s002836332,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if a == b: + print(""YES"") +elif v<=w: + print(""NO"") +else: + if -(-(b-a)//(v-w)) <= t: + print(""YES"") + else: print(""NO"")" +p02646,s113546198,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if(A+V*T==B+W*T): + print(""YES"") +else: + print(""NO"")" +p02646,s327823309,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +a = abs(B-A) +v = V-W +v2 = v*T + +if(a<=v2): + print(""Yes"") +else: + print(""No"") +" +p02646,s922090384,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +for i in range(1,T): + if A + V * i == B + W * i: + print(""YES"") + exit() +print(""NO"")" +p02646,s389479491,Wrong Answer,"a,b=map(int,input().split()) +c,d=map(int,input().split()) +e=int(input()) +if a<0 and c<0: + if a>c: + print('NO') + else: + if a+b*e>=c+d*e: + print('YES') + + else: + print('NO') + +else: + if a+b*e>=c+d*e: + print('YES') + + else: + print('NO')" +p02646,s273054536,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a < b: + if w < v and (b-a)%(v-w)==0 and int((b-a)/(v-w)) <= t: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"") + +" +p02646,s282942007,Wrong Answer,"from sys import stdin +input = stdin.readline + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if B > A: + if (V - W) * T + A >= B: + print(""YES"") + else: + print(""NO"") +else: + if (V - W) * T + A <= B: + print(""YES"") + else: + print(""NO"") +" +p02646,s962982455,Wrong Answer,"A,V = [int(v) for v in input().split()] +B,W = [int(v) for v in input().split()] +T = int(input()) + +A += int(1e9) +B += int(1e9) + +if V * T + A >= W * T + B: + print(""YES"") +else: + print(""NO"") +" +p02646,s516992620,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v>w: + if b-a<=(v-w)*t: + print('YES') + exit() +print('NO')" +p02646,s794765007,Wrong Answer,"AV = list(map(int,input().split())) +BW = list(map(int,input().split())) +T = int(input()) + +A = AV[0] +V = AV[1] +B = BW[0] +W = BW[1] + +for i in range(T): + if A <= B: + B += W + A += V + else: + B -= W + A -= V + +if abs(A) >= abs(B): + print('Yes') +else: + print('No')" +p02646,s760812980,Wrong Answer,"a,v = list(map(int,input().split())) +b,w = list(map(int,input().split())) +t = int(input()) + +if (v - w > 0) and (a != b): + if abs(a-b) <= (v - w) * t: + print(""Yes"") + else: + print(""No"") + +elif a == b: + print(""Yes"") + +else: + print(""No"")" +p02646,s034865191,Wrong Answer,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +distance = b - a +speed_remainder = v - w + +if distance <= 0: + print(""NO"") +elif distance <= t * speed_remainder: + print(""YES"") +else: + print(""NO"")" +p02646,s862249249,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if A == B: + print(""YES"") + exit() + +if W > V: + print(""NO"") + exit() + +if A > B: + V *= -1 + W *= -1 + + for t in range(T): + A += V + B += W + print(t,A,B) + if A <= B: + print(""YES"") + exit() + +else: + for t in range(T): + A += V + B += W + if A >= B: + print(""YES"") + exit() + +print(""NO"")" +p02646,s625781689,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +A_res = A + V * T +B_res = B + W * T +if A > B: + print(""NO"") +elif A_res >= B_res: + print(""YES"") +else: + print(""NO"")" +p02646,s676612522,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +if A >= B: + if A + V * T >= B + W * T: + print('YES') + else: + print('NO') +else: + if V >= W: + print('NO') + elif A + V * T >= B + W * T: + print('YES') + else: + print('NO')" +p02646,s812711770,Wrong Answer,"stdin = [input() for i in range(3)] +line = stdin[0].split(' ') +A = int(line[0]) +V = int(line[1]) +line = stdin[1].split(' ') +B = int(line[0]) +W = int(line[1]) +T = int(stdin[2]) +length = 0 +if B < A: + length = B-A +else: + length = A-B +if (V-W)*T < length: + print('NO') +else: + print('YES')" +p02646,s211759533,Wrong Answer,"import math +import sys +a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +e1=pow(10, -9) +e2=pow(10, 9) + +if (a=bb): + print(""YES"") +else : + print(""NO"") +" +p02646,s322747549,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if A < B: + if (V*T + W*T) >= abs(B - A): + print(""YES"") + else: + print(""NO"") +elif A > B: + if (V*T + W*T) >= abs(A - B): + print(""YES"") + else: + print(""NO"")" +p02646,s441124642,Wrong Answer,"#デフォルト +import itertools +from collections import defaultdict +import collections +import math +import sys +sys.setrecursionlimit(200000) +mod = 1000000007 + +a, v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if a == b: + print(""YES"") +elif v > w: + print(""YES"") +else: + print(""NO"")" +p02646,s039310993,Wrong Answer,"a,v=map(float,input().split()) +b,w=map(float,input().split()) +t=float(input()) +b = max(a,b) +a = min(a,b) +gap = abs(b-a) +v_gap = abs(v-w) +if v>w: + if v_gap*t>=gap: + print('YES') + else: + print('NO') +else: + print('NO') +" +p02646,s046816296,Wrong Answer,"arr1 = list(map(int,input().strip().split())) +arr2 = list(map(int,input().strip().split())) +time = int(input()) + +oni = arr1[0]+arr1[1]*time +nige = arr2[0]+arr2[1]*time +print(oni) +print(nige) +if oni >= nige: + print('Yes') +else: + print('No')" +p02646,s736129569,Wrong Answer,"A ,V = map(int, input().split()) +B ,W = map(int, input().split()) +T = int(input()) + +if V <= W: + print(""No"") +else: + if (max(A, B) - min(A, B)) / (V - W) <= T: + print(""Yes"") + else: + print(""No"")" +p02646,s126973640,Wrong Answer,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +oni = v*t + a +nige = w*t +b + +if v and w >0: + if oni > nige: + print(""YES"") + else: + print(""NO"") +elif v and w <0: + if oni < nige: + print(""YES"") + else: + print(""NO"")" +p02646,s138115840,Wrong Answer,"a, v = [int(a) for a in input().split()] +b, w = [int(a) for a in input().split()] +t = int(input()) +ret = w-v +ans = """" +if (ret*t) <= (b-a): + ans = ""NO"" +else: + ans = ""YES"" +print(ans)" +p02646,s359168999,Wrong Answer,"import sys + +if __name__ == '__main__': + A, V = list(map(lambda x:int(x), sys.stdin.readline().rstrip().split(' '))) + B, W = list(map(lambda x:int(x), sys.stdin.readline().rstrip().split(' '))) + T = int(sys.stdin.readline()) + + dist = B - A + d_dist = V - W + + if d_dist * T >= dist: + print('YES') + else: + print('NO')" +p02646,s446563315,Wrong Answer,"N,S = map(int,input().split()) +n,s = map(int,input().split()) +T = int(input()) + +dis = n - N +speed = S - s + +if n < N: + print(""NO"") +elif dis <= speed*T: + print(""YES"") +else: + print(""NO"")" +p02646,s255442456,Wrong Answer,"a, v = list(map(int, input().split())) +b, w = list(map(int, input().split())) +t = int(input()) + +if v <= w: + print('NO') + exit() + +if abs(a - b) / (w - v) <= t: + print('YES') +else: + print('NO') +" +p02646,s971239415,Wrong Answer,"A,V = [int(i) for i in input().split() ] +B,W = [int(i) for i in input().split() ] +T = int(input()) + +print ( ""YES"" if A+(V*T) >= B+(W*T) else ""NO"" ) +" +p02646,s630364642,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +T = int(input()) +loc = abs(a - b) +if v <= w: + print('No') + exit() +if loc % v == 0: + print('Yes') + exit() +for i in range(T): + loc += w + if loc % v == 0: + print('Yes') + exit() +print('No') +" +p02646,s331174904,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +oni = a + (v * t) +ko = b + (w * t) + +if oni <= ko: + print(""NO"") + exit() + +for i in range(1, t): + a = a + v + b = b + w + if a >= b: + print(""YES"") + exit() + +print(""NO"")" +p02646,s197910778,Wrong Answer,"a = list(map(int, input().split())) +b = list(map(int, input().split())) +t = int(input()) + +d = abs(b[0] - a[0]) +suma = a[0] +sumb = b[0] + +for i in range(t): + suma = suma + a[1] + sumb = sumb + b[1] + + if suma == sumb: + print('YES') + exit() + +print('NO')" +p02646,s469148188,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if V!=W: + if abs(A-B)/abs(V-W)<=T: + print('YES') +else: + print('No')" +p02646,s664753581,Wrong Answer,"a,v = map(int,input().split()) +b, w= map(int,input().split()) +t = int(input()) +A = a+(t*v) +B = b+(t*w) +if a == b: + print('YES') +elif a < b: + if B < A: + print('YES') + else: + print('NO') +else: + A = a-(t*v) + B = b-(t*w) + if A <= B: + print('YES') + else: + print('NO')" +p02646,s787381274,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +A *= 10**9 +B *= 10**9 +if B - A <= 0: + print(""YES"") +else: + if (V-W) * T >= B - A: + print(""YES"") + else: + print(""NO"") +" +p02646,s997683336,Wrong Answer,"[a,v] = list(map(int, input().split())) +[b,w] = list(map(int, input().split())) +t = int(input()) +nomi = a-b +denomi = w-v +if denomi != 0: + rem = nomi % denomi + if rem == 0: + tRe = nomi//denomi + if 0<=tRe<=t: + print('YES') + else: + print('NO') + else: + tRe = nomi / denomi + if 0 < tRe < t: + print('YES') + else: + print('NO') +else: + print('NO')" +p02646,s890450625,Wrong Answer,"a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +flag = 0 +if v > w and a<=b: + for i in range(t): + if a+v*i >= b+w*i: + flag = 1 + break + +if flag ==1: + print(""YES"") +else: + print(""NO"")" +p02646,s281677294,Wrong Answer,"inputA = input() +inputB = input() +secIn = input() +sec = int(secIn) +splitA = inputA.split() +splitB = inputB.split() +curA = int(splitA[0]) +a = int(splitA[1]) +curB = int(splitB[0]) +b = int(splitB[1]) + +d = curA - curB +dis = d if d > 0 else -d + +result = ""NO"" +v = a - b +if v <= 0: + result = ""NO"" +elif dis % v != 0: + result = ""NO"" +elif dis / v < sec: + result = ""YES"" +else: + result = ""NO"" + +print(result) +" +p02646,s092736096,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) + +t = int(input()) + +if v == w: + print(""NO"") + +elif (v < w): + ans = (a - b) / (v - w) + if t <= abs(ans): + print(""YES"") + else: + print(""NO"") +else: + ans = (b - a) / (v - w) + if t > ans: + print(""YES"") + else: + print(""NO"") + +" +p02646,s685181760,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if B > A: + AtoB = B - A + VtoW = V - W +else: + AtoB = A - B + VtoW = W - V + +if AtoB <= VtoW * T: + print('YES') +else: + print('NO') + +" +p02646,s745555212,Wrong Answer,"A_V = input().split() +A = int(A_V[0]) +V = int(A_V[1]) +B_W = input().split() +B = int(B_W[0]) +W = int(B_W[1]) +T = int(input()) + +if W - V <= 0: + print('NO') +elif T < abs(B-A)/(W-V): + print('NO') +else: + print('YES')" +p02646,s401692955,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +set_position = abs(B-A) +move = V-W +for i in range(T): + set_position -= move + + if set_position==0: + print(""YES"") + break + elif set_position < 0: + print(""NO"") + break +else: + print(""NO"")" +p02646,s992719198,Wrong Answer,"import sys +import math +import itertools +import collections +import heapq +import re +import numpy as np + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: sys.stdin.buffer.readline().split() +ri = lambda: int(sys.stdin.readline()) +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +rl = lambda: list(map(int, sys.stdin.readline().split())) +inf = float('inf') +mod = 10**9 + 7 + +a, v = rm() +b, w = rm() +t = ri() +if a + v*t >= b + w*t: + print('YES') +else: + print('NO') +" +p02646,s190983489,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) +if a + v*t >= b + w*t : + print(""YES"") +else: + print(""NO"")" +p02646,s289210257,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A <= B: + print(""YES"" if A + V * T >= B + W * T else ""NO"") +else: + print(""YES"" if A - V * T >= B - W * T else ""NO"")" +p02646,s314901874,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v*t + a >= w*t + b and a < b: + print(""YES"") +elif v*t + a <= w*t + b and a > b: + print(""YES"") +else: + print(""NO"")" +p02646,s354058025,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +d = v*2 - w*2 +if d > 0: + s = abs(b-a) + f = abs(v-w) + if f*(t-1)-s <= d: + print('YES') + else: + print('NO') +else: + print('NO')" +p02646,s471543067,Wrong Answer,"info_A = input().split() +info_B = input().split() +T = int(input()) + +A = int(info_A[0]) #A(鬼)の開始位置 +V = int(info_A[1]) #A(鬼)の速度 +B = int(info_B[0]) #B(逃げる側)の開始位置 +W = int(info_B[1]) #B(逃げる側)の速度 + +if B + W * T < A + V * T: #T秒後に鬼が追いついているまたは追い越すなら捕まえられる + print('YES') +else: + print('NO') +" +p02646,s725044976,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +#print((v-w) // (b-a), v-w, b-a) +if (b-a) <= t*(v-w): + print(""YES"") +else: + print(""NO"")" +p02646,s175333229,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if B-A > (V-W)*T: + print(""No"") +else: + print(""Yes"") " +p02646,s596082322,Wrong Answer,"import math +from sys import stdin,stdout +#% 998244353 +from heapq import heapify,heappop,heappush +import collections + + +a,s1=list(map(int,stdin.readline().split())) +b,s2=list(map(int,stdin.readline().split())) +T = int(stdin.readline()) + +if a+s1*T>=b+s2*T: + print(""YES"") +else: + print(""NO"") +" +p02646,s312403433,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +d = abs(A - B) +v = V - W +ans = 'YES' + +if v <= 0: + ans = 'NO' +else: + if d / v > T: + ans = 'NO' + +if (A % 2 != B % 2 and V % 2 == W % 2) or (A % 2 == B % 2 and V % 2 != W % 2): + ans = 'NO' + + +print(ans)" +p02646,s116762545,Wrong Answer,"N,S = map(int,input().split()) +n,s = map(int,input().split()) +T = int(input()) + +ans1 = N + S*T +ans2 = n + s*T + +if S - s <= 0 or n < N: + print(""NO"") +elif ans1 >= ans2 and (n-N) % (S-s) == 0: + print(""YES"") +else: + print(""NO"")" +p02646,s754255905,Wrong Answer,"A, V =map(int, input().split()) +B, W =map(int, input().split()) +T=int(input()) + +d=abs(B-A) +dv=V-W + +if dv<=0: + print(""NO"") +elif d%dv !=0 : + print(""NO"") +elif d/dv > T-1: + print(""NO"") +else: + print(""YES"")" +p02646,s354871420,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +for i in range(T): + A = A + V + B = B + W + if(A>=B): + print(""YES"") + break + if(i==T-1): + if(A= 0: + print('YES') +elif B < A and res <= 0: + print('YES') +else: + print('NO') +" +p02646,s070872392,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +N = int(input()) +if W > V: + print('No') +else: + if abs(A-B) <= N*(V-W): + print('Yes') + else: + print('No')" +p02646,s210712992,Wrong Answer,"from decimal import Decimal +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if a==b: + print(""YES"") + exit() +elif v==w: + print(""NO"") + exit() +a=abs(b-a)%abs(v-w) +atai = Decimal(str(a)) +if atai==0: + for i in range(1,t+1): + if i == Decimal(abs(b-a))/Decimal(abs(v-w)): + print(""YES"") + exit() + print(""NO"")" +p02646,s388181554,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if (v-w)*t >= b-a: + print(""YES"") +else: + print(""NO"") + +" +p02646,s200067635,Wrong Answer,"A,V = list(map(int,input().split())) +B,W = list(map(int,input().split())) +T = int(input()) + +sub = B - A +speed = V - W +if sub > T*speed: + print(""No"") +else: + print(""YES"")" +p02646,s796317121,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) + +if b > a: + if b - a <= (v-w) * t: + print('YES') + else : + print('NO') + +if b < a: + if a - b <= (w-v)*t: + print('YES') + else: + print('NO')" +p02646,s092601536,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +a = A +b = B + +for i in range(1, T + 1, 1): + a += V + b += W + + if a == b: + print(""YES"") + break + +if (a != b): + print(""NO"")" +p02646,s582646519,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a > b: + a = a - v * t + b = b - w * t + print('YES' if a < b else 'NO') +elif a < b: + a = a + v * t + b = b + w * t + print('YES' if a > b else 'NO') + +" +p02646,s206995478,Wrong Answer,"a, v = input().split(' ') +a = int(a) +v = int(v) +b, u = input().split(' ') +b = int(b) +u = int(u) +t = int(input()) + + +if a + v * t >= b + u * t : + print('YES') +else: + print('NO')" +p02646,s543245530,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) + +t = int(input()) + +if v == w: + print(""NO"") + +elif (v < w): + ans = (a - b) / (v - w) + if t <= abs(ans): + print(""YES"") + else: + print(""NO"") +else: + ans = (b - a) / (v - w) + if t >= ans: + print(""YES"") + else: + print(""test"") + print(""NO"") + + + +" +p02646,s653998619,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +dx = b - a +dv = v - w + +if dv <= 0: + print('NO') + +elif dx % dv == 0 and dx // dv <= t: + print('YES') + +else: + print('NO') + " +p02646,s507339540,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +cnt = 0 +for tt in range(1, t + 1): + res = (w - v) * tt + (b - a) + if res == 0: + cnt = 1 + +if a >= b and w >= v: + cnt = 0 +if cnt == 1: + print('YES') +else: + print('NO') +" +p02646,s631472630,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +# if (b - a) <= (v-w)*t: +# print(""YES"") +# else: +# print(""NO"") + +if b+w*t > a+v*t: + print(""NO"") +else: + print(""YES"") +" +p02646,s917266100,Wrong Answer,"import math +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w >= v: + print('No') +else: + for i in range(1,t+1): + if abs(a-b) <= (w-v)*i: + print('Yes') + break + print('No') + " +p02646,s675388505,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs((a-b)) + abs(v-w)*t >= 0: + print('Yes') +else: + print('No')" +p02646,s262735682,Wrong Answer,"def main(): + a,v = map(int,input().split()) + b,w = map(int,input().split()) + t = int(input()) + if v == w: + print('NO') + return 0 + elif abs((a-b)/(v-w)) <= t: + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main() +" +p02646,s610543479,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +ans = 0 +if a == b: + ans = 1 +if v == w: + ans = 1 +elif v>w and abs(a-b)/(v-w) <= t : + ans = 1 +if ans == 0: + print(""NO"") +else: + print(""YES"")" +p02646,s591755743,Wrong Answer,"a,b=map(int,input().split()) +c,d=map(int,input().split()) +e=int(input()) + +if c-a<=e*(b-d): + print('YES') +else: + print('NO')" +p02646,s319736056,Wrong Answer,"def main(): + a,v = map(int,input().split()) + b,w = map(int,input().split()) + t = int(input()) + if v == w: + print('NO') + return 0 + if a-b < 0 and v-w < 0: + print('NO') + return 0 + if a-b > 0 and v-w > 0: + print('NO') + return 0 + if abs((a-b)/(v-w)) <= t: + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main() +" +p02646,s382262231,Wrong Answer,"A,V = input().split() +B,W = input().split() + +A = int(A) +V = int(V) +B = int(B) +W = int(W) + +T = int(input()) + +distance = B-A +closer = W-V + +def solve(): + if closer >= 0: + print(""NO"") + return + time = distance/abs(closer) + if time <= T and B + W * time <= 10**9: + print(""YES"") + return + else: + print(""NO"") + return +solve() +" +p02646,s063017968,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +dist = abs(A-B) +v = abs(W-V) +if T * v >= dist: + print(""YES"") +else: + print(""NO"") +" +p02646,s692594980,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a > b: + a, b = b, a + v, w = w, v + +if a + (v * t) < b + (w * t): + print('NO') +else: + print('YES')" +p02646,s779356460,Wrong Answer,"[A,V]=[int(i) for i in input().split()] +[B,W]=[int(i) for i in input().split()] +T=int(input()) +if abs(A-B)>T*abs(V-W):print(""NO"") +else:print(""YES"") +" +p02646,s996399553,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A < B and A + T * V >= B + T * W: + print('YES') +else: + print('NO') +" +p02646,s602932091,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a+v*t >= b+w*t >= 0: + print('YES') +else: + print('NO') +" +p02646,s269425412,Wrong Answer,"a,v =map(int, input().split()) +b,w =map(int, input().split()) +t=int(input()) + + +if a < b : + if a+v*t >= b+w*t : + print('YES') + else : + print('NO') + +else : + if a+v*t <= b+w*t : + print('YES') + else : + print('NO')" +p02646,s116164719,Wrong Answer,"#import torch +#import torch.nn as nn +#import matplotlib.pyplot as plt +#from decimal import Decimal + +#N=int(input()) +A,V = map(float,input().split()) +B,W = map(float,input().split()) +T=int(input()) +#A = list(map(int,input().split())) +#S=str(input()) + +if V<=W: + print('NO') +else: + L=abs(A-B) + if L%(V-W)==0: + if L//(V-W)<=T: + print('YES') + else: + print('NO') + else: + print('NO') +" +p02646,s444747063,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if a=b+w*t: + print('YES') + else: + print('NO') +else: + if b+w*t>=a+v*t: + print('YES') + else: + print('NO') +" +p02646,s176021346,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t= int(input()) + +l = b-a +dv = v-w +if dv == 0: + if l == 0: + print(""YES"") + else: + print(""NO"") +elif l > 0: + if dv*t > l: + print(""YES"") + else: + print(""NO"") +else: + if dv*t < l: + print(""YES"") + else: + print(""NO"") +" +p02646,s045803928,Wrong Answer,"A, V =map(int, input().split()) +B, W =map(int, input().split()) +T=int(input()) + +d=abs(B-A) +dv=V-W + +if dv<=0: + print(""NO"") +elif d%dv !=0 : + print(""NO"") +elif d/dv > T: + print(""NO"") +else: + print(""YES"")" +p02646,s677129185,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if A - B == 0: + print('YES') +elif V <= W: + print('NO') +elif V == 0: + print('NO') +else: + print('YES' if abs(A-B)//abs(V-W) <= T else 'NO') +" +p02646,s710054201,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +dis = abs(A-B) +mob = W-V + +if B < A: + print(""No"") +elif A < B: + if mob >= 0: + print(""No"") + else: + if dis + mob*T <= 0: + print(""Yes"") + else: + print(""No"") +" +p02646,s618119905,Wrong Answer,"from sys import stdin + +def main(): + + input = stdin.readline + + A,V = map(int,input().split()) + B,W = map(int,input().split()) + T = int(input()) + + + if(V <= W): + print(""NO"") + else: + X = abs(V - W) + + if (abs(A - B) // X <= T) & (abs(A - B) % X == 0): + print(""YES"") + else: + print(""NO"") + +if __name__ == ""__main__"": + main()" +p02646,s167241547,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +a_place = a +b_place = b + +if w >= v: + print('No') +else: + for i in range(1,t): + a_place += v + b_place += w + if a_place == b_place: + print('Yes') + break" +p02646,s556994395,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +A_ = A + V * T +B_ = B + W * T + +if A == B: + print('YES') +elif A > B: + print('NO') +elif A < B and A_ >= B_: + print('YES') +else: + print('NO')" +p02646,s414559958,Wrong Answer,"in1 = input().split() +in2 = input().split() +in3 = input() +oni = int(in1[0]) +onispeed = int(in1[1]) +kid = int(in2[0]) +kidspeed = int(in2[1]) +time = int(in3) + +pase = onispeed - kidspeed +if pase <= 0: + print(""NO"") + +if (pase * time) + oni >= kid: + print(""YES"") + + " +p02646,s792511479,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +at = v*t + a +bt = w*t + b + +if a < b: + if at >= bt: + print('YES') + else: + print('NO') +elif a > b: + if bt >= at: + print('YES') + else: + print('NO')" +p02646,s908893234,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V-W <= 0: + print(""NO"") +elif B-A <= 0: + print(""NO"") +else: + if ((B-A)/(V-W)) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s337517029,Wrong Answer,"a,v = list(map(int, input().split())) +b,w = list(map(int, input().split())) +t = int(input()) + +diff = abs(a-b) +V = abs(v-w) +if V <= 0: + print('NO') +else: + if diff<=V*t: + print('YES') + else: + print('NO') + " +p02646,s547656015,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A+T*V < B+T*W: + print('NO') +else: + print('YES') + +" +p02646,s619918773,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +for i in range(1,T+1): + j = A + (i * V) + k = B + (i * W) + if j >= k: + print(""YES"") + break +else: + print(""NO"")" +p02646,s009197090,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +ans = ""Yes"" +if(V<=W): + ans = ""No"" +elif(abs(A-B)>T*abs(V-W)): + ans = ""No"" +print(ans)" +p02646,s391614048,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +for i in range(1,T+1): + if (A + V * i) == (B + W * i): + print(""YES"") + exit() + +print(""NO"")" +p02646,s164900120,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v <= w: + print(""NO"") +elif -(-(b-a))//(v-w) > t: + print(""NO"") +else: + print(""YES"")" +p02646,s246681247,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v <= w: + print('No') + exit(0) +if abs(a-b)%(v-w) == 0: + f = abs(a-b)//(v-w) +else: + f = abs(a-b)//(v-w)+1 +if f <= t: + print('Yes') +else: + print('No') + " +p02646,s976071765,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +# # 愚直に +diff_pos = A-B +diff_spd = V-W + +if (diff_spd <= 0) : + print(""NO"") +elif (diff_pos > diff_spd * (T)) : + print(""NO"") +else : + print(""YES"") + +# for i in range(1,T+1) : +# if (B < A) : +# A = A + V +# B = B + go_pos * W +# if (B_pos)" +p02646,s054494610,Wrong Answer," +A , V = map(int,input().split()) +B , W = map(int,input().split()) +T = int(input()) + +ans = 'NO' +for a in range(1,T+1): + A += V + B += W + if A == B: + ans = 'YES' + break + + + +print(ans) +" +p02646,s782166774,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w >= v: + print(""NO"") +elif (v - w)*t >= b - a and (b - a)%(v - w)==0: + print(""YES"") +else: + print(""NO"") + " +p02646,s612872254,Wrong Answer,"a, v = (int(i) for i in input().split(' ')) +b, w = (int(i) for i in input().split(' ')) +t = int(input()) + +l1 = a + v * t +l2 = b + w * t + +flag = False +if v >= 0: + if a > b and w <= 0: + pass + elif l1 >= l2: + flag = True +else: + if b > a and w >= 0: + pass + elif l1 <= l2: + flag = True +print(""YES"" if flag else ""NO"")" +p02646,s698939592,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v*t + a >= w*t + b: + print(""YES"") +else: + print(""NO"")" +p02646,s580421750,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +L = abs(B-A) +vd = V-W +if L <= vd*T: + print(""Yes"") +else: + print(""No"")" +p02646,s167277175,Wrong Answer,"import math + +def lcm(x, y): + return (x * y) // math.gcd(x, y) + +a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +c = abs(b-a) +x = v - w + + +if x <= 0: + print(""NO"") + exit() + +if v % w == 0 and v // w * t >= c and lcm(v, w) <= 2 * w: + print(""YES"") +else: + print(""NO"")" +p02646,s443363434,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a == b: + print(""NO"") + +As = v * t + a +Bs = w * t + b + +if As >= Bs: + print(""YES"") +elif As < Bs: + print(""NO"")" +p02646,s786831790,Wrong Answer,"#n, m, q = map(int, input().split()) +#List = list(map(int, input().split())) +#req = [list(map(int, input().split())) for _ in range(q)] +#t = t[:-1] +#print(ans[j], end = """") 改行無しで出力 +#[0]*n +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +c = b - a +d = v*t - w*t + +if d >= c: + print(""YES"") + +else : + print(""NO"") +" +p02646,s116783076,Wrong Answer,"a,v=map(int,input().split("" "")) +b,w=map(int,input().split("" "")) +t=int(input()) + +sa=b-a +st=v-w + +if sa>st*t: + print(""NO"") +else: + print(""YES"")" +p02646,s788352424,Wrong Answer,"a,v=map(int, input().split()) +b,w=map(int, input().split()) +t=int(input()) + +if a + v * t >= b + w * t: + print('YES') +else: + print('NO')" +p02646,s584173529,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +if W >= V: + print('NO') +elif (B-A)//(W-V) <= T: + print('YES') +else: + print('NO')" +p02646,s648006519,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int, input().split()) +t = int(input()) + + +if a > b and v >= w: + print(""NO"") + exit(0) +elif a < b and v <= w: + print(""NO"") + exit(0) + + +if v > w: + if (v-w) * t >= b-a: + print(""YES"") + else: + print(""NO"") + +else: + if (w-v) * t >= a-b: + print(""YES"") + else: + print(""NO"")" +p02646,s656213796,Wrong Answer,"a,v = map(int,input().split()) +b,v2 = map(int,input().split()) +t = int(input()) +a_distance = a+v*t +b_distance = b+v2*t +if a_distance >= b_distance: + print(""YES"") +else: + print(""NO"")" +p02646,s386024098,Wrong Answer,"def tag(a,b,v,w,t): + it = a+(v*t*2) + other = b+(w*t*2) + if it >= other: + return ""YES"" + return ""NO"" + +if __name__ == ""__main__"": + a,v = map(int,input().split()) + b,w = map(int,input().split()) + t = int(input()) + print(tag(a,b,v,w,t))" +p02646,s446411956,Wrong Answer,"import sys +import math +import itertools +import collections +import heapq +import re +import numpy as np + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: sys.stdin.buffer.readline().split() +ri = lambda: int(sys.stdin.readline()) +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +rl = lambda: list(map(int, sys.stdin.readline().split())) +inf = float('inf') +mod = 10**9 + 7 + +a, v = rm() +b, w = rm() +t = ri() +if a < b: + if a + (v-w)*t >= b + (v-w)*t: + print('YES') + else: + print('NO') +else: + print('NO') +" +p02646,s583354496,Wrong Answer,"a, v = list(map(int, input().split())) +b, w = list(map(int, input().split())) +t = int(input()) + +if w >= v: + print(""NO"") +elif abs(b-a) % abs(w-v) != 0: + print(""NO"") +elif abs(b-a) // abs(w-v) > t: + print(""NO"") +else: + print(""YES"")" +p02646,s113764349,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v == w: + print(""NO"") +else: + if b > a: + if abs(b-a) <= (v-w)*t: + print(""YES"") + else: + print(""NO"")" +p02646,s937770933,Wrong Answer,"_input = input +''' +allinputs = iter(input().splitlines()) +input = lambda : next(allinputs) +#''' + +#ここに書きたいコードを書く +#データ読み込み +a,v=map(int, input().split()) +b,w=map(int, input().split()) +t=int(input()) + +if v-w <= 0: + print(""NO"") +elif (b-a)//(v-w) <= t: + print(""YES"") +else: + print(""NO"") + +input = _input +" +p02646,s481797300,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a + v * t >= b + w * t: + print(""YES"") +else: + print(""NO"")" +p02646,s536017703,Wrong Answer,"s=input().split() +a=int(s[0]) +v=int(s[1]) +s=input().split() +b=int(s[0]) +w=int(s[1]) +t=int(input()) +a+=v*t +b+=w*t +if a>=b: + print('YES') +else: + print('NO')" +p02646,s732562422,Wrong Answer,"a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +distance = abs(a-b) +sa = v - w + +if sa == 0: + print('NO') +elif distance % sa != 0 and distance > t * sa: + print('NO') +else: + print('YES')" +p02646,s891644560,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() + +for i in range(t+1): + at = v*i + a + bt = w*i + b + if at == bt: + print('YES') + exit() + +print('NO')" +p02646,s388132865,Wrong Answer,"oni, oni_spd = list(map(int, input().split())) +child, child_spd = list(map(int, input().split())) +T = int(input()) + +dist = abs(child - oni) +ofs_spd = oni_spd - child_spd + +if ofs_spd * T >= dist and dist / ofs_spd % 2 == 0 and 0 <= dist / ofs_spd <= T: + print('YES') +else: + print('NO')" +p02646,s627042320,Wrong Answer,"a, v = map(int, input().split(' ')) +b, w = map(int, input().split(' ')) +t = int(input()) +r = 'NO' +if (w - v) * t + b + a >= 0: + r = 'YES' +print(r)" +p02646,s355681614,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if v-w<=0: + print('NO') +elif (a+v*t)>=(b+w*t) and abs(b-a)%abs(w-v)==0: + print('YES') +else: + print('NO') +" +p02646,s228594459,Wrong Answer,"a, v=map(int, input().split()) +b, w=map(int, input().split()) +t=int(input()) + +distance=abs(b-a) +speed=v-w + +if speed<=0: + print(""NO"") +else: + if speed*t<=distance: + print(""YES"") + else: + print(""NO"")" +p02646,s922998816,Wrong Answer,"boy, t1= map(int, input().split()) +girl, t2= map(int, input().split()) +time = int(input()) +s1 = boy + (t1*time) +s2 = girl + (t2*time) +if(s1>s2): + print(""YES"") +elif(s2>s1): + print(""NO"")" +p02646,s597464710,Wrong Answer,"import sys +import math +import fractions +from collections import defaultdict +stdin = sys.stdin + +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(stdin.readline().rstrip()) +nm = lambda: map(int, stdin.readline().split()) +nl = lambda: list(map(int, stdin.readline().split())) + + +A,V=nm() +B,W=nm() +T=int(input()) + +d=abs(A-B) +move_s=(V-W) +if(move_s<=0): + print(""NO"") + sys.exit(0) +if(T<=((d//move_s)+1)): + print(""NO"") + sys.exit(0) +print(""YES"") +" +p02646,s117634542,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a < 0 and b >= 0 : + if -a+v*t >= b + w*t: + print(""YES"") + else : + print(""NO"") + +else : + + if a + v * t >= b + w * t: + print(""YES"") + else: + print(""NO"") +" +p02646,s199558385,Wrong Answer,"ni = lambda: int(input()) +nm = lambda: map(int, input().split()) +nl = lambda: list(map(int, input().split())) + +a,v=nm() +b,w=nm() +t=ni() + +if v<=w: + print('NO') + exit() + +if abs(b-a)%(v-w)!=0: + print('NO') + exit() + +if abs(b-a)//(v-w) > t: + print('NO') + exit() + +print('YES') +" +p02646,s773784440,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V > W: + if T > (B - A) % (V - W): + print('YES') +else: + print('NO') +" +p02646,s496490680,Wrong Answer,"import math +import sys +a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +e1=pow(10, -9) +e2=pow(10, 9) + +if (a= 1 and w >= 1: + if (a-b)/(w-v) <= t and (a-b)/(w-v) > 0: + print('YES') + else: + print('NO') +else: + print('NO') +" +p02646,s950609934,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +aa = A + V*T +bb = B + W*T +if aa >= bb: + print(""YES"") +else: + print(""NO"")" +p02646,s552665646,Wrong Answer,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +if V == W: + print(""NO"") + exit() + +B = B - A +A = 0 + +md = (A - B) % (W - V) +time = (A - B) / (W - V) +if md == 0 and 0 <= time and time <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s964852780,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +flg = 0 +for i in range(t): + a+=v + b+=w + if(a==b): + flg=1 + break + +if(flg==1):print(""YES"") +else:print(""NO"")" +p02646,s170492180,Wrong Answer,"c1 = input().split() +c2 = input().split() +for i in range(2): + c1[i] = int(c1[i]) + c2[i] = int(c2[i]) +t = int(input()) +c1[0] += c1[1]*t +c2[0] += c2[0]*t +if c1[0] >= c2[0]: + print('YES') +else: + print('NO')" +p02646,s710378184,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +seen = [] +l,r = 0, T +while r>=l: + m = l + (r - l) // 2 + if m in seen: + print(""NO"") + exit() + else: + seen.append(m) + + if A+V*m == B+W*m: + print(""YES"") + exit() + + if A+V*m > B+W*m: + r = m + else: + l = m + +print(""NO"")" +p02646,s719927598,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +a=V*T+A +b=W*T+B + +if a>=b: + print('Yes') +else: + print('No')" +p02646,s175323879,Wrong Answer,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if abs(A-B) < V*T-W*T: + print('YES') +else: + print('NO')" +p02646,s302014577,Wrong Answer,"def main(): + A, V = map(int,input().split()) + B, W = map(int,input().split()) + T = int(input()) + if A < B and A+V*T >= B+W*T: + return('YES') + if A > B and A+V*T >= B+W*T: + return('YES') + else: + return('YES') +print(main())" +p02646,s457836582,Wrong Answer,"def LI(): return list(map(int, input().split())) +def I(): return map(int, input().split()) +mod = 10**9 + 7 + +def main(): + a, v = I() + b, w = I() + t = int(input()) + if b < a: + print('NO') + else: + if (v-w) * t >= b-a: + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main()" +p02646,s394044769,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +def check(): + deltaD=B-A + deltaV=V-W + if deltaD<0: + return 'NO' + if deltaD==0: + return 'YES' + if deltaV<=0: + return 'NO' + if deltaV>0: + if float(T) >= float(deltaD)/float(deltaV): + return 'YES' + return 'YES' + +print(check())" +p02646,s360348766,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A + V*T >= B + W*T: + print(""YES"") +else: + print(""NO"")" +p02646,s619304262,Wrong Answer,"x=input().split() +a=int(x[0]) +v=int(x[1]) +y=input().split() +b=int(y[0]) +w=int(y[1]) +t=int(input()) +da=v*t +db=w*t +fa=da+a +fb=b+db +if fa>=fb: + print(""YES"") +else: + print(""NO"") +" +p02646,s365457737,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v < w and a >= b: + print(""YES"") +if a+v * t >= b+w * t and v > w: + print(""YES"") +else: + print(""NO"") +" +p02646,s251950745,Wrong Answer,"B,W = map(int,input().split()) +A,V= map(int,input().split()) +T = int(input()) + +def main(): + if V >= W: + print(""NO"") + return + + elif abs(B-A)%abs(V-W)!=0: + print(""NO"") + return + + elif abs(B-A)//abs(V-W) <= T: + print(""YES"") + else: + print(""NO"") + + + + +main()" +p02646,s324692218,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +def check(): + deltaD=B-A + deltaV=V-W + if deltaD<0: + return 'NO' + if deltaD==0: + return 'YES' + if deltaV<=0: + return 'NO' + if deltaV>0: + if deltaD % deltaV==0 and float(T)>=float(deltaD/deltaV): + return 'YES' + return 'NO' + +print(check())" +p02646,s196053492,Wrong Answer,"a,v= list(map(int,input().split())) +b,w= list(map(int,input().split())) +t = int(input()) + +a_x = a+v*t +b_x = b + w*t +if a_x > b_x: + print(""YES"") +else: + print(""NO"") +" +p02646,s376339508,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V == W: + print('NO') + +elif A > B and V > W: + print('NO') + +elif B > A and W > V: + print('NO') + +elif abs(B-A) % abs(V-W) == 0: + print('YES') + +else: + print('NO')" +p02646,s110746683,Wrong Answer,"import sys +a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v<=w: + print(""NO"") + sys.exit() + +if ab+t*w: + print(""YES"") + else: + print(""NO"") +else: + if a-t*v= B + T * W: + print('YES') + else: + print('NO') +else: # A > B + if B + T * W >= A + T * V: + print('YES') + else: + print('NO') +" +p02646,s471390271,Wrong Answer,"a=list(map(int,input().split())) +b=list(map(int,input().split())) +t=int(input()) + +A=a[0]+a[1]*t +B=b[0]+b[1]*t + +if(A>=B): print(""YES"") +else:print(""NO""); +" +p02646,s924925232,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +for i in range(t): + if a+(v*i)>=b+(w*i): + print('YES') + break + else: + print('NO') + break" +p02646,s034430780,Wrong Answer,"import numpy as np +A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if V*T <= W*T: + print(""NO"") +elif A > B: + if A - V*T > B - W*T: + print (""NO"") + else: + print(""YES"") +else: + if A + V*T > B + W*T: + print(""YES"") + else: + print(""NO"") + " +p02646,s894308752,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +if(B+W*T <= A+V*T): + print(""YES"") +else: + print(""NO"")" +p02646,s988084969,Wrong Answer,"a, v= map(int, input().split()) +b, w= map(int, input().split()) +t = int(input()) +l = b-a +s = v-w +if s != 0: + z = l/s +else: + z = -1 +if 0< z <= t: + print('YES') +else: + print('NO')" +p02646,s957695691,Wrong Answer,"zahyoA, kyoriV = map(int, input().split()) +zahyoB, kyoriW = map(int, input().split()) +second = int(input()) + +flg = True if zahyoA < zahyoB else False +for i in range(second): + zahyoA += kyoriV + zahyoB += kyoriW + + if zahyoA == zahyoB: + print(""YES"") + break + elif i == second - 1: + print(""NO"") + break + + if flg and zahyoB > zahyoA: + print(""NO"") + break + elif not flg and zahyoA < zahyoB: + print(""NO"") + break +" +p02646,s195318363,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v == w: + print('NO') +else: + if 1 <= ((b - a) / (v - w)) <= t: + print('YES') + else: + print('NO')" +p02646,s902952615,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v <= w and a < b: + print('NO') + exit() + +oni = a + (v*t) +child = b + (w*t) + +if oni >= child: + print('YES') +else: + print('NO') +" +p02646,s273529494,Wrong Answer,"# -*- coding: utf-8 -*- + +def input_one_number(): + return int(input()) + +def input_multiple_number(): + return map(int, input().split()) + +def input_multiple_number_as_list(): + return list(map(int, input().split())) + + +A , V = input_multiple_number() +B, W = input_multiple_number() +T = input_one_number() + +D = abs(B-A) +v = W-V + +if D - v*T > 0 : + print(""NO"") +else: + print(""YES"") + +" +p02646,s946273437,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) + +t = int(input()) + +if v == w: + print(""NO"") + +elif (v < w): + ans = (a - b) / (v - w) + if t <= abs(ans): + print(ans) + print(""YES"") + else: + print(""NO"") +else: + ans = (b - a) / (v - w) + if t >= ans: + print(""YES"") + else: + print(""NO"") + + + +" +p02646,s849008773,Wrong Answer,"a, v = [int(i) for i in input().split()] +b, w = [int(i) for i in input().split()] +t = int(input()) + +l = b-a +v_l = v-w +if (l <= v_l * t): + print(""YES"") +else: + print(""NO"") +" +p02646,s419932152,Wrong Answer,"a, v = map (int, input().split()) +b, w = map (int, input().split()) +t = int(input()) +if v <= w: + print(""NO"") +else: + if (b-a)/(v-w) <=t: + print(""YES"") + else: + print(""NO"")" +p02646,s563971553,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +diff_pos = abs(B-A) +diff_spd = abs(W-V) + +if (diff_pos > diff_spd * (T+1)) : + print(""NO"") +else : + print(""YES"")" +p02646,s963757134,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +k = int(input()) +x = a + v * k +y = b + w * k +if a == b: + print('YES') +elif (a < b and v < w) or a < b: + print(""NO"") +else: + print('YES') +" +p02646,s944060494,Wrong Answer,"A,V = map(int,input().split(' ')) +B,W = map(int,input().split(' ')) +T = int(input()) + +for i in range(1,T+1): + if V*i+A >= W*i+B: + print('YES') + exit(0) +print('NO')" +p02646,s895570206,Wrong Answer,"a,b=map(int, input().split()) +c,d=map(int, input().split()) +e=int(input()) + +if a + b*e >= c + d*e: + print('YES') +else: + print('NO')" +p02646,s462011271,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V <= W: + if A == B: + print('YES') + exit() + else: + print('NO') + exit() +else: + t = abs(A-B)/V-W + if T >= t: + print('YES') + else: + print('NO') +" +p02646,s966824969,Wrong Answer,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) +import sys +x = 0 +while x= (a+v*t):print(""YES"") + else:print(""NO"")" +p02646,s700405573,Wrong Answer,"ABVW = [map(int, input().split()) for _ in range(2)] +AB, VW = [list(i) for i in zip(*ABVW)] +T = int(input()) + +if VW[0] == VW[1]: + print(""NO"") +else: + if AB[1] + VW[1]*T - (AB[0] + VW[0]*T) <= 0: + print(""YES"") + else: + print(""NO"") + + +" +p02646,s972290035,Wrong Answer,"a, a_v = map(int, input().split()) +b, b_v = map(int, input().split()) +t = int(input()) +flag=0 +t_set = 0 + +if a-b==0 and a_v-b_v == 0: + flag = 1 +elif a-b==0 or a_v-b_v == 0: + flag = 0 +else: + t_set = (a-b)/(b_v - a_v) + +if t_set>0: + if t_set<=t and 0T*abs(W-V):print(""NO"") +else:print(""YES"") +" +p02646,s861781971,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs(b - a) <= abs(t*(w - v)): + print(""YES"") +else: + print(""NO"")" +p02646,s301586466,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +L = abs(B-A) +vd = V-W +if L <= vd * T: + print(""Yes"") +else: + print(""No"")" +p02646,s313530958,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = float(input()) + +if (B - A) >= T * (V - W): + print(""No"") +else: + print(""YES"")" +p02646,s086851380,Wrong Answer,"# 東京海上日動 プログラミングコンテスト2020: B – Tag +A, V = [int(i) for i in input().split()] +B, W = [int(j) for j in input().split()] +T = int(input()) + +if V == W: + print('NO') +else: + t = (B - A) // (V - W) + print('YES' if t <= T and t > 0 else 'NO')" +p02646,s453775523,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v == w: + print('NO') +else: + if 1 <= ((b - a) / (v - w)) <= t: + print('YES') + else: + print('NO')" +p02646,s709320566,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if B+W*T <= A*V*T: + print(""YES"") +else: + print(""NO"") +" +p02646,s370124716,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if w == v: + u = (a - b) +else: + u = (a - b)/(w - v) +if u <= t: + print('YES') +else: + print('NO') +" +p02646,s095649937,Wrong Answer,"import sys +import math +import itertools +import collections +import heapq +import re +import numpy as np + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: sys.stdin.buffer.readline().split() +ri = lambda: int(sys.stdin.readline()) +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +rl = lambda: list(map(int, sys.stdin.readline().split())) +inf = float('inf') +mod = 10**9 + 7 + +a, v = rm() +b, w = rm() +t = ri() +if v - w == 0: + print('NO') + exit() +if 1 <= (b-a) / (v-w) <= t: + print('YES') +else: + print('NO') + +" +p02646,s464572632,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +print(""NO"" if b+(w*t)-(a+(v*t)) > 0 else 'YES') +" +p02646,s224957779,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if a= b+w*t: + print(""yes"") + else: + print(""no"") +else: + if a+v*t <= b+w*t: + print(""yes"") + else: + print(""no"")" +p02646,s319382328,Wrong Answer,"from decimal import Decimal +A, V = map(Decimal, input().split()) +B, W = map(Decimal, input().split()) +T = Decimal(input()) +dv = Decimal(V - W) +dist = abs(Decimal(B - A)) +if dv > 0: + if Decimal(dv * T) >= dist: + print(""YES"") +else: + print(""NO"")" +p02646,s472179377,Wrong Answer,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) + +if V <= W: + print('NO') + exit() + +tmp = abs(B - A) // abs(V - W) + +if B > A: + va = [A + V * t for t in range(tmp, T+1)] + vb = [B + W * t for t in range(tmp, T+1)] +else: + va = [A - V * t for t in range(tmp, T+1)] + vb = [B - W * t for t in range(tmp, T+1)] + +va_vb_and = list(set(va) & set(vb)) + +if va_vb_and: + print('YES') + exit() +print('NO') +" +p02646,s942050048,Wrong Answer,"a, a_v = map(int, input().split()) +b, b_v = map(int, input().split()) +t = int(input()) + +v = b_v - a_v +l = abs(b - a) + +if l==0: + print('YES') +elif v==0: + print('NO') +elif v*t>=l and l%v == 0: + print('YES') +else: + print('NO') +" +p02646,s634815024,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +tt = 0 + +caught = False +while tt < t: + if a==b: + caught = True + print(""YES"") + break + a += v + b += w + tt += 1 + +if not caught: + print(""NO"")" +p02646,s419763907,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + + +if V - W == 0: + print('NO') + exit() + +# t = (B - A) / (V - W) + +# t_j = (B - A) // (V - W) + +# print(t) +# print(t_j) + +# if t == t_j and 0 < t and t <= T: +# print('YES') +# exit() + +# print('NO') + +for t in range(1, T + 1): + A += V * t + B += W * t + if A == B: + print('YES') + exit() + +print('NO')" +p02646,s812906444,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +B = b + w * t +A = a + v * t +if(A - B > 0): + print('YES') +else: + print('NO') +" +p02646,s067426766,Wrong Answer,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) +X = abs(A-B) +Y = V-W +if (V<=W): + print('NO') +elif ((X%Y) == 0) and ((X/Y)<=T): + print('YES') +else: + print('NO')" +p02646,s456284232,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if W >= V: + f = False +else: + t = (B - A) / (V - W) + s = (B - A) // (V - W) + if s == t and t <= T: + f = True + else: + f = False + +print(""YES"" if f else ""NO"")" +p02646,s835088972,Wrong Answer,"import sys + +def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + out = 'NO' + if V==W: + if B==A: + out = 'YES' + print(out) + sys.exit() + else: + print(out) + sys.exit() + + t = (B - A) / (V - W) + if t >= 0: + if t<=T: + out = 'YES' + + print(out) +main()" +p02646,s746832268,Wrong Answer,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +d = abs(A-B) +v = abs(V-W) + +if v==0: + print(""NO"") + exit() + +t = d/v +print(t) +if T >= t: + print(""YES"") +else: + print(""NO"")" +p02646,s986352865,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A > B: + V, W = -V, -W + +if abs(V) <= abs(W): + ans = ""NO"" +elif (B - A) % (V - W) == 0: + if (B - A) / (V - W) <= T: + ans = ""YES"" + else: + ans = ""NO"" +else: + ans = ""YES"" +print(ans)" +p02646,s256391348,Wrong Answer,"AV = input().split() +BW = input().split() +T = int(input()) + +a = int(AV[0]) + int(AV[1]) * T +b = int(BW[0]) + int(BW[1]) * T + +if(a >= b): + print('YES') +else: + print('NO')" +p02646,s344562563,Wrong Answer,"a = list(map(int, input().split())) +b = list(map(int, input().split())) +t = int(input()) +aw = a[0]+a[1]*t +bw = b[0]+b[1]*t +if aw >= bw: + print('YES') +else: + print('NO')" +p02646,s322210766,Wrong Answer,"import sys +import math +import itertools +import collections +import heapq +import re +import numpy as np + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: sys.stdin.buffer.readline().split() +ri = lambda: int(sys.stdin.readline()) +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +rl = lambda: list(map(int, sys.stdin.readline().split())) +inf = float('inf') +mod = 10**9 + 7 + +a, v = rm() +b, w = rm() +t = ri() +if v - w == 0: + print('NO') + exit() +if ((b-a) / (v-w)) % 1 == 0 and 1 <= (b-a) / (v-w) <= t: + print('YES') +else: + print('NO') + +" +p02646,s402056338,Wrong Answer,"A, V= (int(x) for x in input().split()) +B, W = (int(x) for x in input().split()) +T = int(input()) + +for i in range(1,T+1): + if A < B and V <= W: + print(""NO"") + break; + d = (B-A)-((V-W)*i) + if d <= 0: + print(""YES"") + break; + elif d != 0 and i == T+1: + print(""NO"")" +p02646,s495315635,Wrong Answer,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +if A == B: + print(""YES"") + exit() + +if V == W: + print(""NO"") + exit() + +time = (A - B) / (W - V) +if 0 <= time and time <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s591404924,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +ans = [""YES"",""NO""] + +distance = abs(b-a) +speed = abs(w-v) + +result = distance - speed * t +if result <= 0: + print(ans[0]) +elif result > 0: + print(ans[1]) + +" +p02646,s767756301,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v-w > 0 and abs(a-b)/(v-w) <= t: + print(""Yes"") +else: + print(""No"") +" +p02646,s833561581,Wrong Answer,"a=input().split(' ') +b=input().split(' ') +c=int(input()) +i=0 +d=int(a[0]) +e=int(a[1]) +f=int(b[0]) +g=int(b[1]) +while i=d: + print('NO') +else: + print('YES')" +p02646,s454173236,Wrong Answer,"A,V=map(int, input().split()) +B,W=map(int, input().split()) +T=int(input()) + +if W-V!=0: + if (A-B)/(W-V)>0 and (A-B)/(W-V)==(A-B)//(W-V): + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s318067854,Wrong Answer,"import sys + +a, v, *_ = list(map(int, sys.stdin.readline().strip().split())) +b, w, *_ = list(map(int, sys.stdin.readline().strip().split())) +t, *_ = list(map(int, sys.stdin.readline().strip().split())) + +you = t * v + a +me = t * w + b +print(""YES"" if you >= me else ""NO"") +" +p02646,s594724006,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if ((V*T+A)>=(W*T+B)): + print(""YES"") +else: + print(""NO"")" +p02646,s898738845,Wrong Answer,"a,v =map(int, input().split()) +b,w =map(int, input().split()) +t=int(input()) +if a == b: + print(""Yes"") +if a*b<0: + d = a+b +else: + d = a-b +if d < 0: + d = -d +if v > w: + d2 = v-w +else: + d2 = w-v +if (v > w) and (d2*t < d): + print(""NO"") +elif v <= w: + print(""NO"") +else: + print(""YES"")" +p02646,s256367506,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +ans = 0 + +for i in range(T): + A += V + B += W + if(A == B): + ans = 1 + break + else: + ans = 2 + +if(ans == 1): + print('YES') +else: + print('NO')" +p02646,s798274394,Wrong Answer,"A, V= (int(x) for x in input().split()) +B, W = (int(x) for x in input().split()) +T = int(input()) + +for i in range(1,T+1): + if (A < B and V <= W) or (A > B and V >= W): + print(""NO"") + break; + else: + print(""YES"") + break;" +p02646,s980344648,Wrong Answer,"import sys + +a, v = list(map(int,input().split())) +b, w = list(map(int,input().split())) +t = int(input()) + +ai = [] +bi = [] + +for i in range(t): + av = a + v * (i+1) + bw = b + w * (i+1) + ai.append(av) + bi.append(bw) + +for i in range(t): + if ai[i] == bi[i]: + print('YES') + sys.exit() +print('NO') +" +p02646,s878309463,Wrong Answer,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) +P = ""NO"" + +if V > W: + while B >= A and T >= 0: + if A == B: + P = ""YES"" + break + A = A + V + B = B + W + T = T - 1 + +print(P)" +p02646,s229332192,Wrong Answer,"A,X=map(int,input().split()) +B,Y=map(int,input().split()) +T=int(input()) +c=[] + +for i in range(1,T+1): + a=A+X*i + b=B+Y*i + if a==b: + c.append(a) +if len(c)==1: + print('Yes') +else: + print('No') + + " +p02646,s309774414,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if (B - A) <= (V - W) * T : + print(""YES"") +else: + print(""No"")" +p02646,s825411163,Wrong Answer,"a,v = map(int,input().split()) +b, w= map(int,input().split()) +t = int(input()) +A = a+(t*v) +B = b + (t*w) +if B <= A: + print('YES') +else: + print('NO')" +p02646,s156829222,Wrong Answer,"# coding: utf-8 +# Your code here! +def LI():return list(map(int,input().split())) +def yes():print(""YES"") +def no():print(""NO"") + +a,v=LI() +b,w=LI() +t=int(input()) + +akun=a+v*t +bkun=b+w*t + +if a=bkun: + yes() + else: + no() +else: + if akun<=bkun: + yes() + else: + no() +" +p02646,s828685600,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V-W == 0: + print('NO') +elif V-W < 0: + print('NO') +elif B-A < 0: + print('NO') +elif (B-A)/(V-W) <= T: + print('YES') +else: + print('NO')" +p02646,s945846738,Wrong Answer,"ax, at = map(int, input().split(' ')) +bx, bt = map(int, input().split(' ')) +t = int(input()) + +if ax > bx: + ax, at, bx, bt = bx, bt, ax, at + +a_l = ax + at*t +b_l = bx + bt*t + +if a_l < b_l: + print(""NO"") +else: + print(""YES"")" +p02646,s722564658,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if (v-w)*t>=(b-a):print(""YES"") +else:print(""NO"")" +p02646,s270150427,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +print(""Yes"" if (V-W)*T>0 and (V-W)*T > abs(A-B) else ""No"")" +p02646,s216351967,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a < b: + print('YES' if v*t+a >= w*t+b else 'NO') +else: + print('YES' if v*t+a <= w*t+b else 'NO') +" +p02646,s663738961,Wrong Answer,"import sys + +def main(): + inputs = [input() for i in range(3)] + oni = list(map(int, inputs[0].split())) + kid = list(map(int, inputs[1].split())) + time = int(inputs[2]) + + pA = oni[0] + pB = kid[0] + for i in range(time): + print(pA, pB) + if pA == pB: + print(""YES"") + return 0 + pA = pA + oni[1] + pB = pB + kid[1] + print(""NO"") + +if __name__ == ""__main__"": + main()" +p02646,s254662416,Wrong Answer,"A, V = map(int, input().split()) +B, W= map(int, input().split()) +T = int(input()) + + +diff1 = (A - B) +diff2 = (V - W)*T + +if ( diff1 < diff2): + print(""YES"") +else: + print(""NO"")" +p02646,s613516436,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +flag = False +for i in range(1,T+1): + if A+V*i == B+W*i: + flag = True + break +if flag == True: + print(""YES"") +else: + print(""NO"")" +p02646,s118307444,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +position_diff = b-a +pace_diff = v-w + +if pace_diff < 0: + print('NO') +elif pace_diff * t > position_diff: + print('YES') +else: + print('NO')" +p02646,s427548779,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +tiji = abs(W-V) +kyori = abs(A-B) + +if W>=V and A!=B: + print('NO') +elif A==B: + print('YES') +elif T*tiji < kyori: + print('NO') +elif kyori % tiji ==0: + print('YES') +else: + print('NO')" +p02646,s146428355,Wrong Answer,"A = list(map(int,input().split())) +B = list(map(int,input().split())) +T = int(input()) +A[1] += (A[1] * T) +B[1] += (B[1] * T) + +if A[1] > B[1]: + print('YES') +else: + print('NO')" +p02646,s499976613,Wrong Answer,"import sys + +a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +d1 = v <= w +d2 = abs(a-b) <= t*(v-w) +if d1 <= d2 : + print(""Yes"") +else: + print('No')" +p02646,s943908594,Wrong Answer,"ax, at = map(int, input().split(' ')) +bx, bt = map(int, input().split(' ')) +t = int(input()) + +a_l = ax + at*t +b_l = bx + bt*t + +if a_l < b_l and at == bt: + print(""NO"") +else: + print(""YES"")" +p02646,s041560293,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +flg = True + +if v <= w: + flg = False +else: + if a < b: + if (b - a) / (v - w) == int((b - a) / (v - w)) and (b - a) / (v - w) <= t: + flg = True + else: + flg = False + else: + if (a - b) / (v - w) == int((a - b) / (v - w)) and (a - b) / (v - w) <= t: + flg = True + else: + flg = False +print(""YES"" if flg else ""NO"")" +p02646,s883666780,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +av = a + (v*t) +bw = b + (w*t) + +if av >= bw: + print('YES') +else: + print('NO')" +p02646,s052455457,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +L=abs(B-A) +vd=V-W +if L <= vd*T: + print(""Yes"") +else: + print(""No"")" +p02646,s260305092,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +T = int(input()) + +if v < w: + print(""NO"") + exit(0) + +if v == w or a == b: + print(""NO"") + exit(0) + +if a < b: + t = (b-a) / (v-w) + print(""YES"" if ((b-a) % (v-w) == 0) and (t <= T) else ""NO"") +else: + t = (a-b) / (v-w) + print(""YES"" if ((a-b) % (v-w) == 0) and (t <= T) else ""NO"") +" +p02646,s893583555,Wrong Answer,"a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +flag = 0 +if v > w and a<=b: + for i in range(t): + if a+v*i == b+w*i: + flag = 1 + break + +if flag ==1: + print(""YES"") +else: + print(""NO"")" +p02646,s066069989,Wrong Answer,"import sys + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs((a-b) + (v-w)*t) >= 0: + print('Yes') +else: + print('No')" +p02646,s717347745,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +ans = (b - a) - (v - w) * t +if ans > 0: + print('NO') +else: + print('YES')" +p02646,s056123251,Wrong Answer,"a,v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +if a + v * t >= b + w * t: + print('YES') +else: + print('NO') +" +p02646,s261959937,Wrong Answer,"oni = input().split() +kodomo = input().split() +limit_time = int(input()) + +oni_ichi = int(oni[0]) +oni_move = int(oni[1]) + +kodomo_ichi = int(kodomo[0]) +kodomo_move = int(kodomo[1]) + +move_dir_num = oni_ichi - kodomo_ichi + +if move_dir_num >= 0: + res = (kodomo_ichi - kodomo_move * limit_time) - (oni_ichi - oni_move * limit_time) +else: + res = (kodomo_ichi + kodomo_move * limit_time) + (oni_ichi + oni_move * limit_time) + +if res < 0: + print(""YES"") +else: + print(""NO"")" +p02646,s775681468,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if B==A: + print(""YES"") +elif W >= V or B(V-W)*T: + print(""NO"") +else: + print(""YES"")" +p02646,s275326681,Wrong Answer,"a,v =map(int, input().split()) +b,w =map(int, input().split()) +t=int(input()) + +if a+v*t >= b+w*t : + print('YES') +else : + print('NO')" +p02646,s150474951,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +a = V*T+A-1 +b = W*T+B-1 + +if a >= b: + print(""YES"") +else: + print(""NO"")" +p02646,s621264327,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +at = v*t + a +bt = w*t + b + +print(at, bt) + +if at >= bt: + print('YES') +elif at < bt: + print('NO') +" +p02646,s137983251,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +for i in range(1,t): + a += v + b += w + if a == b: + print(""YES"") + break +else: + print(""NO"")" +p02646,s625481661,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if a+(v*t)>=b+(w*t): + print('YES') +else: + print('NO')" +p02646,s968885564,Wrong Answer,"a,v=list(map(int,input().split())) +b,w=list(map(int,input().split())) +t=int(input()) +if a=b+w*t: + print('YES') + else: + print('NO') +elif a==b: + print('YES') +elif a>b: + if b-w*t>a-v*t: + print('YES') + else: + print('NO')" +p02646,s885425174,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +print('YNEOS'[a+v*t < b+w*t::2])" +p02646,s516446728,Wrong Answer,"a,b=map(int,input().split()) +c,d=map(int,input().split()) +e=int(input()) +if abs(a)+b*e>=abs(c)+d*e : + print('YES') +else: + print('NO') + " +p02646,s067108922,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +d = abs(a-b) +s = v-w +if s <= 0: print(""NO""); exit() + +u = d // s +print(""YES"" if u <= t else ""NO"") +" +p02646,s824896430,Wrong Answer,"a,v=map(int,input().split())#鬼 +b,w=map(int,input().split()) +t=int(input()) + +for i in range(t): + if b= V: + print('No') +elif abs(A - B) <= (V - W) * T: + print('Yes') +else: + print('No')" +p02646,s412917945,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) + +if B - A < 0: + if V * T >= A - B: + print(""YES"") + else: + print(""NO"") +else: + if (V-W) * T >= B - A: + print(""YES"") + else: + print(""NO"") +" +p02646,s277506164,Wrong Answer,"a, v = list(map(int, input().split(' '))) +b, w = list(map(int, input().split(' '))) +t = int(input()) + +if a > b: + print('NO') + exit() + +if w > v: + print('NO') + exit() + +catchup_speed = v - w +start_dis = b - a + +if start_dis <= t*catchup_speed: + print('YES') + exit() + +print('NO') + +" +p02646,s361485070,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dis = B-A +mob = W-V + +if A == B: + print(""Yes"") + +else: + if mob >= 0: + print(""No"") + else: + if dis % mob != 0: + print(""No"") + else: + if dis + (mob*T) <= 0: + print(""Yes"") + else: + print(""No"")" +p02646,s752199378,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +flag = False +for t in range(T+1): + if A+V*t == B+W*t: + flag = True + break +if flag: + print('YES') +else: + print('NO')" +p02646,s569924512,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if V <= W: + print(""NO"") +else: + if abs(A-B)%(V-W) == 0 and abs(A-B)/(V-W) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s005303655,Wrong Answer,"import bisect,collections,copy,heapq,itertools,math,string +import sys +def S(): return sys.stdin.readline().rstrip() +def M(): return map(int,sys.stdin.readline().rstrip().split()) +def I(): return int(sys.stdin.readline().rstrip()) +def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) +def LS(): return list(sys.stdin.readline().rstrip().split()) +a, v = M() +b, w = M() +t = I() +a_now = a +b_now = b +ans = 'NO' +for i in range(t): + a_now += v + b_now += w + if a_now == b_now: + ans = 'YES' +print(ans)" +p02646,s837946664,Wrong Answer,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +if V > W and T > (abs(A - B) / abs(V - W)): + print('YES') +else: + print('NO')" +p02646,s291215201,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if(V-W > 0): + if((A-B)//(V-W) <= T): + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s946655046,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if (b-a)<= (v-w)*t: + print (""YES"") +else: + print(""NO"") +" +p02646,s478073120,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a==b: + print('YES') + exit() + +if v>w: + if b-a<=(v-w)*t: + print('YES') + exit() +print('NO')" +p02646,s307291433,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v <= w: + print('No') +else: + if (v-w)*t >= abs(a-b): + print('Yes') + else: + print('No')" +p02646,s449886079,Wrong Answer,"import sys + +la = list(map(int, input().split())) +lb = list(map(int, input().split())) +t = int(input()) + + +nowDis = abs(lb[0] - la[0]) +aDis = la[1]*t +bDis = lb[1]*t +speed = bDis - aDis + +if lb[1] == 0: + print(""YES"") + sys.exit() + +if speed >= 0: + print(""NO"") +else: + if nowDis / speed >= t: + print(""NO"") + else: + print(""YES"") +" +p02646,s141771210,Wrong Answer,"# A V +# B W +# T +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A < B and (V-W)*T >= B-A and (B-A) % (V-W) == 0: + print('YES') +else: + print('NO')" +p02646,s610739077,Wrong Answer,"def main(): + A, V = map(int,input().split()) + B, W = map(int,input().split()) + T = int(input()) + if A < B and A+V*T >= B+W*T: + return('YES') + else: + for i in range(T): + A += V + B += W + if A >= B: + return('YES') + return('NO') +print(main())" +p02646,s110051069,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if W >= V: + print('NO') +else: + if (V-W)*T >= max(A,B) - min(A,B) and (max(A,B) - min(A,B))%(V-W) == 0: + print('YES') + else: + print('NO')" +p02646,s703473541,Wrong Answer,"#!/usr/bin/env python + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() +if abs(b-a)//(w-v) > t: + print('NO') + exit() +print('YES') +" +p02646,s072729624,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V>W: + if abs(A-B)%abs(V-W) == 0 and abs(A-B)//abs(V-W)<=T: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s644250552,Wrong Answer,"A,V = list(map(int,input().split())) +B,W = list(map(int,input().split())) +T = int(input()) + +sub = B - A +speed = V - W +if sub >= T*speed: + print(""No"") +else: + print(""YES"")" +p02646,s687615937,Wrong Answer,"A = list(map(int, input().split())) +B = list(map(int, input().split())) +T = int(input()) +x=A[0]-B[0] +v=A[1]-B[1] + +if v<=0: + print('NO') +elif abs(x w: + if abs(a-b)//(v-w) <= t: + print(""YES"") + else: + print(""No"") +else: + print(""NO"")" +p02646,s396586215,Wrong Answer,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) + +for t in range(1, T+1): + if B+W*t == A+V*t: + print('YES') + exit() +print('NO') +" +p02646,s364420232,Wrong Answer,"a,v= input().split() +a=int(a) +v=int(v) +b,w= input().split() +b=int(b) +w=int(w) +t= int(input()) +if (a + v*t) >= (b+w*t): + print(""YES"") +else: + print(""NO"")" +p02646,s873053311,Wrong Answer,"import sys +a,v=list(map(int,input().split())) +b,w=list(map(int,input().split())) +t=int(input()) +if v-w==0: + if a==b: + print(""YES"") + else: + print(""NO"") + sys.exit() +temp=(b-a)/(v-w) +if temp<0 or temp>t: + print(""NO"") +else: + print(""YES"")" +p02646,s436814181,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +velocity = v-w +dist = b-a +if velocity == 0: + print('NO') +elif vt : + print('NO') +else : + print('YES') + +" +p02646,s619050332,Wrong Answer,"import math +from sys import stdin,stdout +#% 998244353 +from heapq import heapify,heappop,heappush +import collections + + +a,s1=list(map(int,stdin.readline().split())) +b,s2=list(map(int,stdin.readline().split())) +T = int(stdin.readline()) +if s1==s2: + print(""NO"") +elif s1>s2: + if a>b: + print(""NO"") + else: + d=b-a + if d/(s1-s2)<=T: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"") + +" +p02646,s721205322,Wrong Answer,"def main(): + a,v = map(int,input().split()) + b,w = map(int,input().split()) + t = int(input()) + + a += 10**9 + b += 10**9 + if v == w: + print('NO') + return 0 + if a > b: + print('NO') + elif (b-a)%(v-w) != 0: + print('NO') + elif 0 <= (b-a)/(v-w) <= t: + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main() +" +p02646,s749768466,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if v*t+a-b>=w*t: + print('YES') +else: + print('NO')" +p02646,s390021655,Wrong Answer,"a,v= list(map(int,input().split())) +b,w= list(map(int,input().split())) +t = int(input()) + +a_x = a+v*t +b_x = b + w*t +if a_x >= b_x: + print(""YES"") +else: + print(""NO"") +" +p02646,s746406843,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V == W: + print(""NO"") + exit() +if A > B: + t1 = A + A = B + B = t1 + t2 = V + V = W + W = t2 +if V < W: + print(""NO"") + exit() +if (A + V*T) - (B + W*T) >= 0: + print(""YES"") + exit() +else: + print(""NO"") + exit()" +p02646,s034559036,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +diff_dist = B - A +diff_v = V - W +flag = False +if diff_v == 0: + if diff_dist == 0: + flag = True +elif diff_dist == 0: + flag = True +else: + t = diff_dist / diff_v + if t > 0: + #if abs(diff_dist) % abs(diff_v) == 0: + #if t <= T: + flag = True +if flag: + print('YES') +else: + print('NO')" +p02646,s006677336,Wrong Answer,"A, V = [int(i) for i in input().split()] +B, W = [int(i) for i in input().split()] +T = int(input()) + +if W-V == 0: + if A == B: + print('YES') + else: + print('NO') + exit() + +t = (A-B)/(W-V) + +if t < 0: + print('NO') + exit() + +if t<=T: + print('YES') +else: + print('NO') +" +p02646,s042726864,Wrong Answer,"import sys +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +cnt = 0 +if a>b or w>v: + print('NO') + sys.exit() +for tt in range(t): + res = (w - v) * tt + (b - a) + if res == 0: + cnt = 1 + break + +if cnt == 1: + print('YES') +else: + print('NO')" +p02646,s539485385,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V <= W: + print('NO') +elif abs(A - B) % abs(V - W) != 0: + print('NO') +elif abs(A - B) // abs(V - W) > T: + print('NO') +else: + print('YES')" +p02646,s657647211,Wrong Answer,"a, v = [int(i) for i in input().split()] +b, w = [int(i) for i in input().split()] +t = int(input()) + +l = b-a +v_l = v-w +if l > 0: + if l <=( v_l * t): + print(""YES"") + else: + print(""NO"") +else: + if l >= (v_l * t): + print(""YES"") + else: + print(""NO"")" +p02646,s522375845,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V * T + A >= W * T + B: + print('Yes') +else: + print('No') +" +p02646,s473865917,Wrong Answer,"#デフォルト +import itertools +from collections import defaultdict +import collections +import math +import sys +sys.setrecursionlimit(200000) +mod = 1000000007 + +a, v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +sub = abs(b - a) +if sub == 0: + print(""YES"") +else: + ss = v - w + if ss < 1: + print(""NO"") + else: + if sub % ss == 0: + if sub / ss <= t: + print(""YES"") + else: + print(""NO"") + else: + print(""NO"")" +p02646,s172399952,Wrong Answer,"def iput(): return int(input()) +def mput(): return map(int, input().split()) +def lpit(): return list(map(int, input().split())) + +def solve(): + a, v = mput() + b, w = mput() + t = iput() + if v == w: + print(""NO"") + elif abs(a - b) / (v - w) <= t: + print(""YES"") + else: + print(""NO"") + return 0 + +if __name__ == ""__main__"": + solve() +" +p02646,s748386443,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A + (V * T) >= B + (W * T): + print('YES') +else: + print('NO')" +p02646,s594504385,Wrong Answer,"a, v = [int(i) for i in input().split()] +b, w = [int(i) for i in input().split()] +t = int(input()) + +if w >= v: + print(""NO"") + exit() +#print((b-a) / (v-w)) +if (b-a) / (v-w) <= t: + print(""YES"") +else : + print(""NO"")" +p02646,s428665195,Wrong Answer,"import math +import sys +a,v=(int(x) for x in input().split()) +b,w=(int(x) for x in input().split()) +t = int(input()) + +e1=pow(10, -9) +e2=pow(10, 9) + +if (a 0 and diff_v > 0: + #if abs(diff_dist) % abs(diff_v) == 0: + if t <= T: + flag = True +if flag: + print('YES') +else: + print('NO')" +p02646,s730006428,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if vw and a>b: + print(""NO"") + exit() +elif v==w: + print(""NO"") + exit() + +if (b-a)%(v-w)==0 and (b-a)/(v-w)<=t: + print(""YES"") +else: + print(""NO"")" +p02646,s270239075,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +velocity = w-v +dist = b-a +if velocity == 0: + print('NO') +elif (a < b) and (v < w): + print('NO') +elif (a>b) and (v= V: + print(""NO"") +else: + C = abs(A - B) + X = V - W + if C // X > T: + print(""NO"") + else: + print(""YES"")" +p02646,s176193962,Wrong Answer,"def solve(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + + if (v-w) > 0: + x = (b-a)/(v-w) + else: + return 'NO' + + if abs(x) >= 1 and abs(x) <= t and x*v + a == x*w + b: + return 'YES' + + return 'NO' + + +print(solve()) +" +p02646,s594195583,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +for i in range(t): + a+=v + b+=w + if a>=b: + print('YES') + break + else: + print('NO') + break" +p02646,s629719603,Wrong Answer," +import sys +reader = (s.rstrip() for s in sys.stdin) +input = reader.__next__ +# do magic here +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +distA = v*t +distB = w*t + +# diff = abs(a-b) + +if a < b: + if a+distA >= b+distB: + print(""YES"") + else: + print(""NO"") +else: + if a-distA >= b-distB: + print(""YES"") + else: + print(""NO"")" +p02646,s780228827,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +x=a+v*t +y=b+w*t +if x>y or x==y: + print('Yes') +else: + print('No')" +p02646,s121891553,Wrong Answer," +a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if w >= v : + print(""NO"") + +for i in range(1,t+1): + if a < b: + a = a + v + b = b + w + else: + a = a - v + b = b - w + if a == b: + print(""YES"") + exit() +print(""NO"")" +p02646,s073466147,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if abs(B-A) <= T*(V-W): + print(""Yes"") +else: + print(""No"") +" +p02646,s227048271,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +lange = B - A +s = V - W + +res = 0 + +if s != 0: + tmp = lange / s + if tmp.is_integer() and tmp <= T and tmp >= 0: + res = 1 + +if (res == 0): + print(""NO"") +else: + print(""YES"")" +p02646,s198413701,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +a = abs(A) + V * T +b = abs(B) + W * T +if a >= b: + print(""YES"") +else: + print(""NO"")" +p02646,s594672007,Wrong Answer,"A,V=map(int, input().split()) +B,W=map(int, input().split()) +T=int(input()) + +if V<=W: + print('NO') +elif AB: + if (A-B)//(V-W)<=T: + print('YES') + else: + print('NO') +" +p02646,s695046911,Wrong Answer,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +if (V <= W): + print('NO') +elif (A + (V * T) > B + (W * T)): + print('YES') +else: + print('NO') +" +p02646,s053373649,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if v<=w: + print('NO') +else: + if a+v*t>=b+w*t: + print('Yes') + else: + print('No')" +p02646,s486496543,Wrong Answer,"import sys +a,v=list(map(int,input().split())) +b,w=list(map(int,input().split())) +t=int(input()) +if v-w==0: + if a==b: + print(""YES"") + else: + print(""NO"") + sys.exit() +temp=(b-a)/(v-w) +if temp>t: + print(""NO"") +else: + print(""YES"")" +p02646,s526052417,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +x = b - a +y = v - w +n = (a + v * t) - (b + w) +if y <= 0: + print(""NO"") +elif x % y == 0 and n >= 0: + print(""YES"") +else: + print(""NO"") + +" +p02646,s467220944,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +distance = abs(A-B) +speed = abs(V-W) +if distance <= speed*T: + print(""YES"") +else: + print(""NO"") +" +p02646,s763905008,Wrong Answer,"#鬼 +a,v=map(int,input().split()) + +#逃げている +b,w=map(int,input().split()) + +#t秒以内 +t=int(input()) + +if v==w: + print(""NO"") + exit() + +from math import gcd +g=gcd(v,w) +v=v//g +w=w//g + +if (b-a)/(v-w)<=t*g and (b-a)/(v-w)>0: + print(""YES"") +else: + print(""NO"") +" +p02646,s615885339,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +ans=""NO"" +if v!=w: + if (b-a)%(w-v)==0 and (b-a)//(w-v)<0 and abs((b-a)//(w-v))<=t: + ans=""YES"" +print(ans)" +p02646,s082543879,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) + +t = int(input()) + + +if (v <= w): + ans = t + 1 +else: + ans = (b - a) / (v - w) + + + +if t >= ans: + print(""YES"") +else: + print(""NO"") + +" +p02646,s703405371,Wrong Answer,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) + +if V <= W: + print('NO') + exit() + +va = [A + V * t for t in range(1, T+1)] +va.extend([A - V * t for t in range(1, T+1)]) +vb = [B + W * t for t in range(1, T+1)] +vb.extend([B - W * t for t in range(1, T+1)]) + +va_vb_and = set(va) & set(vb) + +if va_vb_and is not None: + print('YES') + exit() +print('NO') +" +p02646,s544924461,Wrong Answer,"from sys import stdin, setrecursionlimit + + +def main(): + input = stdin.buffer.readline + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + if (v - w) * t >= b - a: + print('YES') + else: + print('NO') + + +if __name__ == ""__main__"": + setrecursionlimit(10000) + main() +" +p02646,s747485473,Wrong Answer,"A, V = list(map(int,input().split("" ""))) +B, W = list(map(int,input().split("" ""))) +T = int(input()) + +if A == B: + print(""YES"") +elif A < B: + if A + V*T > B + W*T: + print(""YES"") + else: + print(""NO"") +else: + if A + V*T < B + W*T: + print(""YES"") + else: + print(""NO"")" +p02646,s306160289,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +def check(): + deltaD=B-A + deltaV=V-W + if deltaD<0: + return 'NO' + if deltaD==0: + return 'YES' + if deltaV<=0: + return 'NO' + if deltaV>0: + if T*deltaV >deltaD: + return 'YES' +print(check())" +p02646,s870897160,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V-W <= 0: + print(""NO"") +else: + if ((B-A)/(V-W)) <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s630546400,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +print(""YES"" if (V-W)*T>0 and (V-W)*T > abs(A-B) else ""NO"")" +p02646,s184117830,Wrong Answer,"def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + for _ in range(T): + if A == B: + print('YES') + return + else: + A += V + B += W + print('NO') + +main()" +p02646,s888584306,Wrong Answer,"import sys +A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) + +#これO(1)で解けそう。 + +# スピードが同じ or 逃げる方のスピードが速いと無理 +if V == W: + print(""NO"") + sys.exit() + + + +# 鬼の方がスピードが速い場合で場合訳 +distance_AB = abs(A-B) +speed_AB = abs(V-W) + +if abs(A-B) <= abs(V-W)*T: + print(""YES"") +else: + print(""NO"") + + +" +p02646,s118273090,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +try: + print(""Yes"" if abs(A - B) // (V - W) <= T and abs(A - B) // (V - W) >= 0 else ""No"") +except ZeroDivisionError: + print(""No"")" +p02646,s600668053,Wrong Answer,"a, speedA = map(int, input().split()) +b, speedB = map(int, input().split()) +t = int(input()) +def do(): + if speedB >= speedA: + print(""NO"") + return 0 + + d = abs(a - b) + x = speedA - speedB + #if d % x != 0: + # print(""NO"") + # return 0 + + reachTime = x / d + if reachTime <= t: + print(""YES"") + return 0 + else: + print(""NO"") + return 0 +do()" +p02646,s674834768,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +dif = abs(B-A) +speed = V-W +if speed <= 0: + print('No') +else: + if speed*T >= dif: + print('Yes') + else: + print('No') +" +p02646,s838886970,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if (t*w)+b <= (t*v)+a: + print('YES') +else: + print('NO')" +p02646,s155057460,Wrong Answer,"a,b=map(int,input().split()) +c,d=map(int,input().split()) +e=int(input()) + +n=b-d +m=c-a + +if n<=0: + print('NO') +elif e<(m/n): + print('NO') +else: + print('YES') + +" +p02646,s509309665,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +lange = B - A +s = V - W + +res = 0 + +if s != 0: + tmp = lange / s + if tmp.is_integer() and tmp <= T and tmp > 0: + res = 1 + +if (res == 0): + print(""NO"") +else: + print(""YES"")" +p02646,s935297133,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +ans=0 +if a + v * t >= b + w * t: + ans='YES' +else: + ans='NO' +print(ans)" +p02646,s642599380,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + + +for i in range(T+1): + if A == B: + print(""YES"") + exit() + if A < B: + A = A + V * i + B = B + W * i + else: + A = A - V * i + B = B - W * i + +print(""NO"")" +p02646,s070622051,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +X = abs(B-A) +Y = abs(V-W) + +if Y == 0 or X%Y != 0: + print('NO') +else: + if Y*T >= X: + print('YES') + else: + print('NO')" +p02646,s103343982,Wrong Answer,"oni_x, oni_speed = map(int, input().split()) +chi_x, chi_speed = map(int, input().split()) +time = int(input()) +ans = False + +for i in range(time): + oni_x += oni_speed + chi_x += chi_speed + if oni_x == chi_x: + ans = True + break +if ans: + print('YES') +else: + print('NO')" +p02646,s302354505,Wrong Answer,"# -*- coding: utf-8 -*- + +def main(): + A,V = map(int,input().split()) + B,W = map(int,input().split()) + T = int(input()) + + d1 = V*T+A + d2 = W*T+B + if A= d2): + print('YES') + else: + print('NO') + else: + if (d2 >= d1): + print('YES') + else: + print('NO') + +if __name__ == '__main__': + main() +" +p02646,s530221518,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + + +if V - W == 0: + print('NO') + exit() + +t = (B - A) / (V - W) + +t_j = (B - A) // (V - W) + +if t == t_j and t <= T: + print('YES') + +print('NO') +" +p02646,s309962544,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v-w > 0 and abs(a-b) <= t*(v-w): + print(""Yes"") +else: + print(""No"") +" +p02646,s620737033,Wrong Answer," +def main(): + A,V = map(int, input().split()) + B,W = map(int, input().split()) + T = int(input()) + #print(A,V,B,W,T) + + if( (V-W)*T - B + A >= 0 ): + return print('YES') + else: + return print('NO') + + +if __name__ == '__main__': + main() +" +p02646,s291015002,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t=int(input()) +if w-v>=0: + print(""NO"") +elif abs(a-b)%abs(v-w)!=0: + print(""NO"") +elif abs(a-b)/abs(v-w)>t: + print(""NO"") +else: + print(""YES"")" +p02646,s725441981,Wrong Answer,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) + +if (B-A) <= (V-W)*T: + print('YES') +else: + print('NO') +" +p02646,s991004525,Wrong Answer,"A, V= (int(x) for x in input().split()) +B, W = (int(x) for x in input().split()) +T = int(input()) + +for i in range(1,T+1): + if A < B and V <= W: + print(""NO"") + break; + d = abs(B-A)-(abs(V-W)*i) + if d == 0: + print(""YES"") + break; + elif d != 0 and i == T+1: + print(""NO"")" +p02646,s891248282,Wrong Answer,"# 東京海上日動 プログラミングコンテスト2020: B – Tag +A, V = [int(i) for i in input().split()] +B, W = [int(j) for j in input().split()] +T = int(input()) + +if V == W: + print('NO') +else: + t = (B - A) // (V - W) + + print('\n', t) + print('YES' if t <= T and t > 0 else 'NO')" +p02646,s921798155,Wrong Answer,"a, v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +a = t*v +b = t*w + +if a >= b: + print('YES') +else: + print('NO')" +p02646,s000627287,Wrong Answer,"read = lambda: list(map(int, input().split())) +a, v = read() +b, w = read() +t = int(input()) +a_pos = v * t + a +b_pos = w * t + b +if a == b: + print(""Yes"") +else: + if a_pos >= b_pos: + print(""Yes"") + else: + print(""No"") +" +p02646,s230120614,Wrong Answer,"i = list(map(int, input().split())) +j = list(map(int, input().split())) +t = int(input()) +ans = ""No"" +if i[0] > j[0]: # 鬼が右側にいるとき + i[1] = i[0] - t * i[1] + j[1] = j[0] - t * j[1] + if i[1] <= j[1]: + ans = ""Yes"" +elif i[0] < j[0]: # 鬼が左側にいるとき + i[1] = i[0] + t * i[1] + j[1] = j[0] + t * j[1] + if i[1] >= j[1]: + ans = ""Yes"" +else: + ans = ""Yes"" + +print(ans)" +p02646,s842038601,Wrong Answer,"import math + +def oni(ax, av, bx, bv, t): + x = abs(bx - ax) + v = av - bv + + if (v <= 0): + print('NO') + elif (x/v > t): + print('NO') + elif (x%v != 0): + print('NO') + else: + print('YES') + +ax, av = list(map(int, input().split())) +bx, bv = list(map(int, input().split())) +t = int(input()) + +oni(ax, av, bx, bv, t) +" +p02646,s962264114,Wrong Answer,"A,V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +if (A + V*T) >= (B + W*T): + print(""YES"") +else: + print(""NO"")" +p02646,s763716176,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +x=a+v*t +y=b+w*t +if x>y or x==y: + print('YES') +else: + print('NO')" +p02646,s122960845,Wrong Answer,"A,V = map(int, input().split()) +B,W = map(int, input().split()) +T = int(input()) +for i in range(T): + if A + V*i == B + W*i: + print('YES') + break + elif i == T-1: + print('NO') +" +p02646,s148885181,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if A+V*T>=B+W*T: + print(""Yes"") +else: + print(""No"")" +p02646,s627299570,Wrong Answer,"A, V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + +abs_BA = abs(B-A) +sub_WV = W-V + +if sub_WV >= 0: + print(""NO"") +elif abs_BA / sub_WV <= T: + print(""YES"") +else: + print(""NO"")" +p02646,s461766780,Wrong Answer," + +l=list(map(int, input().split(' '))) +a=l[0] +v=l[1] +l=list(map(int, input().split(' '))) +b=l[0] +w=l[1] +s=int(input()) +ans=True +if a>b: + ans=a-v*s<=b-w*s +else: + ans=a+v*s<=b+w*s +if ans: + print(""YES"") +else: + print(""NO"") + + +" +p02646,s501962612,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +if av and afb: + print(""YES"") +else: + print(""NO"")" +p02646,s041427286,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +eva=False + +pl=abs(B-A) +ve=V-W + +if pl<=ve*T and 00: + if pl%abs(ve)==0: + eva=True +if eva: + print(""YES"") +else: + print(""NO"")" +p02646,s120165678,Wrong Answer,"import sys +a,v=list(map(int,input().split())) +b,w=list(map(int,input().split())) +t=int(input()) +if v-w==0: + if a==b: + print(""YES"") + else: + print(""NO"") + sys.exit() +temp=(b-a)/(v-w) +if temp<0 or temp>t or int(temp)!=temp: + print(""NO"") +else: + print(""YES"")" +p02646,s562917525,Wrong Answer,"ABVW = [map(int, input().split()) for _ in range(2)] +AB, VW = [list(i) for i in zip(*ABVW)] +T = int(input()) + +if VW[0] == VW[1]: + print(""NO"") +else: + if AB[1] + VW[1]*T - (AB[0] + VW[0]*T) <= 0: + print(""YES"") + else: + print(""NO"")" +p02646,s651860667,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +d = abs(a-b) +if w >= v: + print('NO') +else: + if d%(v-w)==0: + print('YES') + else: + print('NO')" +p02646,s569560524,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if a+v*t >= b+ w*t: + print(""YES"") +else: + print(""NO"")" +p02646,s650757213,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V-W == 0: + print(""NO"") + import sys + sys.exit() +import math +if abs(B-A)/(V-W) <= T: + print(""YES"") +else: + print(""NO"") +" +p02646,s583292185,Wrong Answer,"a, v = list(map(int,input().split())) +b, w = list(map(int,input().split())) +t = int(input()) + +distance = abs(a-b) +speed = v - w + +if speed <= 0: + print('NO') + exit() + +if (distance % speed == 0) and (t * speed >= distance): + print('YES') +else: + print('NO')" +p02646,s078121374,Wrong Answer,"def resolve(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + ans = 'NO' + + if V > W: + t = (B-A)/(V-W) + if t <= T and is_integer(t): + ans = 'YES' + + print(ans) + +def is_integer(n): + try: + float(n) + except ValueError: + return False + else: + return float(n).is_integer() + +if __name__ == '__main__': + resolve()" +p02646,s666801782,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +a_dis = 0 +b_dis = 0 + +for i in range(t): + a_dis += v + b_dis += w + +if a_dis > b_dis: + print(""YES"") +else: + print(""NO"")" +p02646,s838388455,Wrong Answer,"A,V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A == B: + print('YES') + exit(0) +print(T*V+A) +print(T*W+B) +if ((T*V+A) - (T*W+B) >=0): + print(""YES"") +else: + print(""NO"") +" +p02646,s864646633,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +oni = a + (v*t) +child = b + (w*t) + +if oni == child: + print('YES') +else: + print('NO')" +p02646,s638151317,Wrong Answer,"a, b= map(int,input().split(' ')) +c,d=map(int,input().split(' ')) +e=int(input()) + +if (a+(b*e))>=(c+(d*e)): + print('YES') +if (a+(b*e))<(c+(d*e)): + print('NO')" +p02646,s861034699,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t =int(input()) + +s = abs(b-a) +y = (v-w) + +if y <= 0: + print('NO') +else: + m = s % y + u = s //y + if m == 0 and u <= t: + print('YES') + else: + print('NO') " +p02646,s269107425,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +a_dis = t*v +b_dis = abs(a-b) + t*w + +if a_dis > b_dis: + print(""YES"") +else: + print(""NO"")" +p02646,s938710082,Wrong Answer,"#鬼 +a,v=map(int,input().split()) + +#逃げている +b,w=map(int,input().split()) + +#t秒以内 +t=int(input()) + +if v==w: + print(""NO"") + exit() + +from fractions import gcd +g=gcd(v,w) +v=v//g +w=w//g + +if (b-a)%(v-w)!=0: + print(""NO"") + exit() + + + +if (b-a)/(v-w)<=t*g and (b-a)/(v-w)>0: + print(""YES"") +else: + print(""NO"") +" +p02646,s089499545,Wrong Answer,"A,V =map(int,input().split()) +B,W =map(int,input().split()) +T =int(input()) +D =[] + +A1 = V * T + A +B1 = W * T + B +if A1 < B1: + print(""NO"") + +else: + for i in range(T): + A = A + V + B = B + W + + if A == B: + D.append(1) + break + + #print(D) + + if len(D) >= 1: + print(""YES"") + + else: + print(""NO"") +" +p02646,s873144476,Wrong Answer,"def main(): + a,v=map(int,input().split()) + b,w=map(int,input().split()) + t=int(input()) + distance=abs(a-b) if a>=b else abs(b-a) + ve=v-w + if ve<=0: + print(""NO"") + return + if distance<=ve*t: + print(""YES"") + return + + + +main()" +p02646,s954571267,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +flag = False + +if a<=b and v <= w: + print('No') +else: + for i in range(t): + a += v + b += w + if a == b: + print('YES') + flag = True + break + if flag is False: + print('No') + " +p02646,s598328875,Wrong Answer,"point_a, speed_a = map(int, input().split()) +point_b, speed_b = map(int, input().split()) +time = int(input()) + +point_a += speed_a * time +point_b += speed_b * time + +if point_a >= point_b: + print(""YES"") +else: + print(""NO"")" +p02646,s888525767,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) + +if A+V*T>=B+W*T: + print('YES') +else: + print('NO')" +p02646,s554687951,Wrong Answer,"import sys + +la = list(map(int, input().split())) +lb = list(map(int, input().split())) +t = int(input()) + + +dis = 0 +if la[0] >= 0 and lb[0] >= 0: + dis = abs(la[0] - lb[0]) +elif la[0] <= 0 and lb[0] <= 0: + dis = abs(la[0] - lb[0]) +else: + dis = abs(la[0])+abs(la[0]) + +if la[1] - lb[1] > 0: + if dis / (la[1] - lb[1]) <= t: + print(""YES"") + sys.exit() +print(""NO"") +" +p02646,s811350895,Wrong Answer,"A, V = [int(n) for n in input().split()] +B, W = [int(n) for n in input().split()] +T = int(input()) + +if V <= W: + print('NO') + exit() + +d = abs(A - B) + +if V > W & d <= (V - W) * T: + print('YES') +else: + print('NO') +" +p02646,s156773248,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if abs(A - B) <= (W - V)*T: + print('YES') +else: + print('NO')" +p02646,s108068987,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +if a==b: + print(""YES"") +else: + if w>=v: + print(""NO"") + else: + if abs(a-b)%(v-w)==0 and abs(a-b)//(v-w)<=t: + print(""YES"") + else: + print(""NO"")" +p02646,s124493920,Wrong Answer,"a,v =map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if a+v*t >= b+w*t: + print(""YES"") +else: + print(""NO"")" +p02646,s611516733,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +d = B - A +s = (V - W) * T + +if d <= s: + print(""YES"") +else: + print(""NO"")" +p02646,s868239685,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if (w - v) * t > abs(b - a) or b == a: + print('YES') +else: + print('NO') + " +p02646,s303185421,Wrong Answer,"[a, v] = raw_input().split() +[b, w] = raw_input().split() +t = int(raw_input()) +if int(a) < int(b): + if int(a) + int(v) * t >= int(b) + int(w) * t: + print 'YES' + else: + print 'NO' +else: + if int(a) - int(v) * t >= int(b) - int(w) * t: + print 'YES' + else: + print 'NO' +" +p02646,s724454570,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +s=int(input()) +if(((b*w)-(a*v))>(a*v)): + print(""NO"") +else: + print(""YES"")" +p02646,s523461428,Wrong Answer,"(A, V) = map(lambda a: float(a), input().split()) +(B, W) = map(lambda a: float(a), input().split()) +T = float(input()) + +D = abs(A - B) +X = abs(V - W) + +if (X*T >= D): + print(""YES"") +else: + print(""NO"") + +" +p02646,s439955839,Wrong Answer," +import sys +reader = (s.rstrip() for s in sys.stdin) +input = reader.__next__ +# do magic here +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +distA = v*t +distB = w*t + +if a < b: + if a+distA >= b+distB: + print(""YES"") + else: + print(""NO"") +else: + if a-distB >= b-distB: + print(""YES"") + else: + print(""NO"")" +p02646,s459672060,Wrong Answer,"A, V = map(int, input().split()) +B, W= map(int, input().split()) +T = int(input()) + + +diff1 = abs(B - A) +diff2 = (V - W)*T + +if ( diff1 < diff2): + print(""YES"") +else: + print(""NO"") + +" +p02646,s532643549,Wrong Answer,"A,V = [int(x) for x in input().split()] +B,W = [int(x) for x in input().split()] +T = int(input()) +D = abs(A-B) +S = V-W +if S==0 and D == 0: + print('Yes') +elif S>0 and D/S <= T: + print('Yes') +else: + print('No')" +p02646,s169642611,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +for t in range(T+1): + if A+V*t == B+W*t: + print(""YES"") + break + elif t==T: + print(""NO"")" +p02646,s637157748,Wrong Answer,"import sys +input = sys.stdin.readline + +a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) + +a = abs(a) + abs(v) * t +b = abs(b) + abs(w) * t +if a >= b : + print(""YES"") +else: + print(""NO"")" +p02646,s342009640,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +speed = V - W +length = B - A + +if speed <= 0: + print('NO') + exit() + +if length / speed <= T: + print('Yes') +else: + print(""No"") +" +p02646,s271644161,Wrong Answer,"a,v=map(int,input().split())#鬼 +b,w=map(int,input().split()) +t=int(input()) + +if w>=v: + print(""No"") +else:#v>w + dif=v-w + if dif*t>=abs(a-b): + print(""YES"") + else: + print(""NO"") +" +p02646,s053465188,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if T >= 1000000000: + print('YES')" +p02646,s134164502,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if (v-w)*t >= b-a: + print('Yes') +else: + print('No')" +p02646,s811190549,Wrong Answer,"def tag(a,b,v,w,t): + return ""NO"" + +if __name__ == ""__main__"": + a,v = map(int,input().split()) + b,w = map(int,input().split()) + t = int(input()) + print(tag(a,b,v,w,t))" +p02646,s969076034,Wrong Answer,"# -*- coding: utf-8 -*- +"""""" +Created on Sat Jun 13 20:58:10 2020 + +@author: sd18016 +"""""" + +import sys + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +kyori = abs(B-A) +if V <= W: + print(""NO"") + sys.exit() +else: + miji = V - W + if kyori % miji == 0: + a = kyori // miji + if a <= T: + print(""YES"") + else: + print(""NO"") + else: + print(""NO"") + +" +p02646,s646837300,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if W==V: + print(""No"") +else: + tmp = (B-A)/(V-W) + if tmp >= 0 and tmp%1==0 and tmp <= T: + print(""YES"") + else: + print(""NO"")" +p02646,s302097522,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +flag = False +for t in range(T+1): + if B+W*T==A+V*T: + flag = True +if flag: + print(""YES"") +else: + print(""NO"")" +p02646,s007915163,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +ans=0 +for i in range(1,t+1): + if a + v * i == b + w * i: + ans='YES' + break + else: + ans='NO' +print(ans)" +p02646,s509542285,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if a < b: + c = b - a + d = (v - w) * t + if a <= d: + print('YES') + else: + print('NO') +else: + c = a - b + d = (v - w) * t + if a >= d: + print('YES') + else: + print('NO') +" +p02646,s864234763,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if(V-W > 0): + if(abs(A-B)//(V-W) <= T): + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s332354721,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if V>W: + print(""YES"") +elif V==W and A==B: + print(""YES"") +elif V==W and A!=B: + print(""NO"") +elif V= B+T*W and A B+T*W and A>B: + print('NO') + exit() +else: + print('NO') + exit()" +p02646,s383022614,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +pos_oni = A + V * T +pos_nige = B + W * T + +if pos_nige <= pos_oni: + print(""YES"") +else: + print(""NO"")" +p02646,s792796107,Wrong Answer,"a, v = input().split("" "") +b, w = input().split("" "") +t = int(input()) +if a == b: + print(""YES"") +elif a < b: + if int(a) + int(v) * t < int(b) + int(w) * t: + print(""NO"") + else: + print(""YES"") +else: + if int(a) - int(v) * t > int(b) - int(w) * t: + print(""NO"") + else: + print(""YES"") +" +p02646,s847164212,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +time=[i for i in range(T+1)] +x=0 + +for i in time: + if A==B: + x=1 + break + A=A+V + B=B+W + +if x==1: + print(""YES"") +else: + print(""NO"") + + " +p02646,s260964133,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +def func1(A,V,B,W,T): + check=0 + for i in range(T): + if B>A: + B=B+W + A=A+V + else: + B=B-W + A=A-V + if A==B: + check=1 + break + if check==1: + print(""YES"") + else: + print(""NO"") +func1(A,V,B,W,T)" +p02646,s484070057,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +c = 1 +if a > b: + c = -1 + +if (c == 1 and a + c*v*t >= b + c*w*t) or (c == -1 and a + c*v*t <= b + c*w*t): + print(""Yes"") +else: + print(""No"")" +p02646,s701034334,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V<=W: + print(""NO"") + import sys + sys.exit() + +# import math +# if abs(B-A)/(V-W) <= T: +# print(""YES"") +# else: +# print(""NO"") + +# print(""t="",t) +# print(""A+Vt="", A+V*t) +# print(""B+Wt="", B+W*t) + +t = (B-A)//(V-W) +if A+V*t >= B+W*t: + if 1 <= t and t <= T: + print(""YES"") + else: + print(""NO"") +else: + print(""NO"")" +p02646,s074057919,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() +elif a >= b: + print('YES') + exit() + +oni = a + (v*t) +child = b + (w*t) + +if oni >= child: + print('YES') +else: + print('NO') +" +p02646,s470302089,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if B==A: + print(""YES"") +elif W == V: + print(""NO"") +elif (B-A)%(V-W) == 0 and B>A and V>W and (B-A)//(V-W) <=T: + print(""YES"") +else: + print(""NO"")" +p02646,s927381738,Wrong Answer,"from collections import defaultdict,deque +from sys import stdin,setrecursionlimit +import heapq,bisect,math,itertools,string,queue,datetime,copy +setrecursionlimit(10**8) +INF = float('inf') +mod = 10**9+7 +eps = 10**-7 +def inpl(): return list(map(int, stdin.readline().split())) + +a,v = inpl() +b,w = inpl() +t = int(input()) + +if a+v*t >= b+w*t: + print('YES') +else: + print('NO') +" +p02646,s648634523,Wrong Answer,"a,v = map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +x=b-a +y=v-w + +if y*t>=x: + print(""YES"") +else: + print(""NO"")" +p02646,s484325886,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if W>=V: + print('No') +else: + key=abs(A-B) + if key+W*T>V*T: + print('No') + else: + print('Yes')" +p02646,s301886788,Wrong Answer,"[a,v] = [int(i) for i in input().split()] +[b,w] = [int(i) for i in input().split()] +t = int(input()) +if w >= v: + print(""NO"") +else: + if abs(a-b)/(w-v) <= t: + print(""YES"") + else: + print(""NO"") +" +p02646,s542757648,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V-W <= 0: + print(""NO"") +elif B-A <= 0: + print(""NO"") +else: + if ((B-A)/(V-W)) <= T: + q, mod= divmod(B-A, V-W) + if mod == 0: + print(""YES"") + else: + print(""NO"") + else: + print(""NO"")" +p02646,s760615159,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if A > B: + result = ""YES"" +else: + if V - W > 0: + if B - A - T * (V - W) <= 0: + result = ""YES"" + elif B - A - T * (V - W) > 0: + result = ""NO"" + else: + result = ""NO"" +print(result)" +p02646,s282584711,Wrong Answer,"import sys + +a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) + +for i in range(1,t+1): + if a+i*v==b+i*w: + print(""YES"") + sys.exit() + +print(""NO"") +" +p02646,s110442523,Wrong Answer,"import math + +def a(): + s = input() + print(s[:3]) + + +def b(): + a, v = map(int, input().split()) + b, w = map(int, input().split()) + t = int(input()) + if v > w: + print('YES') + else: + print('NO') + + +def c(): + print('') + + + +def d(): + print('') + + +b()" +p02646,s346221176,Wrong Answer,"N,S = map(int,input().split()) +n,s = map(int,input().split()) +T = int(input()) + +ans1 = N + S*T +ans2 = n + s*T + +if n < N: + print(""NO"") +elif ans1 >= ans2: + print(""YES"") +else: + print(""NO"")" +p02646,s518288022,Wrong Answer,"import sys + +a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if w >= v: + print(""NO"") + sys.exit() + +d = abs(b-a) +if (v-w)*t >= d and d%(v-w) == 0: + print(""YES"") + sys.exit() +print(""NO"") +" +p02646,s926774231,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +ans = ""No"" + +move = v*t - w*t +distance = abs(b - a) + +if move > 0 and move >= distance: + ans = ""YES"" + +print(ans)" +p02646,s881262843,Wrong Answer,"s,t = map(int,input().split()) +m,n = map(int,input().split()) +k = int(input()) +if((k*t) == (k*n+m)): + print('Yes') +else: + print('No')" +p02646,s986026249,Wrong Answer,"A, V = map(int,input().split()) +B, W = map(int,input().split()) +T = int(input()) +if A + V * T >= B + W * T: + print('YES') +else: + print('NO')" +p02646,s954151563,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +X = B-A +Y = V-W + +if Y == 0 or X%Y != 0: + print('NO') +else: + if Y*T >= X: + print('YES') + else: + print('NO')" +p02646,s940830334,Wrong Answer,"a, v = map(int, input().split()) +b,w = map(int, input().split()) +t = int(input()) + +a = a + t*v +b = b + t*w + +if a >= b: + print('YES') +else: + print('NO')" +p02646,s043914553,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T=int(input()) + +if T*(V-W) >= B-A: + print('YES') +else: + print('NO')" +p02646,s923993491,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +z=(v*t)+a +y=(w*t)+b +if z-y>=0: + print(""YES"") +else: + print(""NO"")" +p02646,s245926563,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if (V > W): + if (-(V-W)*T <= A - B <= (V-W)*T): + print(""YES"") +else: + print(""NO"") +" +p02646,s535133932,Wrong Answer,"a,v=input().split() +b,w=input().split() +t=int(input()) +a=int(a) +v=int(v) +b=int(b) +w=int(w) + +l=b-a +k=v-w +if w A: + Dis = B - A + VtoW = V - W +else: + Dis = A - B + VtoW = W - V + +result = VtoW * T + +if Dis <= result: + print('YES') +else: + print('NO')" +p02646,s154165651,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a >=0 and b>=0 : + if a+v*t >= b+ w*t: + print(""YES"") + else: + print(""NO"") +elif a < 0 and b >= 0 : + if -a+v*t >= b + w*t: + print(""YES"") + else : + print(""NO"") +else : + if a+v*t>=b+w*t: + print(""YES"") + else : + print(""NO"")" +p02646,s364276475,Wrong Answer,"line1 = input().split() +a = int(line1[0]) +a_move = int(line1[1]) + +line2 = input().split() +b = int(line2[0]) +b_move = int(line2[1]) + +time = int(input()) + +for count in range(time): + a += a_move + b += b_move + if (a == b): + print(""YES"") + break + elif (count == time - 1): + print(""NO"") +" +p02646,s607748493,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) +if A == B: + print(""YES"") + +elif A < B: + if V <= W: + print(""NO"") + else: + if abs(A - B)/(W-V) <= T: + print(""YES"") + else: + print(""NO"") + +elif B < A: + if W <= V: + print(""NO"") + else: + if abs(A - B)/(V-W) <= T: + print(""YES"") + else: + print(""NO"") +" +p02646,s420972792,Wrong Answer,"a = input().split("" "") +b = input().split("" "") +c = int(input()) +l = int(a[0]) +r = int(a[1]) +k = int(b[0]) +s = int(b[1]) +if ((r * c) + l) > ((s * c) + k) : + print(""YES"") +else: + print(""NO"") +" +p02646,s071145189,Wrong Answer,"a,v=map(int,input().split()) +b,w=map(int,input().split()) +t=int(input()) +x1=a+t*v +y1=b+t*w +if(x1>=y1 or a+v>=(b+w)): + print('YES') +else: + print(""NO"")" +p02646,s179704241,Wrong Answer,"A, V = map(int, input().split()) # oni +B, W = map(int, input().split()) # nige +T = int(input()) + +pos_oni = A + V * T +pos_nige = B + W * T + +if A == B: + print(""YES"") +elif A < B: + if pos_nige <= pos_oni: + print(""YES"") + else: + print(""NO"") +elif B < A: + if pos_oni <= pos_nige: + print(""YES"") + else: + print(""NO"")" +p02646,s039867107,Wrong Answer,"from sys import stdin +rs = lambda : stdin.readline().strip() +ri = lambda : int(rs()) +ril = lambda : list(map(int, rs().split())) + +def main(): + A, V = ril() + B, W = ril() + T = ri() + print('Yes' if abs(A - B) <= T * (V - W) else 'No') + +if __name__ == '__main__': + main() +" +p02646,s478313202,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v < w: + print('NO') + exit() + +if abs(abs(a)-abs(b)) <= (v-w)*t: + print('YES') +else: + print('NO')" +p02646,s160960629,Wrong Answer,"a = input().split() +b = input().split() +c = input() + +if(int(b[1])>=int(a[1])): + print(""NO"") +else: + length = int(a[0]) - int(b[0]) + v = int(a[1]) - int(b[1]) + times = length / v + if(times <= int(c)): + print(""YES"") + else: + print(""NO"")" +p02646,s580345335,Wrong Answer,"# B - Tag + +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +ans = 'NO' +dist = abs(A - B) +diff = V - W +for i in range(T): + if dist == 0: + ans = 'YES' + break + else: + dist -= diff + +print(ans) + +" +p02646,s364367297,Wrong Answer,"AV = list(map(int,input().split())) +BW = list(map(int,input().split())) +T = int(input()) + +A = AV[0] +V = AV[1] +B = BW[0] +W = BW[1] + +pos_A = A +pos_B = B + +if A <= B: + pos_B = B + T*W + pos_A = A + T*V +else: + pos_B = B - T*W + pos_A = A - T*V + + +if abs(pos_A) >= abs(pos_B): + print('Yes') +else: + print('No')" +p02646,s762956910,Wrong Answer,"def calc(oniend, kid , pase): + if (pase <= 0) or ((oniend * pase) < kid): + return ""NO"" + #elif ((oniend - kid) % pase) == 0: + else: + return ""YES"" + +in1 = input().split() +in2 = input().split() +in3 = input() +oni = int(in1[0]) +onispeed = int(in1[1]) +kid = int(in2[0]) +kidspeed = int(in2[1]) +time = int(in3) + +pase = onispeed - kidspeed +oniend = (pase * time) + oni + +if (pase <= 0) or (oniend < kid): + print(""NO"") +elif ((oniend - kid) % pase) == 0: + print(""YES"") +else: + print(""NO"") + +" +p02646,s102480967,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + + +if v>=w: + if b-a<=(v-w)*t: + print('YES') + exit() +print('NO') +" +p02646,s209655137,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if (v - w) * t >= (b - a): + print('YES') +else: + print('NO') +" +p02646,s202169725,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) +a = a + v * t +b = b + w * t +if a >= b : + print(""YES"") +else: + print(""NO"")" +p02646,s844358770,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if abs(a-b) <= t* abs(v-w): + print('YES') +else: + print('NO')" +p02646,s868603448,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +dis = abs(A-B) +mob = W-V + +if A == B: + print(""Yes"") +else: + if mob >= 0: + print(""No"") + else: + if dis % mob != 0: + print(""No"") + else: + if dis + (mob*(T+1)) <= 0: + print(""Yes"") + else: + print(""No"") +" +p02646,s527305982,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T=int(input()) +if A==B: + print(""YES"") +elif V<=W: + print(""NO"") +elif (B-A)/(V-W) <= T: + print(""YES"") +else: + print(""NO"")" +p02646,s515987043,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if v < w: + print('NO') + exit() + +if abs(abs(a)-abs(b)) < (v-w)*t: + print('YES') +else: + print('NO')" +p02646,s060088210,Wrong Answer,"A,V = [int(v) for v in input().split()] +B,W = [int(v) for v in input().split()] +T = int(input()) + +A += int(1e9) +B += int(1e9) + +if A < B: + if V * T + A >= W * T + B: + print(""YES"") + else: + print(""NO"") +elif A > B: + if V * T + A <= W * T + B: + print(""YES"") + else: + print(""NO"") +else: + print(""YES"") +" +p02646,s439210223,Wrong Answer," +a_par = list(map(int, input().rsplit())) +b_par = list(map(int, input().rsplit())) +sec = int(input()) + +num = 0 + +for i in range(sec): + if a_par[0] + a_par[1] * i == b_par[0] + b_par[1] * i: + num += 1 + +if num > 0: + print(""YES"") +else: + print(""NO"")" +p02646,s688834408,Wrong Answer,"A, S_A = map(int, input().split(' ')) +B, S_B = map(int, input().split(' ')) +T = int(input()) + +distance = B - A + +is_catchable = (S_A - S_B) * T > distance +if is_catchable: + print('YES') +else: + print('NO') + + +" +p02646,s120928919,Wrong Answer,"a, v = list(map(int, input("""").split())) +b, w = list(map(int, input("""").split())) +t = int(input("""")) + +gaki1 = a + v * t +gaki2 = b + w * t + + +if b > a: + if gaki1 >= gaki2: + print(""YES"") + else: + print(""NO"") +else: + if gaki2 >= gaki1: + print(""YES"") + else: + print(""NO"")" +p02646,s700151317,Wrong Answer,"A,V=map(int,input().split()) +B,W=map(int,input().split()) +T=int(input()) +if V<=W: + print(""NO"") +else: + distance = abs(A-B) + time = distance/V-W + if T>=time: + print(""YES"") + else: + print(""NO"")" +p02646,s601661738,Wrong Answer,"A,V = list(map(int,input().split())) +B,W = list(map(int,input().split())) +T = int(input()) + +kyori = B-A +s = V-W +if kyori <= s*T: + print('YES') +else: + print('NO')" +p02646,s741715792,Wrong Answer,"a,v=map(int, input().split()) +b,w=map(int, input().split()) +t=int(input()) + +n=b-a +if n+((w-v)*(t+1))<=0: + print('YES') +else: + print('NO')" +p02646,s633948238,Wrong Answer,"(A, V) = map(lambda a: int(a), input().split()) +(B, W) = map(lambda a: int(a), input().split()) +T = int(input()) + +D = abs(A - B) +X = abs(V - W) + +if (X*T >= D): + print(""OK"") +else: + print(""NG"") + +" +p02646,s447787478,Wrong Answer,"a, v = list(map(int,input().strip().split())) +b, w = list(map(int,input().strip().split())) +t = int(input()) + +if w - v >= 0: + print(""NO"") +else: + time = abs(a-b)/(v-w) + if t <= time: + print(""YES"") + else: + print(""NO"")" +p02646,s121630458,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) + +T = int(input()) + +flag = False +if A < B: + cnt = 0 + while cnt < T: + A+=V + B+=W + if A > B: + flag=True + break + cnt+=1 + +else: + cnt=0 + while cnt < T: + A-=V + B-=W + if A=deltaD: + return 'YES' + else: + return 'NO' + return 'NO' +print(check())" +p02646,s393226931,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if V > W: + if T >= (B - A) % (V - W): + print('YES') +else: + print('NO')" +p02646,s626815400,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if a-b <= t*(v-w): + print('YES') +else: + print('NO')" +p02646,s772370938,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if b >= a: + if (b-a) < (v-w)*t: + print(""YES"") + else: + print(""NO"") +else: + if b-w*t <= 0: + print(""YES"") + else: + print(""NO"")" +p02646,s263811727,Wrong Answer,"def main(): + A, V = map(int, input().split()) + B, W = map(int, input().split()) + T = int(input()) + + if A + (V*T) < B + (W*T): + print('NO') + return + print('YES') +main()" +p02646,s011415761,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if ((b + w * t) + 1000000000) - ((a + v * t) + 1000000000) <= 0: + print (""YES"") +else: + print (""NO"")" +p02646,s526270772,Wrong Answer,"la = list(map(int, input().split())) +lb = list(map(int, input().split())) +t = int(input()) + + +dis = lb[0] - la[0] +a = la[1]*t +b = lb[1]*t +speed = (b-a) + +if b-a >= 0: + print(""NO"") +else: + if dis / (a-b) <= t: + print(""YES"") + else: + print(""NO"") +" +p02646,s370803951,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +x = a+v*t +y = b+w*t +if x < y: + print('NO') +else: + print('YES')" +p02646,s952084488,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if (b-a) <= (v-w)*t: + print(""YES"") +else: + print(""NO"")" +p02646,s614754808,Wrong Answer,"import sys +A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) + +if A < B and V <= W: + print('NO') + sys.exit() +elif B < A and W <= V: + print('NO') + sys.exit() + +ans = (B-A)/(V-W) + +if ans <= T: + print('YES') +elif ans > T: + print('NO') +" +p02646,s073534600,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T = int(input()) +if V == W: + print(""NO"") +else: + if abs(B - A) // (V - W) > 0 and abs(B - A) // (V - W) <= T: + print(""YES"") + elif B + W * T >= 10 ** 9 or B - W * T <= -1 * (10 ** 9): + print(""YES"") + else: + print(""NO"") +" +p02646,s600404350,Wrong Answer,"a, v = map(int,input().split()) +b, w = map(int,input().split()) +t = int(input()) + + +if abs(a-b) <= (v- w)*t: + print('YES') +else: + print('No')" +p02646,s337425850,Wrong Answer,"a,w=map(int,input().split()) +b,v=map(int,input().split()) +t=int(input()) +if(((w*t)+a)>=((t*v)+b)): + print(""YES"") +else: + print(""NO"") " +p02646,s156617025,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() + +if a > b: + d1 = a + v * t + d2 = b + w * t + if d1 < d2: + print('NO') + exit() +else: + d1 = a - v * t + d2 = b - w * t + if d1 > d2: + print('NO') + exit() + +print('YES') +" +p02646,s283052081,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t=int(input()) +c=a-b +g=v-w +if g<=0: + print(""NO"") + exit() +if c%g==0 and abs(c)<=g*t: + print(""YES"") +else: + print(""NO"")" +p02646,s083127917,Wrong Answer,"a, v = list(map(int,input().split())) +b, w = list(map(int,input().split())) + +distance = abs(a-b) +speed = v - w + +if speed <= 0: + print('NO') + exit() + +if distance % speed == 0: + print('YES') +else: + print('NO')" +p02646,s851636961,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +l = a+v*t +r = b+w*t +if l >= r: + print(""YES"") +else: + print(""NO"")" +p02646,s988408069,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if abs(b - a) - t * abs(w - v) > 0: + print(""NO"") +else: + print(""YES"")" +p02646,s741440043,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +# if (v-w)*t>=(b-a):print(""YES"") +# else:print(""NO"") + +if a=0:print(""YES"") + else:print(""NO"") +else: + if (b-a)+(w-v)*t>=0:print(""YES"") + else:print(""NO"")" +p02646,s996307761,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) + +flag = False + +for i in range(1, t + 1): + at = a + v * i + bt = b + w*i + if at == b: + flag = True + break +if flag: + print(""YES"") +else: + print(""NO"") +" +p02646,s392896962,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) +if a>b: + a,b = b,a + v,w = w,v +if v<=w: + print('NO') +elif (b-a)/(v-w)<=t and (b-a)/(v-w)==(b-a)//(v-w): + print('YES') +else: + print('NO')" +p02646,s586054461,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if w >= v: + print('NO') + exit() +ans = (b-a) / (t*(w-v)) +if ans <= 0: + print('YES') +else: + print('NO')" +p02646,s263410257,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +if v <= w: + print('NO') + exit() +elif a > b: + print('YES') + exit() + +oni = a + (v*t) +child = b + (w*t) + +if (a < b) and (oni < child): + print('NO') +elif (a > b) and (oni < child): + print('YES') +elif oni >= child: + print('YES') +else: + print('NO') +" +p02646,s979715541,Wrong Answer,"A, V = map(int, input().split()) +B, W = map(int, input().split()) +T=int(input()) + +if W >= V: + print('NO') + exit() + +if T*(V-W) >= B-A: + print('YES') +else: + print('NO')" +p02646,s628147703,Wrong Answer,"a,v = map(int,input().split()) +b,w = map(int,input().split()) +t = int(input()) + +a = a+v*t +b = b+w*t + +if a >= b: + print(""YES"") + +else: + print(""NO"")" +p02646,s695282726,Wrong Answer,"A,V = map(int,input().split()) +B,W = map(int,input().split()) +T = int(input()) + +if V-W == 0: + print(""NO"") +elif abs(B-A)/(V-W) <= T: + print(""YES"") +else: + print(""NO"")" +p02646,s834499942,Wrong Answer,"A,V = list(map(int, input().split())) +B, W = list(map(int, input().split())) +T = int(input()) + + +if A < B: + if (A + V*T) >= (B + W*T): + print(""YES"") + else: + print(""NO"")" +p02646,s736320248,Wrong Answer,"a, v = map(int, input().split()) +b, w = map(int, input().split()) +t = int(input()) +if v <= w: + print('No') + exit(0) + +if abs(a-b)%(v-w) == 0: + f = abs(a-b)//(v-w) + if f <= t: + print('Yes') + exit(0) +print('No')" +p02759,s295361701,Accepted,"import math +n=int(input()) +print(math.ceil(n/2))" +p02759,s596984784,Accepted,"def main(): + hoge = int(input()) + print(-(-hoge // 2)) + +if __name__ == '__main__': + main()" +p02759,s534323900,Accepted,print(-(-int(input())//2)) +p02759,s927987229,Accepted,"N = int(input()) +if N%2 == 0: + print(N//2) +else: + print(N//2 + 1) + + +" +p02759,s630211237,Accepted,print((int(input())+1)//2) +p02759,s886487890,Accepted,"N = int(input()) +print((N+1)//2)" +p02759,s594871729,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N//2) +else: + print(N//2 + 1)" +p02759,s641586989,Accepted,"N = int(input()) +if N % 2 == 0: + print(N//2) +else: + print(N//2+1) +" +p02759,s287454342,Accepted,"a=int(input()) +if a%2==0: + print(int(a/2)) +else: + print(int((a+1)/2))" +p02759,s393136319,Accepted,print((int(input())+1)//2) +p02759,s486569457,Accepted,"import math +N = int(input()) +O = N // 2 + N % 2 +print(O)" +p02759,s059820041,Accepted,"def main(): + N = int(input()) + print(-(-N // 2)) + return + + +main() +" +p02759,s000129629,Accepted,"# ANSHUL GAUTAM +# IIIT-D + +from math import * +from copy import * +from string import * # alpha = ascii_lowercase +from random import * # l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference +from sys import stdin +from sys import maxsize +from operator import * # d = sorted(d.items(), key=itemgetter(1)) +from itertools import * +from collections import Counter # d = dict(Counter(l)) +from collections import defaultdict # d = defaultdict(list) + +''' + +''' + +def solve(l): + n = len(l) + + +N = int(stdin.readline()) +print(ceil(N/2)) +" +p02759,s630374854,Accepted,"x = int(input()) +print((x+1)//2)" +p02759,s338982047,Accepted,"n = int(input()) +print(int(n/2)+n%2)" +p02759,s122071568,Accepted,"a = int(input()) +b = int(a / 2) +c = int((a + 1) / 2) + +if a % 2 == 0: + print(b) +else: + print(c) +" +p02759,s373273683,Accepted,"n = int(input()) +if n % 2 == 0: + print(n // 2) +else: + print((n // 2) + 1)" +p02759,s477510219,Accepted,"import math +N = int(input()) + +print(math.ceil(N / 2))" +p02759,s032095116,Accepted,"N = int(input()) +# N, X = [int(i) for i in input().split()] + +if N%2: + print(N//2 + 1) +else: + print(N//2) +" +p02759,s550896459,Accepted,"n=int(input()) +print((n+n%2)//2)" +p02759,s949637710,Accepted,"N=int(input()) +a=N%2 +if a == 0: + print(int(N/2)) +else: + print(int((N+1)/2))" +p02759,s146247565,Accepted,"s=int(input()) +if s%2==0: + print(s//2) +else: + print(s//2+1)" +p02759,s897893778,Accepted,"n=int(input()) +print((n-1)//2+1)" +p02759,s981880218,Accepted,print((int(input())+1) // 2) +p02759,s523282952,Accepted,"n = int(input()) + +if n %2 : + print(n//2+1) +else: + print(n//2)" +p02759,s581267755,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N //2) +else: + print(N // 2 + 1) +" +p02759,s258886684,Accepted,print((int(input()) + 1)//2) +p02759,s751892454,Accepted,"N=int(input()) +N = N+ (N%2) +N/=2 +N=int(N) +print(N)" +p02759,s075538369,Accepted,"a = int(input()) +if a%2 == 0: + print(a//2) +else: + print(a//2+1)" +p02759,s185314842,Accepted,"a=int(input()) +if a%2==0: + print(a//2) +else: + print((a//2)+1) +" +p02759,s420780433,Accepted,"n = int(input()) + +if n%2 == 0: + print(n//2) +else: + print(n//2 + 1)" +p02759,s265120193,Accepted,"import math + + +def main(): + + N = int(input()) + + N = math.ceil(N / 2) + + print(N) + + +if __name__ == ""__main__"": + main() +" +p02759,s533956969,Accepted,"N = int(input()) +print(-(-N//2))" +p02759,s691989949,Accepted,"n=int(input()) +if n%2==0: + print(int(n/2)) +elif n%2==1: + print(int((n+1)/2)) +" +p02759,s398456294,Accepted,"N = int(input()) + +print((N+1) // 2) +" +p02759,s296047706,Accepted,"n=int(input()) +if n % 2 ==0: + print(n//2) +else: + print(n//2+1)" +p02759,s072367423,Accepted,"a=int(input()) +ans=0 +if a % 2 ==1: + ans=round((a+1)/2) +else: + ans=round(a/2) +print(ans)" +p02759,s422099677,Accepted,"import math + +pages = int(input()) +print(math.ceil(pages/2))" +p02759,s661221890,Accepted,"N=int(input()) +if N/2.0>int(N/2.0): + print(int(N/2.0)+1) +else: print(int((N/2.0)))" +p02759,s955531554,Accepted,"N = int(input()) + +print((N+1)//2)" +p02759,s541562131,Accepted,"N = int(input()) +print( -(-N // 2))" +p02759,s453117686,Accepted,"n = int(input()) + +print(n//2 + n%2) +" +p02759,s607335261,Accepted,"n = int(input()) + +print(n // 2 + n % 2)" +p02759,s426613885,Accepted,"N = int(input()) +print(-(-N//2)) +" +p02759,s461324751,Accepted,"x = int(input()) +if x%2 != 1: + print(x//2) +else: + print(x//2+1)" +p02759,s136515811,Accepted,"def main(): + n = int(input()) + result = 0 + while True: + if n > 0: + n = n - 2 + result += 1 + else: + break + print(result) + + +if __name__ == ""__main__"": + main() +" +p02759,s391627901,Accepted,"n=int(input()) +q,mod=divmod(n,2) + +print(q+mod)" +p02759,s371334993,Accepted,"N = int(input()) +if N % 2 == 0: + print(int(N / 2)) +else: + print(int(N / 2) + 1) + " +p02759,s038557327,Accepted,"import math +n = int(input()) +print(math.ceil(n/2)) +" +p02759,s769351393,Accepted,"n = int(input()) +print(((n % 2 == 0) and (n // 2)) or (n // 2 + 1))" +p02759,s043455514,Accepted," +a = int(input()) +print(a//2+(a%2!=0))" +p02759,s371139329,Accepted,"import math + +N = int(input()) +print(math.ceil(N / 2))" +p02759,s721302115,Accepted,"N = int(input()) +div, mod = divmod(N, 2) + +if mod > 0: + div = div + 1 + +print(div) +" +p02759,s949003050,Accepted,"N = int(input()) + +q = N //2 +r = N % 2 +print(q + r) +" +p02759,s419575020,Accepted,"def main(): + import sys + input = sys.stdin.readline + N = int(input()) + if N % 2 == 1: + print(N//2+1) + else: + print(int(N/2)) + +if __name__ == ""__main__"": + main()" +p02759,s224526049,Accepted,"N = int(input()) +amari = N % 2 +count = int( N // 2 ) +print( count + amari ) +" +p02759,s630910373,Accepted,"N = int(input()) +if N % 2 == 0: + ans = N//2 +else: + ans = N//2 + 1 +print(ans)" +p02759,s662578919,Accepted,"n=int(input()) +if n%2: + print(n//2 + 1) +else: + print(n//2)" +p02759,s696629268,Accepted,"import math + +a=int(input()) +s=a/2 +print(math.ceil(s)) +" +p02759,s695824101,Accepted,"n=int(input()) +print(""{}"".format((n+1)//2))" +p02759,s574820765,Accepted,"n = int(input()) +print(n//2+n%2)" +p02759,s997413813,Accepted,"n = int(input()) +if n%2 == 0: + print (n//2) +if n%2 == 1: + print ((n+1)//2)" +p02759,s987659712,Accepted,"n = int(input()) +print((n+1)//2)" +p02759,s625873095,Accepted,"import math + +if __name__ == ""__main__"": + N = int(input()) + ret = math .floor(N / 2) + if N % 2 == 1: + ret = ret + 1 + print(ret) +" +p02759,s328098897,Accepted,"# A - Duplex Printing + +N = int(input()) + +print((N+(2-1))//2)" +p02759,s820830980,Accepted,"#!/usr/bin/env python +from collections import deque, defaultdict +import bisect +from math import factorial + +def main(): + N = int(input()) + #Xs = list(map(int, input().split())) + + if N % 2 == 1: + N += 1 + print(N // 2) + + +if __name__ == '__main__': + main() +" +p02759,s348957810,Accepted,print(int((int(input())+1)/2)) +p02759,s801401225,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2 +1)" +p02759,s720582644,Accepted,"n = int(input()) +print((n+1) // 2) +" +p02759,s256425204,Accepted,"import math +n = int(input()) +m = math.ceil(n/2) +print(m) +" +p02759,s891575019,Accepted,"import math +print(math.ceil((int(input())/2))) +" +p02759,s139746949,Accepted,"n = int(input()) + +a = n // 2 +b = n % 2 + +print(a+b) +" +p02759,s184142929,Accepted,"# -*- coding: utf-8 -*- + +N = int(input()) + +print((N + 1) // 2) +" +p02759,s630206360,Accepted,"N=int(input()) +if N%2==0: + print(N//2) +else: + print(N//2+1) +" +p02759,s465655119,Accepted,"from math import ceil +n = int(input()) +print(ceil(n/2))" +p02759,s996520006,Accepted,"N = int(input()) +print(N // 2 + 1 if N % 2 else N // 2) +" +p02759,s182943027,Accepted,"n = int(input()) +print(n//2 + n%2)" +p02759,s022051376,Accepted,"N = input() +N = int(N) //2 + int(N)%2 +print(N)" +p02759,s053309575,Accepted,"#k = int(input()) +#s = input() +#a, b = map(int, input().split()) +#l = list(map(int, input().split())) + +n = int(input()) + +if (n % 2 != 0): + print (n//2+1) +else: + print(n//2) + +" +p02759,s879803636,Accepted,"N = int(input()) +print((N-1)//2+1)" +p02759,s179233195,Accepted,"n = int(input()) +print(-((-n)//2))" +p02759,s530078327,Accepted,"N = int(input()) +print(sum(divmod(N, 2))) +" +p02759,s937562626,Accepted,print(-(-int(input())//2)) +p02759,s156523805,Accepted,"#!/usr/bin/env python3 + +import sys +sys.setrecursionlimit(300000) + + +def solve(N: int): + ret = (N + 1) // 2 + print(ret) + return + +def main(): + def iterate_tokens(): + for line in sys.stdin: + for word in line.split(): + yield word + tokens = iterate_tokens() + N = int(next(tokens)) # type: int + solve(N) + +if __name__ == '__main__': + main() +" +p02759,s204377828,Accepted,"N = int(input()) + +print(N//2 + N%2)" +p02759,s804704546,Accepted,"n = int(input()) +ans = n//2 +if n%2==1: + ans+=1 +print(ans)" +p02759,s883834931,Accepted,"import sys +import itertools +input = sys.stdin.readline +sys.setrecursionlimit(100000) + + +def read_values(): + return map(int, input().split()) + + +def read_index(): + return map(lambda x: x - 1, map(int, input().split())) + + +def read_list(): + return list(read_values()) + + +def read_lists(N): + return [read_list() for n in range(N)] + + +def functional(N, mod): + F = [1] * (N + 1) + for i in range(N): + F[i + 1] = (i + 1) * F[i] % mod + return F + + +def main(): + N = int(input()) + print((N - 1) // 2 + 1) + + +if __name__ == ""__main__"": + main()" +p02759,s292406790,Accepted,print((int(input())+1)//2) +p02759,s608281573,Accepted,"import sys + +line = sys.stdin.readline().strip() +n = int(line) +print(n//2+n%2) + +" +p02759,s814144922,Accepted,"import math + +n = int(input()) + +print(math.ceil(n/2)) +" +p02759,s349870796,Accepted,"import math + +n = int(input()) +print(math.ceil(n/2))" +p02759,s241116785,Accepted,"# coding: utf-8 +# Your code here! +import math +N = int(input()) + +print(math.ceil(N / 2))" +p02759,s645742084,Accepted,"import math +N=int(input()) +print(math.ceil(N/2))" +p02759,s765869889,Accepted,"n = int(input()) +if n%2 == 0: + print(n//2) +else: + print((n//2)+1)" +p02759,s783775810,Accepted,"#Macで実行する時 +import sys +import os +if sys.platform==""darwin"": + base = os.path.dirname(os.path.abspath(__file__)) + name = os.path.normpath(os.path.join(base, '../atcoder/input.txt')) + sys.stdin = open(name) + +from math import ceil + +n = int(input()) + +print(ceil(n/2)) + + +" +p02759,s734356163,Accepted,"import sys +input = sys.stdin.readline +print(-(-int(input()) // 2))" +p02759,s851583586,Accepted,"N = int(input()) +print(1 + (N-1)//2)" +p02759,s970702066,Accepted,"N=int(input()) +print((N-1)//2+1) +" +p02759,s360855863,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N // 2) +else: + print(N // 2 + 1)" +p02759,s212958997,Accepted,"N = int(input()) +print((N+1)//2)" +p02759,s760814329,Accepted,"N = int(input()) + +if N % 2 == 0: + print(int(N / 2)) +else: + print(int(N/2)+1) +" +p02759,s212622565,Accepted,"i = int(input()) +result = i // 2 +if i % 2 != 0: + result = result + 1 +print (result)" +p02759,s483780969,Accepted,"import math +N = int(input()) + +print(math.ceil(N/2)) +" +p02759,s852967052,Accepted,"N = int(input()) + +if N % 2 == 0: + print(int(N / 2)) +else: + print(int((N + 1) / 2))" +p02759,s741405816,Accepted,"N=int(input()) + +print((N+1)//2)" +p02759,s318540606,Accepted,"n=int(input()) +if n%2==0: + print(int(n//2)) +else: + print(int(n//2)+1)" +p02759,s435921259,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2 + 1)" +p02759,s556739125,Accepted,"N = int(input()) +if N%2 == 0: + print(N//2) +else: + print(N//2+1)" +p02759,s897692736,Accepted,"import math + +N = int(input()) +print(math.ceil(N/2))" +p02759,s510914745,Accepted,"N=int(input()) +print(N//2 if N%2==0 else N//2+1)" +p02759,s891157861,Accepted,"import math +s = int(input()) +print(math.ceil(s / 2))" +p02759,s320249212,Accepted,"# coding: utf-8 +n = int(input()) +if n % 2 == 0: + print(int(n/2)) +else: + print(int((n+1)/2)) +" +p02759,s814585125,Accepted,"n = int(input()) +if n%2 == 1: + print((n+1)//2) +else: + print(n//2) +" +p02759,s901678012,Accepted,"N = int(input()) +print(-(-N//2))" +p02759,s722803419,Accepted,"N = int(input()) +if N % 2 == 0: + print(N//2) +else: + print((N//2)+1) + +" +p02759,s771023551,Accepted,"import math +n = int(input("""")) +print(int(math.ceil(n/2)))" +p02759,s244426032,Accepted,"ans = 0 +N = int(input()) + +if(N%2): + ans = N//2 +1 +else: + ans = N//2 +print(ans)" +p02759,s534286105,Accepted,print(-1*(-int(input())//2)) +p02759,s649672023,Accepted,"import math +n=int(input()) +print(math.ceil(n/2))" +p02759,s117027827,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s380419538,Accepted,"a = int(input()) +n = a // 2 +if 2*n == a: + print(n) +else: + print(n + 1) +" +p02759,s183652484,Accepted,"n=int(input()) + +print(-1*(-1*n//2))" +p02759,s543973654,Accepted,"import numpy as np +import math as m + +def main(**kwargs): + r = int(n / 2 + 0.5) + return r + +if __name__ == ""__main__"": + cin = np.array(input().split("" "")).astype(""int"") + n, *_ = cin + + cout = main(n=n) + print(cout)" +p02759,s318120957,Accepted,"N = int(input()) + +if N%2 == 0: + print(int(N/2)) +else: + print(int(N/2) + 1) +" +p02759,s027452683,Accepted,"N=int(input()) +if(N%2==1): + print(N//2+1) +else: + print(N//2)" +p02759,s706630089,Accepted,"N = int(input()) + +print(N // 2 + N % 2) +" +p02759,s895363987,Accepted,"n = int(input()) +if n%2 == 0: + print(n//2) +else: + print(n//2+1)" +p02759,s853963465,Accepted,"N = int(input()) +if N % 2 == 0: + print(N//2) +else: + print((N//2)+1)" +p02759,s129788067,Accepted,"import math +n=int(input()) +print(math.ceil(n/2))" +p02759,s171266270,Accepted,"n = int(input()) +print(int((n+1)/2))" +p02759,s576593313,Accepted,"import math +print(math.ceil(int(input()) / 2)) +" +p02759,s853508551,Accepted,print(0--int(input())//2) +p02759,s168885957,Accepted,"n = int(input()) +print(-(int(-n//2)))" +p02759,s631188888,Accepted,"n = input() +n = int(n) +if n % 2 == 0: + print(int(n/2)) +else: + print(int((n/2)+1)) + " +p02759,s811241890,Accepted,"import sys +import math +input = sys.stdin.readline + +#N, M, L = (int(i) for i in input().split()) +#ABC = [[int(i) for i in input().split()] for i in range(N)] +N = int(input()) + +print(math.ceil(N/2)) +" +p02759,s672938348,Accepted,"n = int(input()) +ans = -(-n // 2) +print(ans)" +p02759,s960590150,Accepted,"N = int(input()) + +ans = (N + 1) // 2 +print(ans) +" +p02759,s929322268,Accepted,"n = int(input()) +if n%2 == 0: + print(int(n/2)) +else: + print(int(n/2)+1)" +p02759,s835009993,Accepted,"import sys +import math +input = sys.stdin.readline +n=int(input()) +print(math.ceil(n/2)) + +" +p02759,s724761407,Accepted,"N = int(input()) + +if N%2 == 0: + print(N//2) +else: + print(N//2 +1)" +p02759,s808347118,Accepted,"N = int(input()) + +print((N + 1) // 2)" +p02759,s886583010,Accepted,"import math +n = int(input()) +print(math.floor((n+1)/2))" +p02759,s310833058,Accepted,"N = int(input()) +Num = int(N/2) +perseNum = N%2 +if perseNum != 0: + print(Num+perseNum) +else: + print(Num)" +p02759,s328325467,Accepted,"N = int(input()) +print(-(-N//2)) + + +" +p02759,s222094881,Accepted,"import math +N=int(input()) +print(math.ceil(N/2))" +p02759,s699954197,Accepted,"N = int(input()) +if N % 2 == 0: + N /=2 + print(int(N)) +else: + N /=2 + N+=1 + N = int(N) + print(N)" +p02759,s049520819,Accepted,"n = int(input()) + +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s871863717,Accepted,"page = int(input()) + +paper = page // 2 +a = page % 2 +if a != 0: + paper += 1 + +print(paper)" +p02759,s973743126,Accepted,"n = int(input()) +print((n + 1) // 2) +" +p02759,s983012240,Accepted,"import math + +X = int(input()) +Y = X/2 +print(math.ceil(Y)) +" +p02759,s088769274,Accepted,"n = int(input()) +print(-(-n//2))" +p02759,s922787612,Accepted,"import math +n = int(input()) +print(math.ceil(n/2))" +p02759,s574619097,Accepted,"N = int(input()) +if N % 2 == 0: + ans = N // 2 +else: + ans = N // 2 + 1 +print(ans)" +p02759,s822027870,Accepted,"n = int(input()) + +print((int((int(n) / 2))) + (int((int(n) % 2)))) +" +p02759,s660141714,Accepted,"N = int(input()) +if N%2==0: print(int(N/2)) +else: print(int(N/2)+1)" +p02759,s187396087,Accepted,"import math + +n = int(input()) + +print(math.ceil(n/2))" +p02759,s552805192,Accepted,"N = int(input()) +if N % 2 == 0: + print(N // 2) +else: + print((N + 1) // 2)" +p02759,s466369298,Accepted,"N = int(input()) +print(round((N/2)+0.01))" +p02759,s672685005,Accepted,"n = int(input()) +a = n //2 +b = n % 2 +print(a + b)" +p02759,s740416071,Accepted,"x = input() + +if int(x) % 2: + print(int(int(x)/2+0.5)) +else: + print(int(int(x)/2))" +p02759,s315159213,Accepted,"n = int(input()) +if n % 2 == 0: + print(n // 2) +else: + print(n // 2 + 1)" +p02759,s185834910,Accepted,"N = int(input()) + +if N%2==0: + print(N//2) +else: + print(N//2+1)" +p02759,s090942311,Accepted,"N = int(input()) +if N%2 == 0: + print(int(N/2)) +else: + print(int(N//2) + 1)" +p02759,s154378902,Accepted,"def main(): + N = int(input()) + print((N // 2) + (N % 2)) +main() +" +p02759,s967814740,Accepted,"n=int(input()) +if n&1: + print((n+1)//2) +else: + print(n//2) +" +p02759,s653795227,Accepted,"N = int(input()) +if N % 2 == 1: + ans = int(N / 2) + 1 +else: + ans = int(N / 2) + +print(ans)" +p02759,s580487441,Accepted,"from math import ceil +n = int(input()) +print(ceil(n/2))" +p02759,s589736884,Accepted,"from math import * +N = int(input()) + +print(ceil(N/2))" +p02759,s501758936,Accepted,"import sys +from collections import * +import heapq +import math +import bisect +from itertools import permutations,accumulate,combinations,product +from fractions import gcd +def input(): + return sys.stdin.readline()[:-1] +def ruiseki(lst): + return [0]+list(accumulate(lst)) +mod=pow(10,9)+7 + +n=int(input()) +print((n+1)//2)" +p02759,s393592997,Accepted,"n = int(input()) +print((n+1)//2)" +p02759,s513869549,Accepted,"n = int(input()) +print(n//2+n%2)" +p02759,s691924467,Accepted,"N = int(input()) +print(N // 2 if N % 2 == 0 else N // 2 + 1)" +p02759,s538621463,Accepted,"n=int(input()) +print(n//2+n%2)" +p02759,s186878647,Accepted,"n = int(input()) +if(n%2 == 0):print(int(n/2)) +else:print(int(n/2)+1)" +p02759,s403561107,Accepted,"N=int(input()) +print((N+1)//2)" +p02759,s974204883,Accepted,"n = int(input()) +ans = n//2 if n % 2 == 0 else n//2+1 +print(ans) +" +p02759,s015628158,Accepted,"print((int(input())+1)//2) +" +p02759,s004183190,Accepted,"n = int(input()) + +print((n+1)//2)" +p02759,s206116568,Accepted,print((int(input())+1)//2) +p02759,s738468525,Accepted,"N = int(input()) +print((N+ 1)//2)" +p02759,s035580852,Accepted,"import math +n = int(input()) + +print(math.ceil(n/2))" +p02759,s999942321,Accepted,"import math + +a=int(input()) + +print(math.ceil(a/2))" +p02759,s133925611,Accepted,"N = int(input()) +print(N//2) if((N % 2) == 0) else print(N//2 + 1) + + +" +p02759,s192768150,Accepted,print(-(-int(input())//2)) +p02759,s253455746,Accepted,"N = int(input()) +print((N + 1)//2)" +p02759,s128088300,Accepted,"import sys + +def main(): + tmp = input().replace('\n','').split(' ')[0] + res = int(tmp)//2 + int(tmp)%2 + print(res) +if __name__ == '__main__': + input = sys.stdin.readline + main()" +p02759,s705402201,Accepted,"# abc 157 +import sys +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +read = sys.stdin.buffer.read +sys.setrecursionlimit(10 ** 7) + +N = int(readline().strip()) + +if (N % 2) == 0: + answer = int(N / 2) +else: + answer = int((N + 1)/ 2) + +print(answer)" +p02759,s990028444,Accepted,"N = int(input()) +if N%2 ==1: + N += 1 +print(int(N/2))" +p02759,s141450011,Accepted,"import math +n = int(input()) + +res = math.ceil(n/2) +print(res)" +p02759,s145771494,Accepted,"n = int(input()) +print((n+1)//2)" +p02759,s746988258,Accepted,"N = int(input()) +print(N // 2) if N % 2 == 0 else print(N // 2 + 1)" +p02759,s742501147,Accepted," +N=int(input()) + +if N%2==0 : + print(N//2) +else : + print(N//2+1) +" +p02759,s326450891,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s035633479,Accepted,"n = input() +n = int(n) +if n % 2 != 0: + print(int(n/2)+1) +else: + print(int(n/2))" +p02759,s812197549,Accepted,"N = int(input()) +S = N // 2 + +if N % 2 == 0: + print(S) +elif N % 2 == 1: + print(S+1)" +p02759,s825456090,Accepted,"N=int(input()) +M=N/2+N%2 +print(int(M))" +p02759,s742426581,Accepted,"a = int(input()) +if a % 2 == 0: + print(a // 2) +else: + print(a // 2 + 1)" +p02759,s369799477,Accepted,"N = int(input()) + +print(N//2 + N % 2)" +p02759,s042444093,Accepted,"from math import ceil +n=int(input()) +print(ceil(n/2))" +p02759,s172691357,Accepted,"import itertools +import fractions +def main(): + n = int(input()) + print(n//2 + n%2) + +if __name__ == '__main__': + main()" +p02759,s711812726,Accepted,"import math +pageNum = int(input()) +print(int(math.ceil(pageNum/2)))" +p02759,s191002319,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N//2) +else: + print(N//2+1)" +p02759,s852267091,Accepted,"n = int(input()) +ans = (n + 1) // 2 +print(ans) +" +p02759,s101227321,Accepted,"import math +n = int(input()) +print(math.ceil(n/2))" +p02759,s272896166,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s835519272,Accepted,"n = int(input()) +print((n + 1) // 2)" +p02759,s429320664,Accepted,"# cook your dish here +import math +x = int(input()) +print (math.ceil(x/2)) +" +p02759,s793999472,Accepted,"N = int(input()) +print(N//2+N%2)" +p02759,s565509361,Accepted,"n = int(input()) +import math +print(math.ceil(n / 2))" +p02759,s005960178,Accepted,"n = int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s221087308,Accepted,print(-(-int(input()) // 2)) +p02759,s412766580,Accepted,"N = int(input()) +ans = (N-1)//2 + 1 +print(int(ans))" +p02759,s461103240,Accepted,"n = int(input()) +if n%2 == 0: + print(n//2) +else: + print(n//2 + 1)" +p02759,s512840622,Accepted,"N = int(input()) +print((N+1) // 2)" +p02759,s506348892,Accepted,"a=int(input()) +if a%2==0: + print(int(a/2)) +else: + print(int((a+1)/2)) + +" +p02759,s374649006,Accepted,"n = int(input()) +if (n%2 == 1): + n = n + 1 +print(int(n/2))" +p02759,s181999817,Accepted,"N = int(input()) +print((N + 1)//2) +" +p02759,s568155165,Accepted,"N=int(input()) +print(N//2+N%2)" +p02759,s777257279,Accepted,"import math +n = int(input()) +ans = math.ceil(n/2) +print(ans)" +p02759,s300954391,Accepted,"N = int(input()) + +if N%2 == 0: + ans = int(N/2) +else: + ans = int(N/2)+1 + +print(ans)" +p02759,s561927998,Accepted,"n=int(input()) +if n%2==1: + print(n//2+1) +else: + print(n//2)" +p02759,s769591298,Accepted,print((int(input())+1)//2) +p02759,s424518268,Accepted,"N = int(input()) + +if N % 2 == 1: + print(int(N/2+1)) +elif N % 2 == 0: + print(int(N/2))" +p02759,s788911683,Accepted,"import math +from sys import stdin + + +def get_result(data): + N = data[0] + return math.ceil(N / 2.0) + +if __name__ == '__main__': + data = list(map(int, stdin.readline().split(' '))) + result = get_result(data) + print(result) +" +p02759,s362967193,Accepted,"import math +N=input() +N=int(N) +NN=N+1 +print(math.floor(NN/2))" +p02759,s376583679,Accepted,"N = input() +N = int(N) +if N%2 ==0: + amari = 0 +else: + amari = 1 + +N = N/2 +N = int(N) + +print(N+ amari)" +p02759,s070650226,Accepted,"# coding: utf-8 +import sys + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +N = ir() +answer = (N+1) // 2 +print(answer) +" +p02759,s024115447,Accepted,"N=int(input()) +print(N//2+N%2)" +p02759,s921797100,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1) +" +p02759,s718289426,Accepted,"n = int(input()) +print(n // 2 if n % 2 == 0 else n // 2 + 1)" +p02759,s839054340,Accepted,"# ABC157A + +n = int(input()) +print((n + 1) // 2) +" +p02759,s570815344,Accepted,"N = int(input()) +q, r = divmod(N, 2) +print(q + r) +" +p02759,s693134820,Accepted,"N = int(input()) + +print((N+1)//2) +" +p02759,s208101566,Accepted,"import math +n = int(input()) +print(math.ceil(n/2))" +p02759,s247039455,Accepted,"n = int(input()) +print(n//2+(n%2))" +p02759,s779296785,Accepted,"n = int(input()) +if n % 2: + print(n // 2 + 1) +else: + print(n // 2)" +p02759,s193426065,Accepted,"N=int(input()) +if N%2==1: + print(N//2+1) +else: + print(N//2)" +p02759,s538828577,Accepted,"from math import ceil +n = int(input()) +print(ceil(n/2))" +p02759,s595694866,Accepted,"import math + +N = int(input()) +num = math.ceil(N/2) +print(num)" +p02759,s056736778,Accepted,"N = int(input()) +if N % 2 == 0: + print(N//2) +else: + print(N//2+1)" +p02759,s430613114,Accepted,"import sys +from math import floor, ceil +def get_ints(): return map(int, sys.stdin.readline().strip().split()) +def get_array(): return list(map(int, sys.stdin.readline().strip().split())) +def input(): return sys.stdin.readline().strip() + +n = int(input()) +print(int(ceil(n/2)))" +p02759,s065626795,Accepted,"N = int(input()) +if N%2 == 1: + print(N//2+1) +else: + print(N//2)" +p02759,s822864605,Accepted,"n = int(input()) +if n % 2 == 1: + print(n//2 + 1) +else: + print(n//2)" +p02759,s693362192,Accepted,"N = int(input()) +print((N+1)//2)" +p02759,s111783886,Accepted,"N = int(input()) +if N % 2 == 0: + n = N / 2 +else: + n = int((N+1) / 2) +print(int(n))" +p02759,s601344304,Accepted,"n = int(input()) +print((n // 2) + (n % 2) )" +p02759,s837514643,Accepted,print((int(input()) + 1) // 2) +p02759,s134155502,Accepted,"N = int(input()) + +print(int((N + 1) / 2)) +" +p02759,s383534883,Accepted,"N = int(input()) +print((N+1)//2)" +p02759,s773798719,Accepted,"N=int(input()) + +ans=(N+1)//2 + +print(ans)" +p02759,s573402924,Accepted,"import math +N = int(input()) +print(math.ceil(N / 2))" +p02759,s463721212,Accepted,"N = input() +N = int(N) +print(-(-N // 2))" +p02759,s566401145,Accepted,"N= [int(i) for i in input().split()][0] +print((N+1)//2)" +p02759,s427002280,Accepted,"from math import ceil +n=int(input()) +print(ceil(n/2))" +p02759,s729285130,Accepted,"n=int(input()) + +if n%2 ==0: + print(n//2) +else: + print(n//2 + 1)" +p02759,s662095472,Accepted,"n = int(input()) +print((n+1)//2) +" +p02759,s047425416,Accepted,"import math + +n = int(input()) + +n = math.ceil(n/2) + +print(n)" +p02759,s334927366,Accepted,"N = int(input()) + +import math + +print(math.ceil(N / 2))" +p02759,s610386042,Accepted,"s =int(input()) + +print(s//2+s%2)" +p02759,s712361272,Accepted,"n = int(input()) +pages = 0 +if n%2 == 1: + pages += 1 +pages += n//2 +print(pages)" +p02759,s260925949,Accepted,"N = int(input()) +num = N + (N % 2) +print(int(num/2))" +p02759,s720065706,Accepted,"N = int(input()) +print(int((N+1)//2))" +p02759,s098463287,Accepted,"N = int(input()) + +if N % 2 == 0: + print(int(N / 2)) +else: + print(int(N // 2 + 1))" +p02759,s264428889,Accepted,"n = int(input()) + +print((n + 1)//2)" +p02759,s086963322,Accepted,"#coding:utf-8 +import sys,os +sys.setrecursionlimit(10**6) +write = sys.stdout.write +dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0 +def main(given=sys.stdin.readline): + input = lambda: given().rstrip() + LMIIS = lambda: list(map(int,input().split())) + II = lambda: int(input()) + XLMIIS = lambda x: [LMIIS() for _ in range(x)] + YN = lambda c : print('Yes') if c else print('No') + MOD = 10**9+7 + + N = II() + from math import ceil + print(ceil(N/2)) + + +if __name__ == '__main__': + main()" +p02759,s177322061,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N // 2) +else: + print(N // 2 + 1)" +p02759,s537594746,Accepted,"n = int(input()) +print(n // 2 if n % 2 == 0 else 1 + (n // 2))" +p02759,s663666075,Accepted,"import math +n = int(input()) +print(math.ceil(n / 2))" +p02759,s752794448,Accepted,"n = int(input()) +print(-(-n//2)) +" +p02759,s267463666,Accepted,"import math +print(math.ceil(int(input()) / 2))" +p02759,s476793511,Accepted,"import math +N = int(input()) + +print(math.ceil(N/2)) +" +p02759,s382461218,Accepted,"from math import ceil + +N = int(input()) +print(ceil(N / 2)) +" +p02759,s915717899,Accepted,"# encoding:utf-8 +import copy +import random +import bisect #bisect_left これで二部探索の大小検索が行える +import fractions #最小公倍数などはこっち +import math +import sys +import collections + +mod = 10**9+7 +sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000 + +d = collections.deque() +def LI(): return list(map(int, sys.stdin.readline().split())) + +N = int(input()) +print(math.ceil(N/2))" +p02759,s104591868,Accepted,"# coding: utf-8 + +n = int(input()) +print((n + 1) // 2) +" +p02759,s166133222,Accepted,"import math +print((int)(math.ceil((int)(input())/2)))" +p02759,s167476436,Accepted,"N = int(input()) +ans = -(-N // 2) +print(ans)" +p02759,s526936533,Accepted,"import math +N = int(input()) + + +print(math.ceil(N / 2))" +p02759,s665559414,Accepted,"# -*- coding: utf-8 -*- +import sys +import math +#import collections +#sys.setrecursionlimit(100000) + +n=int(input()) +#tmp = input().split() +#hoge = list(map(lambda a: int(a), tmp)) + +print((n+1)//2) + +" +p02759,s848669457,Accepted,"n = int(input()) +print(n//2 + n%2)" +p02759,s695028669,Accepted,"n = int(input()) + +print(int((n+1)/2)) +" +p02759,s096002549,Accepted,"n = int(input()) + +ans = n // 2 + +if n % 2 == 0: + print(ans) +else: + print(ans+1)" +p02759,s668911563,Accepted,"N = int(input()) +print(int((N/2))+(N%2))" +p02759,s199706851,Accepted,"import math + +N = int(input()) + +print(math.ceil(N/2))" +p02759,s659523453,Accepted,"#!/usr/bin/python3 + +n = int(input()) + +print(n // 2 + n % 2) +" +p02759,s236411235,Accepted,"n = int(input()) +if n%2 == 0: + print(n//2) +else: + print(n//2+1)" +p02759,s515709010,Accepted,"N = input() +intN=int(N) +if intN%2 == 0: + print(intN//2) +else: + print(intN//2 +1)" +p02759,s501683588,Accepted,"N = int(input()) +print((N + 1) // 2)" +p02759,s576472297,Accepted,"N=int(input()) + +if N%2==0: + print(int(N/2)) + +elif N%2==1: + print(int(int(N/2)+1))" +p02759,s269973467,Accepted,"#ABC157-A +n=int(input()) +if n%2==0: + print(int(n/2)) +else: + print(int(n/2)+1)" +p02759,s809728121,Accepted,"import math +N = int(input()) +print(math.ceil(N/2))" +p02759,s793316366,Accepted,"inputs = list(map(int, (input().split()))) + +a = inputs[0] + +b = a % 2 +c = int(a / 2) + +print(b + c) +" +p02759,s435054724,Accepted,"N = int(input()) +print(-(-N//2))" +p02759,s618513228,Accepted,"n = int(input()) +print((n+1)//2)" +p02759,s185729618,Accepted,"n = int(input()) +print(int(n/2) if n%2 == 0 else n//2+1)" +p02759,s175357165,Accepted,"N = int(input()) +print((N+1)//2)" +p02759,s607382166,Accepted,"k = int(input()) + +q = k // 2 +mod = k % 2 + +if mod != 0: + ans = q + 1 +else: + ans = q + +print(ans)" +p02759,s312121111,Accepted,"N = int(input()) +A = N / 2 +A = int(A) +B = (N + 1) / 2 +B = int(B) +if N % 2 == 0: + print(A) +else: + print(B) + +" +p02759,s688786630,Accepted,"# coding: utf-8 +import math +N = int(input()) +ans = math.ceil(N / 2) +print(ans)" +p02759,s408025438,Accepted,"import math + +N = int(input()) +print(math.ceil(N/2))" +p02759,s001583567,Accepted,"n = int(input()) + +print(n//2+n%2)" +p02759,s066942228,Accepted,"N=int(input()) +print(N//2+N%2)" +p02759,s279133512,Accepted,"import math +N = int(input()) +print(math.ceil(N / 2))" +p02759,s521927833,Accepted,"import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +sys.setrecursionlimit(10 ** 7) + +from math import ceil + +n = int(readline()) +print(ceil(n / 2)) +" +p02759,s480281745,Accepted,"N=int(input()) +print((N+1)//2)" +p02759,s489168841,Accepted,"n = int(input()) / 2 + 0.01 + +print(int(round(n))) +" +p02759,s726249749,Accepted,"import math +print(math.ceil(int(input())/2))" +p02759,s900903193,Accepted,"N = int(input()) +print((N+1)//2)" +p02759,s556864490,Accepted,"N = int(input()) +print((N + 1) // 2)" +p02759,s708444707,Accepted,"N = int(input()) +print((N + 1) // 2)" +p02759,s534122891,Accepted,"N = int(input()) + +ans = N // 2 +if N % 2 != 0: + ans += 1 + +print(ans)" +p02759,s275987850,Accepted,"from sys import stdin + + +def main(): + input = lambda: stdin.readline()[:-1] + N = int(input()) + print((N + 1) // 2) + + +main() +" +p02759,s674081022,Accepted,"N=int(input()) +if N%2==0: + print(N//2) +else: + print(N//2+1)" +p02759,s005952818,Accepted,"import math + +n = int(input()) + +n = math.ceil(n/2) + +print(n)" +p02759,s901346749,Accepted,"n=int(input()) +x=n//2 if n%2==0 else n//2+1 +print(x)" +p02759,s668183863,Accepted,"N=input() +N=int(N) + +if N%2==1: + N=int(((N-1)/2)+1) + print(N) +else: + N=int(N/2) + print(N)" +p02759,s246753459,Accepted,"N = int(input()) +print(-(-N//2)) +" +p02759,s197952201,Accepted,"def main(): + N = int(input()) + + q, mod = divmod(N, 2) + + if mod != 0: + print(q+1) + else: + print(q) + +if __name__ == ""__main__"": + main()" +p02759,s590563102,Accepted,"import math +n = int(input()) +print(math.ceil(n/2))" +p02759,s127610413,Accepted,"n=int(input()) + +ans=int(n/2) + +if n%2==0: + print(ans) +else: + print(ans+1) + +" +p02759,s988325663,Accepted,"import math +n = int(input()) + +print(math.ceil(n / 2)) +" +p02759,s718775805,Accepted,print(-(-int(input())//2)) +p02759,s029433780,Accepted,"N = int(input()) +print(N//2 + N % 2)" +p02759,s004449109,Accepted,"n=int(input()) +print(n//2+n%2)" +p02759,s024092333,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N//2) +else : + print((N+1)//2) + " +p02759,s794819214,Accepted,print(-(-int(input())//2)) +p02759,s313898332,Accepted,"N = int(input()) +print(N//2 + N % 2)" +p02759,s931710259,Accepted,"N = int(input()) +print(N // 2 + N % 2)" +p02759,s708873659,Accepted,"import sys +readline = sys.stdin.buffer.readline + +n = int(readline()) + +if n%2 == 0: + print(n//2) +else: + print(n//2+1)" +p02759,s034612096,Accepted,"# coding:utf-8 + +import sys +import math +import time +#import numpy as np +import collections +from collections import deque +import queue +import copy +import bisect + + +def dfs(s, prev, pre): + val[s] += Ope[s] + prev + for i in G[s]: + if(i == pre): + continue + dfs(i, val[s], s) + +#X = str(input()).split() +#a = [int(x) for x in input().split()] +#sys.setrecursionlimit(10**7) +#N, Q = map(int, input().split()) +N = int(input()) + +if(N%2==0): + print(int(N/2)) +else: + print(int(math.floor(N/2)+1)) +" +p02759,s267981494,Accepted,"N = int(input()) +import math +print(math.ceil(N/2))" +p02759,s794755913,Accepted,"n = int(input()) +if n%2 == 0: + print(n//2) +else: + print(n//2+1)" +p02759,s355419767,Accepted,"import sys + +# S = input() +# N, M = map(int, input().split()) +# nums = list(map(int, input().split())) +# nums_2d = [list(map(int, input().split())) for _ in range(N)] + + +def main(): + N = int(input()) + + print((N+1)//2) + + +if __name__ == '__main__': + main() +" +p02759,s830645579,Accepted,print((int(input()) + 1) // 2) +p02759,s269837889,Accepted,"N = int(input()) +q = N//2 +mod = N%2 +if mod >0: + print(q+1) +else: + print(q)" +p02759,s109871010,Accepted,"N = int(input()) +print((N + 1) // 2) " +p02759,s771747838,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N // 2) +else: + print(N // 2 + 1) +" +p02759,s842561919,Accepted,"N = int(input()) +print(-(-N//2))" +p02759,s945982796,Accepted,"#import math +#import bisect +#import numpy as np +#import itertools +#import copy +import sys + +ipti = sys.stdin.readline +MOD = 10 ** 9 + 7 +INF = float('INF') +sys.setrecursionlimit(10 ** 5) + +def main(): + n = int(input()) + print(((n-1)//2+1)) + +if __name__ == '__main__': + main()" +p02759,s582678796,Accepted,"n = int(input()) +print(-(-n // 2))" +p02759,s749866973,Accepted,"#!/usr/bin/env python + +from sys import stdin, stderr + +def main(): + N = int(stdin.readline()) + res = (N+1)//2 + print(res) + + return 0 + +if __name__ == '__main__': main() +" +p02759,s861755740,Accepted,"N = int(input()) +print(N // 2 + N % 2)" +p02759,s007398308,Accepted,"N = int(input()) +if N % 2 == 0: + print(N//2) +else: + print(N//2+1) +" +p02759,s188556479,Accepted,"n = int(input()) + +ans = n // 2 +if n % 2 != 0: ans += 1 +print(ans) +" +p02759,s552818825,Accepted,print((int(input())+1)//2) +p02759,s689668428,Accepted,"import math + + +def main(): + N = int(input()) + a = math.ceil(N/2.0) + print(a) + + +if __name__ == '__main__': + main() +" +p02759,s506899966,Accepted,"import math +n = int(input()) +ans = math.ceil(n/2) +print(ans)" +p02759,s224019834,Accepted,"N = int(input()) +if N % 2 == 1: + N = N+1 +N = int(N / 2) +print(N) +" +p02759,s152281241,Accepted,"N = int(input()) +ans = N//2 + N%2 +print(ans)" +p02759,s738165017,Accepted,"n = int(input()) +print((n+1) // 2)" +p02759,s269674278,Accepted,"n = int(input()) +if n % 2 == 0: + print(n // 2) +else: + print(n // 2 + 1)" +p02759,s616350827,Accepted,print(-(-int(input()) // 2)) +p02759,s017756866,Accepted,"a = int(input()) +if(a%2 == 1): + print((a+1)//2) +if(a%2 == 0): + print(a//2) +" +p02759,s894585488,Accepted,"N = int(input()) + +print ((N + 1) // 2)" +p02759,s655464961,Accepted,"n=int(input()) +m=-(-n//2) +print(m)" +p02759,s879971528,Accepted,"N = int(input()) +if N%2 == 1: + print(N//2+1) +else: + print(N//2)" +p02759,s736570570,Accepted,"def main(): + #from sys import stdin, setrecursionlimit + #setrecursionlimit(10**9) + #r = input() + #n = int(input()) + #a, b = map(int, input().split()) + #s, y = input().split() + #a = input().split() + #a = [int(input()) for i in range(n)] + #a = list(map(int, input().split())) + #a = [list(map(int, input().split())) for i in range(n)] + #a = [int(s) - 1 for s in input().split()] + #l=[int(input()) for _ in range(int(input()))] + #res = 0 + n = int(input()) + print((n+1)//2) + +if __name__ == '__main__': + main() +" +p02759,s618376040,Accepted,"N=input() +N=int(N) + +ans=0 +#print(N) + +if N>=1 and N<=100 : + ans =N/2 + if N%2==1: + ans = ans+1 + +print(int(ans)) +" +p02759,s790650352,Accepted,"N=int(input()) + +if N%2==0: + print(int(N/2)) +if N%2==1: + print(int(N/2+1)) +" +p02759,s027634430,Accepted,print((int(input())+1)//2) +p02759,s880226032,Accepted,"num = int(input()) +res = int(num / 2) +if num % 2 == 1: + print(res + 1) +else: + print(res)" +p02759,s013390068,Accepted,"n = int(input()) + +print((n + 1) // 2) +" +p02759,s704456449,Accepted,"import math +print(math.ceil(int(input()) / 2))" +p02759,s110826704,Accepted,"# import numpy as np +# import math +# import copy +# from collections import deque +import sys +input = sys.stdin.readline +# sys.setrecursionlimit(10000) + + +def main(): + N = int(input()) + + if N % 2 == 0: + res = N // 2 + else: + res = N // 2 + 1 + + print(res) + + + +main() +" +p02759,s939831914,Accepted,"import os + +n = int(input()) + +if n % 2 == 0 : + page = int(n/2) +elif n % 2 == 1 : + page = int(n/2) + 1 +print(int(page))" +p02759,s538837054,Accepted,print((int(input())+1)//2) +p02759,s620560776,Accepted,"N=int(input()) +answer=N/2 +if N%2==1: + answer=N//2+1 + + +print(int(answer))" +p02759,s852264299,Accepted,"n = int(input()) +x = n//2 +n =n%2 +print(x+n) +" +p02759,s826075018,Accepted,"N = int(input()) +print(int(N/2) if N % 2 == 0 else int((N+1)/2))" +p02759,s509779575,Accepted,print(-((-int(input()))//2)) +p02759,s381212087,Accepted,"N = int(input()) +print(int((N+1)//2) )" +p02759,s856906589,Accepted,"n=int(input()) + +amari=n%2 + +if amari==0: + print(int(n/2)) + +else: + print(int(n/2+1))" +p02759,s416109409,Accepted,"N=int(input()) +print(int((N+2-1)/2)) +" +p02759,s875255387,Accepted,"pages = int(input()) +a = pages // 2 +b = 1 if pages % 2 == 1 else 0 +print(a + b)" +p02759,s606983591,Accepted,"import math +n = int(input()) +if n % 2 == 0: + print(int(n / 2)) +elif n % 2 == 1: + print(math.ceil(n / 2))" +p02759,s316258794,Accepted,"n = int(input()) + +if n % 2 == 0: + ans = n // 2 +else: + ans = n // 2 + 1 + +print(ans)" +p02759,s971992788,Accepted,"N = int(input()) +print(int(N/2+0.5))" +p02759,s164511139,Accepted,"x = int(input()) +print(x//2+x%2)" +p02759,s570963228,Accepted,"N = int(input()) +if N%2==0: + print(int(N/2)) +else: + print(int(N/2)+1)" +p02759,s617577272,Accepted,"import math +N=int(input()) +print(math.ceil(N/2))" +p02759,s612321056,Accepted,"import sys +from math import ceil + + +def main(): + input = sys.stdin.buffer.readline + n = int(input()) + print(ceil(n / 2)) + + +if __name__ == ""__main__"": + main() +" +p02759,s007593576,Accepted,"n = int(input()) +if n%2==0: + print(n//2) +else: + print((n+1)//2)" +p02759,s232766273,Accepted,"def main(): + + N = int(input()) + return (N+1) // 2 + +if __name__ == '__main__': + print(main()) +" +p02759,s156691812,Accepted,"n = int(input()) +if n % 2 == 1: + print(n // 2 + 1) +else: + print(int(n / 2))" +p02759,s539202724,Accepted,"n=int(input()) +print((n+1)//2)" +p02759,s015391085,Accepted,"n = int(input()) + +if n % 2 != 0: + print(n//2+1) +else: + print(n//2)" +p02759,s136575136,Accepted,"n=int(input()) + +if n%2==0: + print(int(n/2)) +if n%2==1: + print(int((n+1)/2))" +p02759,s706060336,Accepted,print((int(input())+1)//2) +p02759,s004431435,Accepted,"N=int(input()) +import math +ans=math.ceil(N/2) +print(ans) +" +p02759,s048925929,Accepted,"n = int(input()) +if n % 2 == 0: + print(n//2) +else: + print(n // 2 + 1)" +p02759,s753894566,Accepted,"n = int(input()) + +if n % 2 == 0: + print(n//2) +else: + print(n//2+1)" +p02759,s896981871,Accepted,"#A +import math +n = int(input()) +print(math.ceil(n / 2)) +" +p02759,s193529258,Accepted,"N=int(input()) +print((N+1)//2)" +p02759,s134509031,Accepted,"# -*- coding: utf-8 -*- +n = int(input()) +if n%2 == 0: + print(int(n/2)) +else: + print(int((n+1)/2))" +p02759,s857645581,Accepted,"N = int(input()) +if N % 2 == 0: + answer = N /2 +else: + answer = (N + 1) / 2 + +print(int(answer))" +p02759,s520375295,Accepted,"n = int(input()) + +if n % 2 == 0: + print(int(n//2)) +else: + print(int(n//2 + 1))" +p02759,s503503008,Accepted,"import math +n=int(input()) +print(math.ceil(n/2))" +p02759,s890215450,Accepted,"# -*- coding: utf-8 -*- + +N = int(input()) + +page = int((N - 1 + 2) / 2) +print(page)" +p02759,s828724792,Accepted,"N = int(input()) + +q = N // 2 +m = N % 2 +print(q + m) +" +p02759,s031049995,Accepted,"import itertools +import functools +import math +from collections import Counter +from itertools import combinations + + +N=int(input()) + +print((N+1)//2) +" +p02759,s130786912,Accepted,"n = int(input()) +print(int((n+1)/2))" +p02759,s586327910,Accepted,"n = int(input()) + +print(n//2 + 1 if n % 2 else n //2)" +p02759,s513514736,Accepted,"N = int(input()) + +if N % 2 == 0: + print(N // 2) +else: + print(N//2 + 1)" +p02759,s054349387,Accepted,"n = int(input()) +print(n//2 + n%2)" +p02759,s847226590,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s352227954,Accepted,"# -*- coding: utf-8 -*- +N = int(input()) +g = N // 2 +k = ( N + 1 ) // 2 +if N % 2 == 0: + print(g) +else: + print(k)" +p02759,s175120002,Accepted,"n = int(input()) +if n % 2 == 0:print(n//2) +else: print(n//2 + 1)" +p02759,s285926575,Accepted,"# N = int(input()) +# N = map(int,input().split()) +# N = list(map(int,input().split())) + +N = int(input()) +print(((N-1)//2)+1)" +p02759,s068507701,Accepted,"n=int(input()) +print((n+1)//2)" +p02759,s012709647,Accepted,"import math + +print(math.ceil(int(input())/2))" +p02759,s951747397,Accepted,"from math import ceil +print(ceil(int(input())/2))" +p02759,s348773590,Accepted,"n=int(input()) +if n % 2 == 0: + print(n//2) +else: + print(n//2+1)" +p02759,s380156386,Accepted,"import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7) +sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep=""\n"") +def I(i=0): t = [int(x)-i for x in sr().split()];return t +def S(): t = sr().split(); return t if len(t) > 1 else t[0] +L1,L2,L3,L4, = [],[],[],[] + +a, = I() +print(math.ceil(a/2))" +p02759,s672094546,Accepted,"N = int(input()) +print(int((N+1)/2))" +p02759,s912467171,Accepted,"import sys +N = int(sys.stdin.buffer.read()) +print(-(-N // 2))" +p02759,s558591682,Accepted,"import math + +N = int(input()) + +print(math.ceil(N/2))" +p02759,s949491884,Accepted,"n = int(input()) +ans = n//2 +if n%2 == 1: + ans += 1 +print(ans)" +p02759,s611207876,Accepted,"import math + +pages = input() +count = int(pages) + +if count %2 == 0 : + print(count/2) +else : + print((count + 1)/2) +" +p02759,s459048137,Accepted,"N = int(input()) +print(N//2 if N%2 == 0 else (N+1)//2)" +p02759,s952996294,Accepted,"# 157 A + +n = int(input()) + +print((n//2) + (n%2))" +p02759,s422583327,Accepted,"import numpy as np + +N=int(input()) +#a = list(map(int, input().split())) +m = N%2 +if (m == 0): + print(int(N/2)) +else: + print(int(N/2+1)) +#for x in range(0,N,1):" +p02759,s773637958,Accepted,"import math +print(math.ceil(int(input())/2)) +" +p02759,s304099246,Accepted,print((int(input())+1)//2) +p02759,s800766710,Accepted,"N= int(input()) +answer=N//2+ N%2 +print(answer) +" +p02759,s125154675,Accepted,"import math + +n = input() +N=int (n) +print(math.ceil(N/2))" +p02759,s217989394,Accepted,print((int(input())+1)//2) +p02759,s327294406,Accepted,"N = int(input()) + +print((N + 1)// 2)" +p02759,s050296631,Accepted,"import math +N = int(input()) +print(math.ceil(N/2))" +p02759,s831418327,Accepted,"import math +N = int(input()) + +print(math.ceil(N/2))" +p02759,s092400168,Accepted,"import math + +N = int(input()) +print(math.ceil(N / 2))" +p02759,s913157210,Accepted,"n=int(input()) +print(n//2+n%2)" +p02759,s769435141,Accepted,"n=int(input()) +print(n//2+n%2)" +p02759,s149184588,Accepted,"user_input = int(input()) +if 1 <= user_input <= 100: + check = user_input % 2 + if check == 0: + print(user_input//2) + else: + print(user_input//2 + check) + +" +p02759,s622918153,Accepted,"N=int(input()) + +ans=N//2 +if(N % 2 >0): + ans=ans+1 +print(ans) + " +p02759,s833869154,Accepted,"n=int(input()) + +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s450021057,Accepted,"import math +print(math.ceil(int(input()) / 2)) +" +p02759,s597386623,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s041417144,Accepted,"N = int(input()) +if N%2==0: + print(""{}"".format((N//2))) +else: + print(""{}"".format((N//2)+1))" +p02759,s899388980,Accepted,"import math +def main(): + N = int(input()) + print(math.ceil(N/2)) + + +main()" +p02759,s934700961,Accepted,"import math + +N = int(input()) + +print(math.ceil(N/2))" +p02759,s200011626,Accepted,"m=int(input()) + +print(m//2+m%2)" +p02759,s584298111,Accepted,"import math + +n = int(input()) + +print(math.ceil(n/2)) +" +p02759,s448219229,Accepted,"n = int(input()) +if (n % 2 == 0): + print(n // 2) +else: + print((n // 2) + 1)" +p02759,s179054289,Accepted,"import math + +n = int(input()) + +print(math.ceil(n / 2)) +" +p02759,s113177435,Accepted,"import math +page = int(input()) +print(math.ceil(page / 2))" +p02759,s863392339,Accepted,"n=int(input()) + +print(-(-n//2))" +p02759,s041853203,Accepted,"import numpy as np +n = int(input()) +print(int(np.ceil(n / 2)))" +p02759,s086165058,Accepted,"N = int(input()) +if N % 2 == 0: + ans = int(N / 2) +else: + ans = int(N / 2)+1 +print(ans)" +p02759,s337182524,Accepted,"N = int(input()) +if N%2 == 0: + ans = int(N/2) +else: + ans = int(N/2)+1 + +print(ans)" +p02759,s996045606,Accepted,"import sys +import math +def i():return int(sys.stdin.readline().replace(""\n"","""")) +def i2():return map(int,sys.stdin.readline().replace(""\n"","""").split()) +def s():return str(sys.stdin.readline().replace(""\n"","""")) +def l():return list(sys.stdin.readline().replace(""\n"","""")) +def intl():return [int(k) for k in sys.stdin.readline().replace(""\n"","""").split()] +def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace(""\n"","""").split())) +def t():return tuple(map(int,sys.stdin.readline().replace(""\n"","""").split())) + +if __name__ == ""__main__"":pass + +n = i() +print(n//2 if n%2==0 else n//2+1)" +p02759,s826371347,Accepted,"n = int(input()) +if n % 2 == 0: + print(n // 2) +else: + print((n+1) // 2)" +p02759,s443230024,Accepted,"if __name__ == '__main__': + n = int(input()) + if n % 2 == 0: + print(int(n / 2)) + else: + print(int(n / 2 + 1))" +p02759,s511161055,Accepted,"def main(): + N = int(input()) + ans = N // 2 if N % 2 == 0 else (N // 2) + 1 + print(ans) + + +if __name__ == ""__main__"": + main()" +p02759,s484387516,Accepted,"N = int(input()) +print(N//2+N%2)" +p02759,s519875177,Accepted,"import math + +n = int(input()) + +if n%2 == 0: + print(n//2) +else: + print(math.floor(n//2)+1)" +p02759,s427426011,Accepted,"# -*- coding: utf-8 -*- + + +def main(): + n = int(input()) + ans = n // 2 + + if n % 2 == 1: + ans += 1 + + print(ans) + + +if __name__ == '__main__': + main() +" +p02759,s803655993,Accepted,"n=int(input()) +if n%2!=0: + s=(n+1)//2 +else: + s=n//2 +print(s)" +p02759,s894040018,Accepted,"n=int(input()) +print(n//2 if n%2==0 else n//2+1)" +p02759,s450439259,Accepted,"temp = ((int(input()) + 2)-1)/2 + +print(int(temp))" +p02759,s694833175,Accepted,"n=int(input()) +print((n+1)//2)" +p02759,s090936750,Accepted,"import sys +import numpy as np + +# input = sys.stdin.readline + +n = int(input()) + +print(int((n+1)/2))" +p02759,s123098426,Accepted,"from math import ceil + +n = int(input()) +print(ceil(n/2))" +p02759,s959285028,Accepted,"n = int(input()) + +page = n // 2 +page += n % 2 + +print(page)" +p02759,s670535452,Accepted,"n = int(input()) +print(n//2 if n % 2 == 0 else (n+1)//2)" +p02759,s314998490,Accepted,"import math +n = int(input()) +print(math.ceil(n/2))" +p02759,s837648460,Accepted,"import itertools +import sys +import math +import numpy as np +from collections import deque +from itertools import combinations +from functools import reduce +from functools import lru_cache +sys.setrecursionlimit(10**9) + +def main(): + N = int(input()) + print(math.ceil(N/2)) + +if __name__ == ""__main__"": + main() +" +p02759,s279284786,Accepted,"n = int(input()) +print((n+1)//2) +" +p02759,s834001139,Accepted,"import sys +import math +import collections +n = int(input()) +#n, a, b = map(int, input().split()) +#s = input() +#x = list(map(int, input().split())) + +print(math.ceil(n/2)) +" +p02759,s265895011,Accepted,"import math + +N = int(input()) + + + +print(math.ceil(N/2))" +p02759,s745227672,Accepted,"# ABC 157 A +si = lambda: input() +ni = lambda: int(input()) +nm = lambda: map(int, input().split()) +nms = lambda: map(str, input().split()) +nl = lambda: list(map(int, input().split())) +n=int(input()) +if n%2==1: + print(n//2+1) +else: + print(n//2) +" +p02759,s643590722,Accepted,"N = int(input()) +if N % 2 == 0: + print(N // 2) +else: + print(N // 2 + 1)" +p02759,s792823946,Accepted,"N = int(input()) +print(-(-N//2))" +p02759,s646620535,Accepted,"a = int(input()) +print(-(-a // 2)) +" +p02759,s796084984,Accepted,"N = int(input()) +a, b = divmod(N, 2) +print(a+b) +" +p02759,s886707752,Accepted,"N = int(input()) +print(-(-N//2))" +p02759,s331420078,Accepted,"import sys + +stdin = sys.stdin + +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) +ns = lambda: stdin.readline().rstrip() # ignore trailing spaces +nl = lambda: list(map(int, stdin.readline().split())) + +n = ni() +print((n + 1) // 2)" +p02759,s731124144,Accepted,"N = int(input()) +if N%2 == 0: + print(N//2) +else: + print((N//2)+1)" +p02759,s013764789,Accepted,"import math +if __name__ == '__main__': + n = input() + n = int(n) + ans = math.ceil(n/2) + print(ans)" +p02759,s027628523,Accepted,"n=int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s262818243,Accepted,"n=int(input()) +print(n//2+n%2)" +p02759,s229440595,Accepted,"n = int(input()) + + +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s005447880,Accepted,"N = int(input()) + +if N % 2 == 0: + print(int(N / 2)) +else: + print(int(N // 2 + 1))" +p02759,s445735876,Accepted,"N=int(input()) +if N%2==0 : + print(int(N/2)) +else : + print(int(N/2+1))" +p02759,s678701883,Accepted,"n = int(input()) +if n % 2 == 0: + print( n // 2) +else: + print( n // 2 + 1)" +p02759,s803365680,Accepted,"n = int(input()) +ans = (n+1)//2 +print(ans)" +p02759,s457988980,Accepted,"N = int(input()) +xx = 0 +if N % 2 == 1: + xx = (N / 2) + 1 +else: + xx = (N / 2) +print(int(xx)) +" +p02759,s598592059,Accepted,"s = int(input()) + +sec = (s+1) >> 1 +print(sec) +" +p02759,s640452883,Accepted,"n=int(input()) + +ans=int(n/2) + +if n%2==0: + print(ans) +else: + print(ans+1) + +" +p02759,s670891150,Accepted,"import math +N = int(input()) +print(math.ceil(N/2))" +p02759,s153559545,Accepted,"import math +N = int(input()) +print(math.ceil(N/2))" +p02759,s365686614,Accepted,"s = list(map(int, input().split())) +if s[0]%2==1: + print(int(s[0]/2)+1) +else: + print(int(s[0]/2))" +p02759,s411329040,Accepted,"n = int(input()) +print(n//2 + n%2)" +p02759,s299964997,Accepted,"N=int(input()) +if N % 2==0: + print(int(N/2)) +else: + print(int(N/2+0.5))" +p02759,s272715969,Accepted,"N = int(input()) +print(N//2 + N%2)" +p02759,s373964308,Accepted,"N = int(input()) +if N % 2 == 0: + print(round(N/2)) +else: + print(round((N+1)/2)) +" +p02759,s092652368,Accepted,"n = int(input()) +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s572056413,Accepted,"import math +n = int(input()) + +print(math.ceil(n/2))" +p02759,s746159246,Accepted,"n=int(input()) + +if n%2==0: + print(n//2) +else: + print(n//2+1)" +p02759,s855785427,Accepted,"a = int(input()) +ans = 0 +if a % 2 == 0: + ans = a // 2 +else: + ans = (a // 2) + 1 + +print(ans)" +p02759,s522049053,Accepted,"n = int(input()) +print((n+1) // 2)" +p02759,s644895604,Accepted,"x = int(input()) +if x % 2 == 0: + print(x // 2) +else: + print(x // 2 + 1) +" +p02759,s410369284,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print(int(n/2)+1) " +p02759,s914189385,Wrong Answer,"N = int(input()) +print(N//2+1)" +p02759,s204253620,Wrong Answer,"n = int(input()) +print(n//2)" +p02759,s323206431,Wrong Answer,"n=int(input()) +print(round(n/2)+1)" +p02759,s877201102,Wrong Answer,"n=input() +print(int(n)//2)" +p02759,s976504042,Wrong Answer,"n = int(input()) // 2 +print(n)" +p02759,s787075675,Wrong Answer,"N = int(input()) +print( N//2 + 1)" +p02759,s562141077,Wrong Answer,"x = input() +page = int(x) // 2 +print(page+1)" +p02759,s086153922,Wrong Answer,"N=int(input()) + + + +print(N//2+1) + + + +" +p02759,s594619553,Wrong Answer,"n = int(input()) +if n % 2 ==0: + print(n / 2) +else: + print(n // 2 + 1)" +p02759,s888233548,Wrong Answer,"N = int(input()) +if N%2 == 0: + print(N/2) +else: + print(N/2+1)" +p02759,s865473971,Wrong Answer,"print(int(input()) // 2) +" +p02759,s512619736,Wrong Answer,"n = int(input()) +ans = n // 2 + +if n % 2: + print(ans) +else: + print(ans + 1) + + + +" +p02759,s904427956,Wrong Answer,"n = int(input()) +if n % 2 == 0: + print(n/2) +else: + print((n+1)/2) + + +" +p02759,s607268771,Wrong Answer,"N=input("""") +N=int(N) +if 1<=N<=100: + if N%2==0: + N=N/2 + print(N) + else: + N=(N+1)/2 + print(N) +else: + None" +p02759,s676961530,Wrong Answer,"N=int(input()) + + +if(N%2==0): + print(N/2) +else: + print(N//2+1) +" +p02759,s047880518,Wrong Answer,"N = int(input()) +res = 0 +if N % 2 == 0: + res = N / 2 +else: + res = N // 2 + 1 + +print(res)" +p02759,s026038014,Wrong Answer,"import sys +import math + +for line in sys.stdin.readline(): + n = float(line.rstrip()) + ans = math.ceil(n / 2) + print(ans, end="""") + break +" +p02759,s693305451,Wrong Answer,"N = int(input()) +ans = N / 2 +if type(ans) == int: + print(ans) +else: + print(int(ans)+1)" +p02759,s531684638,Wrong Answer," +N = int(input()) +if N % 2 == 1: + print((N+1)/2) +else: + print(N/2) + +" +p02759,s843898142,Wrong Answer,"import math + +N = int(input()) + +if N % 2 == 0: + M = N/2 + print(M) +else: + M = N/2 + 1 + print(math.floor(M))" +p02759,s321985251,Wrong Answer,"N = int(input()) +N = N / 2 + N % 2 +print(N)" +p02759,s096797638,Wrong Answer,"N = int(input()) +if N%2 == 0: + a = N/2 +else: + a = N//2+1 + +print(a)" +p02759,s150020164,Wrong Answer,"N = int(input()) + +ans = N//2 +ans = ans+1 +print(ans)" +p02759,s342218725,Wrong Answer,"a=int(input()) +if a%2==0: + print(a/2) +else: + print((a+1)/2)" +p02759,s745353075,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N+1/2)" +p02759,s601513062,Wrong Answer,"a = int(input()) +b = a / 2 +c = a % 2 +if c == 1 : + b = b + 0.5 +print(b)" +p02759,s775139962,Wrong Answer,"N=int(input()) +" +p02759,s799591597,Wrong Answer,"x=int(input()) +print(round(x/2))" +p02759,s815374363,Wrong Answer,"n = int(input()) + +if 1 <= n and n <= 100 : + if type(n/2) == int : + page = int(n/2) + elif type(n/2) == float : + page = int(n/2) + 1 + print(page)" +p02759,s244128109,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print((N-1)/2+1)" +p02759,s290585768,Wrong Answer,"N = int(input()) +print(N/2 if N%2==0 else (N+1)/2) +" +p02759,s798129037,Wrong Answer,"n = int(input()) +if n % 2 == 0: + print(n/2) +else: + print(n//2 +1)" +p02759,s719707063,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s668467838,Wrong Answer,"N = int(input()) + +print(N//2)" +p02759,s130902825,Wrong Answer,"N=int(input()) + +if N == 1: + print(1) +elif N == 2: + print(1) +else: + if N % 2 == 1: + print ((N / 2) + 1) + else: + print (N / 2)" +p02759,s225200521,Wrong Answer,"i = int(input()) +j= i/2 +k= i/2 +1 +if (i== k or i==j): + print(int(j))" +p02759,s347557139,Wrong Answer,"N = int(input()) +print(N / 2 + N % 2)" +p02759,s367510474,Wrong Answer," +def main(): + n = int(input()) + if n % 2 == 1: + print(n // 2 + 1) + else: + print(n / 2) + + +if __name__ == ""__main__"": + main() +" +p02759,s498926506,Wrong Answer,"N = input() +if int(N) % 2 == 0: + print(int(N) / 2) +else: + print(int(N) / 2 + 0.5)" +p02759,s089516012,Wrong Answer,"a = int(input()) + +if a%2 == a: + print(a/2) +else: + print(a//2 + 1) +" +p02759,s269003748,Wrong Answer,"import math +n = int(input()) +print(math.ceil(n))" +p02759,s610446592,Wrong Answer,"N = int(input()) + +if N%2==0: + print(N/2) +else: + print((N+1)/2) +" +p02759,s067438641,Wrong Answer,"A = int(input()) +if A%2==1: + A = (A/2)+0.5 +else: + A =A/2 +print(A)" +p02759,s303205873,Wrong Answer,"N = int(input()) +num = N/2 +if N%2==0: + print(num) +else: + print(round(num+0.5)) +" +p02759,s014025645,Wrong Answer,"n = int(input()) +if n % 2 == 0: + print(n / 2) +else: + print((n+1)/2)" +p02759,s386443555,Wrong Answer,"num = input() +num = int(num) + +print(int(num/2))" +p02759,s219996123,Wrong Answer,"N = int(input()) +if N % 2 ==1: + print(N//2 +1) +else: + print(N/2)" +p02759,s145734961,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print(N//2+1)" +p02759,s627931800,Wrong Answer,"N = int(input()) +N=N/2 +print(round(N))" +p02759,s387193913,Wrong Answer,"N = int(input()) +K = N % 2 +S = (N + K) / 2 +print(S)" +p02759,s194968980,Wrong Answer,"n = int(input()) +if n%2 == 0: + print(n//2) +else: + print(n//2) +" +p02759,s257459306,Wrong Answer,"n = int(input()) + +print((n//2)+1)" +p02759,s095111340,Wrong Answer,"n = int(input()) +g = n / 2 +h = n % 2 +print(g + h)" +p02759,s064290989,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N/2) +else: + print(N//2 +1)" +p02759,s530045596,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s093241103,Wrong Answer,"N=int(input()) +print(round(N/2))" +p02759,s390025975,Wrong Answer,"n = int(input()) + +print(round(n/2)) +" +p02759,s334168057,Wrong Answer,"N=int(input()) +print(N/2+N%2)" +p02759,s516197978,Wrong Answer,"N = int(input()) +print(N/2+N%2)" +p02759,s813374985,Wrong Answer,"import math +n = int(input()) + +if n%2 == 0: + print(n/2) +else: + print(math.ceil(n/2))" +p02759,s491739492,Wrong Answer," +def main(): + n = int(input()) + + print((n//2)+1) + + +if __name__ == ""__main__"": + main()" +p02759,s498631067,Wrong Answer,"import math +N = int(input()) +print(math.ceil(N//2))" +p02759,s784112221,Wrong Answer,"hoge = int(input()) +import math +print(math.floor(hoge/2))" +p02759,s897164350,Wrong Answer,"n = int(input()) +print((n+2-1)/2)" +p02759,s731661990,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(n/2) +else: + print(n//2+1)" +p02759,s479815893,Wrong Answer,"N = int(input()) + +print(N // 2 + (0 if N % 2 == 0 else 0)) +" +p02759,s174952722,Wrong Answer,"# -*- coding: utf-8 -*- +N = int(input()) +g = N // 2 +k = ( N + 1 ) // 1 +if N % 2 == 0: + print(g) +else: + print(k)" +p02759,s034073825,Wrong Answer,"N=input() +N=int(N) + +if N%2==1: + N=int(((N-1)/2)+1) + print(N) +else: + N=int(N) + print(N)" +p02759,s274403478,Wrong Answer,"N = int(input()) +print(N//2)" +p02759,s268752337,Wrong Answer,"n = int(input()) + +if n%2 == 0: + print(n/2) +elif n%2 == 1: + print(n/2+1) + +" +p02759,s288711548,Wrong Answer,"N = 23 +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s166984086,Wrong Answer,"a = int(input()) +print((a+1)/2)" +p02759,s402014907,Wrong Answer,"N = int(input()) +if N% 2 ==0: + print(N/2) +else: + print(((N-1)/2)+1) +" +p02759,s648634355,Wrong Answer,"a = int(input()) + +if a % 2 == 0: + num = a / 2 +else: + num = (a + 1) / 2 + +print(num)" +p02759,s561441968,Wrong Answer,"N=int(input()) +if N%2==1: + a=int(N/2) + print(a+1) +else: + b=N/2 + print(b) + " +p02759,s577238126,Wrong Answer,"import sys +import numpy as np + +# input = sys.stdin.readline + +n = int(input()) + +print(round(n))" +p02759,s965791780,Wrong Answer,"num=int(input()) +i=0 +while num>=2*int(i): + i=i+1 +print(i)" +p02759,s826436504,Wrong Answer,"n = int(input()) +if(n%2 == 0):print(n/2) +else:print(int(n/2)+1)" +p02759,s191373001,Wrong Answer,"n = int(input()) + +s = n//2 +t = n%2 + +if t ==1: + print(s+1) +if t ==0: + print(s+1) +" +p02759,s652692100,Wrong Answer,"a = int(input()) + +print(a//2 + 1)" +p02759,s671240865,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s044422244,Wrong Answer,"import math + +N = int(input()) + +number_of_pages = math.floor(N / 2) + +print(number_of_pages) +" +p02759,s536933793,Wrong Answer,"N = int(input()) +if N % 2 ==0: + print(N/2) + +else: + print((N/2)+1)" +p02759,s242161996,Wrong Answer,print(int(input())//2) +p02759,s122433216,Wrong Answer,"# -*- coding: utf-8 -*- +n = int(input()) +if n%2 == 0: + print(int(n/2)) +else: + print(int(n//2))" +p02759,s758094850,Wrong Answer,"N = int(input()) +if N%2: + print(N//2+1) +else: + print(N/2) +" +p02759,s887479703,Wrong Answer,"N=int(input()) +print(N//2)" +p02759,s449683350,Wrong Answer,"n = input() +n = int(n) +if(n%2 == 0): + n= n/2 +else: + n = (n+1)/2 + +print(n)" +p02759,s529491544,Wrong Answer,"#N,K = map(int,input().split()) +N=int(input()) +if N%2==0: + print(N/2) +else: + print(N//2+1) +" +p02759,s076924333,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print((n//2)+1)" +p02759,s853270517,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N/2+1)" +p02759,s088965657,Wrong Answer,print((int(input())+1//2)) +p02759,s533716493,Wrong Answer,"N = int(input()) +ansewr = 0 +if N % 2 != 0 : + answer = N//2 + 1 +else: + answer = N / 2 + +print(answer) + + +" +p02759,s268406615,Wrong Answer,"#A +n = int(input()) +print(n // 2 + 1)" +p02759,s735532694,Wrong Answer,"N = int(input()) + +print(N//2) +" +p02759,s772757281,Wrong Answer,"I=int(input()) + +print(int(I/2))" +p02759,s216150171,Wrong Answer,"N = input() +N = int(N) +num_paper = N / 2 +if (N % 2) > 0: + num_paper += 1 +else: + pass + +print(num_paper) +" +p02759,s132514003,Wrong Answer,"import math +n = int(input()) +print(math.floor(n/2))" +p02759,s060028398,Wrong Answer,"a=int(input()) +b=a//2 +if b==1: + b=b+1 +print(b)" +p02759,s938987217,Wrong Answer,"n = int(input()) + +print(n//2)" +p02759,s791376713,Wrong Answer,"from sys import stdin + +N = stdin.readline().rstrip() +print('Yes' if '7' in N else 'No')" +p02759,s451633910,Wrong Answer,"n = int(input()) + +if n % 2 == 1: + print(int(n // 2 + 1)) +else: + print(n / 2) + +" +p02759,s039227319,Wrong Answer,"N = int(input()) +print(N // 2)" +p02759,s021088251,Wrong Answer,"N=int(input()) +if N % 2==0: + print(N/2) +else: + print(N/2+0.5)" +p02759,s137530646,Wrong Answer,"N = int(input()) +print(N // 2)" +p02759,s097219988,Wrong Answer,"n = int(input()) + +print(round(n/2)) +" +p02759,s339796674,Wrong Answer,"N = int(input()) +if N % 2 == 0: + p = N/2 +else: + p = N//2 + 1 +print(p)" +p02759,s409068221,Wrong Answer,"n=int(input()) +print(round((n+1)/2))" +p02759,s955082821,Wrong Answer,"n = int(input()) +print(n // 2)" +p02759,s007022652,Wrong Answer,"N=int(input()) +if N%2==0: + print(str(N/2)) +else: + print(str(N//2+1))" +p02759,s212209347,Wrong Answer,"n = int(input()) + +if(n%2==0): + print(n/2) +else: + print((n+1)/2)" +p02759,s880856953,Wrong Answer,"N = int(input()) +print(N // 2 + 1)" +p02759,s871524556,Wrong Answer,"s=input() +a=int(s) +d=a/2 +e=(a+1)/2 + +if a%2==0: + print(d) +else : + print(e)" +p02759,s625670803,Wrong Answer,"n=int(input()) +print(n/2)" +p02759,s319285907,Wrong Answer," +n = int(input()) +print(n//2)" +p02759,s896975446,Wrong Answer,"N=int(input()) +mod=N%2 +if(mod==0): + num=N/2 + print(num) +elif(mod==1): + num=N/2 + print(round(num+0.5)) +" +p02759,s557407442,Wrong Answer,"n = input() +if n % 2 == 0: + print n % 2 +else: + print n % 2 + 1" +p02759,s230402131,Wrong Answer,"x = int(input()) +ans = x//2 +if (x&2==1): + x += 1 +print(ans)" +p02759,s633707663,Wrong Answer,"a=int(input()) +if a%2==0: + ans=a/2 +else: + ans=(a-1)/2+1 +print(ans)" +p02759,s452372050,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(n / 2) +else: + print(n // 2 + 1)" +p02759,s686663665,Wrong Answer,"#!/usr/bin/env python +# -*- coding: utf-8 -*- + +N=int(input()) + +if N%2==0: + print(N/2) +else: + print((N+1)/2)" +p02759,s021873678,Wrong Answer,print(int(input())//2) +p02759,s991133653,Wrong Answer,"user_input = int(input(""Enter docs: "")) +check = user_input % 2 +if check == 0: + print(user_input//2) +else: + print(user_input//2 + check) + +" +p02759,s559019368,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +if not n%2==0: + print(n/2+1)" +p02759,s188577401,Wrong Answer,print(int(int(input())+1/2)) +p02759,s701709827,Wrong Answer,"def resolve(): + N = int(input()) + print(N//2 if N%2==0 else N//2+1)" +p02759,s632539404,Wrong Answer,"N = int(input()) +if N % 2 != 0: + ans = (N//2)+1 +if N % 2 == 0: + ans = (N/2) +print(round(ans,N))" +p02759,s661121008,Wrong Answer,int(int(input())/2+0.5) +p02759,s926163410,Wrong Answer,"N = int(input()) +print(N/2) if N%2==0 else print(N//2+1)" +p02759,s338674191,Wrong Answer,"n = int(input()) +print((n/2)+1)" +p02759,s998172146,Wrong Answer,"N = int(input()) + +if N % 2 == 0 : + print(N/2) +else : + print(int(N/2) + 1)" +p02759,s529292425,Wrong Answer,"N=int(input()) +M=N+1 + +if N %2 ==0: + print(N/2) +else: + print(M/2)" +p02759,s358498469,Wrong Answer,print(int(input())//2) +p02759,s497363058,Wrong Answer,"a = int(input()) +b = a / 2 +c = a % 2 +if c == 1 : + b = b + 0.5 +print(b)" +p02759,s397276714,Wrong Answer,"page = int(input()) +paper = page // 2 +print(paper)" +p02759,s169699972,Wrong Answer,"import sys +N = int(input()) + 1 +ans = N / 2 + +print(ans)" +p02759,s654209976,Wrong Answer,"print(max(round(float(input())/2),1))" +p02759,s396597625,Wrong Answer,"n = int(input().strip()) +print(n+1//2)" +p02759,s413176905,Wrong Answer,"N = int(input()) +print(N//2+1)" +p02759,s959439527,Wrong Answer,"n = int(input()) +ans = n % 2 + ((n % 2) * 1) +print(ans) +" +p02759,s856849181,Wrong Answer,"n = int(input()) +if n % 2 ==0 : + print(n / 2) +elif n % 2 == 1 : + print(n / 2 + 1)" +p02759,s106696106,Wrong Answer,"import math +print(math.ceil(int(input())))" +p02759,s519157312,Wrong Answer,"N=int(input()) + +if N%2==0 : + print(N/2) +else : + print(N//2+1)" +p02759,s390132946,Wrong Answer,"N = int(input()) + +if N%2==0: + print(N/2) +else: + print((N+1)/2)" +p02759,s717103479,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print ((N+1)/2)" +p02759,s102916964,Wrong Answer,"N = int(input()) + +A = N // 2 + 1 +print(N)" +p02759,s287696486,Wrong Answer,"def math(N): + if N%2==0: + return N//2 + else: + return (N+1)//2" +p02759,s750458120,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print(int(n/2)+1)" +p02759,s501589081,Wrong Answer,"N = int(input()) +if N % 2 == 1: + print((N//2) + 1) +else: + print(N/2)" +p02759,s973748637,Wrong Answer,"N = input() +M = int(N) +jud = M % 2 +if jud == 1: + ans = M // 2 + 1 +else: + ans = M / 2 +print(ans)" +p02759,s207990488,Wrong Answer,"n = int(input()) +print(int(n/2)) +" +p02759,s661140279,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print(N//2 +1)" +p02759,s117315377,Wrong Answer,"import math + +n = input() +N=int (n) +print(math.ceil(N/2))" +p02759,s580048419,Wrong Answer,"n = int(input()) + +print(n % 2) +" +p02759,s216262970,Wrong Answer,"n = int(input()) +if n != int or n < 0 or n > 100: + pass +else: + x = n / 2 + r = n % 2 + if r != 0 : + print(x+r) + else: + print(x) + + " +p02759,s513943525,Wrong Answer,"N = int(input()) +print(N/2 if N % 2 == 0 else N//2 + 1)" +p02759,s944458138,Wrong Answer,"n=int(input()) +if n%2==1: + print(n/2+1) +else: + print(n/2)" +p02759,s061988041,Wrong Answer,"n = int(input()) +print(n/2 if n%2==0 else n//2+1)" +p02759,s486766480,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N) +else: + print(N+1) + " +p02759,s898698776,Wrong Answer,"N = int(input()) + +print(round(N/2))" +p02759,s415639975,Wrong Answer,"N = int(input()) + +print(round(N / 2))" +p02759,s509405085,Wrong Answer," +a = int(input()) +print(int(a/2)+1)" +p02759,s397886783,Wrong Answer,"import math +N = int(input()) +print(math.ceil(N)) +" +p02759,s330906921,Wrong Answer,"S = int( input() ) +if S % 2 == 0: + print( S / 2 ) +else: + print(S // 2 + 1)" +p02759,s250927630,Wrong Answer,"import math + +def main(): + n = int(input()) + + if n % 1 == 0: + print(n/2) + + else: + print(n/2 + 1) + + +main()" +p02759,s591684148,Wrong Answer,"n = int(input()) + +print(n//2+1)" +p02759,s463722955,Wrong Answer,"N = int(input()) +print( N//2 + 1)" +p02759,s667439451,Wrong Answer,"N = input() +print(N)" +p02759,s145272196,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(n/2) +else: + print(n/2 + 1)" +p02759,s666523613,Wrong Answer,"N=int(input()) +print(N//2) +" +p02759,s209822466,Wrong Answer,"n=input() +if n % 2==0: + print n +else: + print (n//2)+ 1" +p02759,s473374399,Wrong Answer,"i = int(input()) + +if i // 2 == 0: + print(int(i/2)) +else: + print(int(i/2 + 1))" +p02759,s311382656,Wrong Answer,"n = int(input()) +if n%2==0: + print(n/2) +else: + print(n/2+1)" +p02759,s183158755,Wrong Answer,"n = int(input()) +print(int(n/2)+1)" +p02759,s498022724,Wrong Answer,"n = int(input()) +ans = 0 + +if n % 2 == 1: + ans = n // 2 + 1 +else: + ans == n // 2 +print(ans)" +p02759,s345590234,Wrong Answer,"a=int(input()) +if (a % 2) == 0: + print(a / 2) +elif (a % 2) == 1: + print((a / 2) + 1)" +p02759,s535117992,Wrong Answer,"N = int(input()) +if N%2 ==0: + print(N%2) +if N%2 ==1: + N = N//2+1 + print(N)" +p02759,s794738940,Wrong Answer,"x =int(input()) +print(int(x/2))" +p02759,s116488393,Wrong Answer,"N = int(input()) + +print(N // 2) +" +p02759,s289798793,Wrong Answer,"num = int(input()) // 2 +print(num) +" +p02759,s323488113,Wrong Answer,"N = int(input()) +n = round(N/2) +print(n)" +p02759,s787210799,Wrong Answer,"n= int(input()) +print(n//2 + 1)" +p02759,s344228518,Wrong Answer,"N=int(input()) +from math import ceil +print (ceil(N//2))" +p02759,s827683642,Wrong Answer,"n = int(input()) +print(n/2 if n % 2 == 0 else (n+1)/2)" +p02759,s832132581,Wrong Answer,"N = int(input()) +print(N/2 if N%2==0 else N/2+1)" +p02759,s810884022,Wrong Answer,"N=input() +N=int(N) + +ans=0 +print(N) + +if N>=1 and N<=100 : + ans =N/2 + if N%2==1: + ans = ans+1 + +print(int(ans)) +" +p02759,s002581532,Wrong Answer,"N = int(input()) + +p = N//2+1 + +print(p)" +p02759,s161580030,Wrong Answer,"N = int(input()) +print(N//2+1)" +p02759,s044526535,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print((N//2)+1)" +p02759,s527017639,Wrong Answer,"n=int(input()) +p = n // 2 +if p: + print(p+1) +else: + print(p)" +p02759,s787035151,Wrong Answer,"n = int(input()) +if n % 2 == 0: + ans = n/2 + print(ans) +else: + ans = (n+1)/2 + print(ans) +" +p02759,s281592859,Wrong Answer,"N = int(input()) +print (N//2)" +p02759,s592265915,Wrong Answer,"N = int(input()) +P = N//2 + 1 +print(P)" +p02759,s440276780,Wrong Answer,"n=int(input()) + +if n % 2 ==0: + print(n/2) +else: + print((n-1)/2+1)" +p02759,s193777922,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print(N//2 + 1)" +p02759,s210667747,Wrong Answer,print(round(float(input())/2)) +p02759,s704188604,Wrong Answer,"N=int(input()) +print(N//2+1)" +p02759,s501169077,Wrong Answer,"N=int(input()) +if N%2==0: + print(N) +else : + print(N+1)" +p02759,s013428450,Wrong Answer,"n = int(input()) + +if n % 2 == 1: + print(n // 2 + 1) +else: + print(n / 2)" +p02759,s205539890,Wrong Answer," +n = int(input()) + +if n%2 == 1: + print(n//2 + 1) +else: + print(2//n) +" +p02759,s077049654,Wrong Answer,"m = int(input()) + +# n = list(map(int, input().split())) +print(m//2) +" +p02759,s524484168,Wrong Answer,"N=int(input()) +print(N//2+1)" +p02759,s100975409,Wrong Answer,"n = int(input()) +ans = round(n / 2) +print(ans)" +p02759,s434565678,Wrong Answer,"n = int(input()) +if n%2 ==0: + print(n/2) +else: + print(n//2)" +p02759,s657534691,Wrong Answer,"N = int(input()) +print(N//2)" +p02759,s064969621,Wrong Answer,"N = int(input()) +if N%2==0: + print(N/2) +else: + print((N+1)/2)" +p02759,s643178684,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N / 2) +else: + print(N/2+1)" +p02759,s826615436,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(int(N/2)+1)" +p02759,s036604519,Wrong Answer,"n = int(input()) + +if n % 2 ==0: + print(n/2) +else: + print((n+1)/2) + " +p02759,s421827089,Wrong Answer,"n = int(input()) +if n%2 == 0: + print(n/2) +else: + print(n/2+1)" +p02759,s099392265,Wrong Answer,"N = int(input()) + +if N == 1: + print(N) +else: + print((round(N/2)))" +p02759,s176643257,Wrong Answer,"s = int(input()) +print(s/2 if s%2 == 0 else int(s/2)+1)" +p02759,s834133290,Wrong Answer,"n=int(input()) +import math +print(math.ceil(n))" +p02759,s902526812,Wrong Answer,"N = int(input()) +print(round(N/2))" +p02759,s842536548,Wrong Answer,"n = int(input()) + +if n%2 == 0: + print(n/2) +else: + print(n/2+1)" +p02759,s367002419,Wrong Answer,"pages=int(input()) +papers=round(pages/2 + pages%2) + +if pages%2==0: + print(papers) +else: + print(papers-1) +" +p02759,s164938519,Wrong Answer,"n=int(input()) +print(int((n+0.5)/2))" +p02759,s333282005,Wrong Answer,print(int(input())//2+1) +p02759,s159750362,Wrong Answer,"N = int(input()) +if N // 2 != 0: + ans = (N // 2)+(N % 2) +else: + ans = N // 2 +print(ans)" +p02759,s546698344,Wrong Answer,"N = int(input()) + +if N%2 == 0: + print(N/2) +else: + print(N/2 + 1)" +p02759,s023663398,Wrong Answer,"import sys +import math + +for line in sys.stdin.readline(): + n = float(line.rstrip()) + ans = math.ceil(n / 2) + print(ans, end="""") + break" +p02759,s596029549,Wrong Answer,"a = int(input()) +print(a//2)" +p02759,s590854180,Wrong Answer,"N = int(input()) +a=N/2 +b=N%2 +if b == 0: + print(a) +elif b == 1: + print(a+0.5) +else: + print(""error"") + " +p02759,s563744092,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print (N / 2) +else: + print((N/2) + 1)" +p02759,s031057848,Wrong Answer,"N=int(input()) +if N%2 == 0: + print(N/2) +else: + print(N//2 + 1)" +p02759,s354860461,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print(n/2+1)" +p02759,s833129598,Wrong Answer,"a=int(input()) +b=a//2+1 +print(b)" +p02759,s280240090,Wrong Answer,"#A +N = int(input()) +if N//2 ==0: + print(N//2) +else: + print(N//2+1)" +p02759,s216675089,Wrong Answer,"n = int(input()) + +print(int(n/2)) +" +p02759,s399768681,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N//2+1)" +p02759,s746644474,Wrong Answer,"N=int(input()) +print(N+1//2)" +p02759,s310225397,Wrong Answer,"first = input() +N = int(first) +N /=2 +N+=1 +N = int(N) +print(N)" +p02759,s401188444,Wrong Answer,"N=10 +k=N%2 +if k==0: + print(round(N/2.0)) +else: + print(round(N/2+1/2.0))" +p02759,s370731950,Wrong Answer,"n = int(input()) +if n % 2 == 0: + print(n//2+1) +else: + print(n//2)" +p02759,s179474009,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N/2) +else: + print(N/2 + 1)" +p02759,s307604797,Wrong Answer,"input = int(input(""Enter N number: "")) +if input >= 1 and input <= 100: + result = input - input // 2 + print(result) +else: + print('Invalid input') +" +p02759,s562215261,Wrong Answer,"N=int(input()) +S=int(N/2) +print(S)" +p02759,s219942131,Wrong Answer,"n = int(input()) + +print(int(round(n/2))) +" +p02759,s691312335,Wrong Answer,"n = int(input()) +ans = n / 2 +print(ans)" +p02759,s730086532,Wrong Answer,"n = int(input()) +if n != int and (n < 0 or n > 100): + pass +else: + x = n / 2 + r = n % 2 + if r != 0 : + print(x+r) + else: + print(x)" +p02759,s377239733,Wrong Answer,"n = int(input()) +print((n+1) / 2) +" +p02759,s467022966,Wrong Answer,"x = int(input()) +print(int(x/2)+1)" +p02759,s932005419,Wrong Answer,"n = input() +a = int(n) +b = a//2+1 +print(b)" +p02759,s433882586,Wrong Answer,"def main(): + x = input() + if(x % 2 == 0): + print(x//2) + else: + print(x//2 + 1) + +if __name__ == 'main__': + main() +" +p02759,s673638524,Wrong Answer,"N=int(input()) + +if N%2==1: + print(N//2+1) + +else: + print(N/2)" +p02759,s513238732,Wrong Answer,"n = int(input()) +if n % 2 == 0: + print(n/2) +else: + print((n+1)/2)" +p02759,s681893124,Wrong Answer,"N = input() +if int(N) % 2 == 0: + print(int(N) / 2) +else: + print(round(int(N) / 2 + 0.5))" +p02759,s787814461,Wrong Answer,"n = int(input()) +if n % 2 ==0: + print(n % 2) +else: + print(n % 2 + 1)" +p02759,s395199905,Wrong Answer,"n = int(input()) +if n%2 == 0: + print(n/2) +else: + print(int(2*n+1)/2) +" +p02759,s441765445,Wrong Answer,"x = int(input()) +pagenum = x//2 + 1 +print(pagenum)" +p02759,s935214704,Wrong Answer,"doc = int(input('')) +if doc % 2 == 0 : + print ( doc / 2 ) +else : + print (doc / 2 + 0.5 ) +" +p02759,s644466650,Wrong Answer,"n = int(input()) + +print(int(n/2)+1) +" +p02759,s221308735,Wrong Answer,"N = int(input()) +xx = 0 +if N % 2 == 1: + xx = (N / 2) + 1 +else: + xx = (N / 2) +print(xx) +" +p02759,s542259932,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print((N+1)/2) +" +p02759,s661778133,Wrong Answer,"N=int(input()) + +if N%2==0: + print(N/2) +else: + print(int(N/2)+1)" +p02759,s304117129,Wrong Answer,"N = int(input()) +mod = N % 2 +if mod == 0: + n = N/2 + print(n) +else: + n =(N+1)/2 + print(n)" +p02759,s756757038,Wrong Answer,"n=int(input()) +print((n//2)+1)" +p02759,s315833637,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +elif n%2==1: + print((n+1)/2) +" +p02759,s080543162,Wrong Answer,"N = input() +temp = int(N) % 2 +if temp == 0: + print(int(N)/2) +else: + print((round(int(N)/2)+1))" +p02759,s769980635,Wrong Answer,"N = int(input()) +if N%2 ==0: + print(N/2) +else: + print(N//2+1)" +p02759,s260345938,Wrong Answer,"n = int(input()) +if n%2==0: + print(n/2) +else: + print(int(n/2)+1)" +p02759,s707747628,Wrong Answer,"n = int(input()) +if n%2 ==0: + print(n/2) +else: + print(n//2 + 1) +" +p02759,s599217099,Wrong Answer,"N = int(input()) +print(int(N//2 + 0.5))" +p02759,s438018310,Wrong Answer,"n = int(input()) +print(int(n/2))" +p02759,s659958098,Wrong Answer,"num = int(input()) + +calc = num % 2 + +if calc == 0: + ans = num / 2 + print(str(ans)) +else: + ans = (num - 1) / 2 + 1 + print(str(ans))" +p02759,s065601613,Wrong Answer,"n =int(input()) +if n%2 ==0: + print(n/2) + +else: + print((1+n)/2)" +p02759,s340295987,Wrong Answer,"def main(): + N = int(input()) + print(N % 2) if N % 2 == 0 else print(N % 2 + 1) + + +if __name__ == '__main__': + main() +" +p02759,s820533079,Wrong Answer,print int(raw_input()) /2 +p02759,s636404806,Wrong Answer,"N = int(input()) +if N%2==0: + print(N//2) +if N==1: + print(""1"") +if N==3: + print(""2"") +if N%2==1: + print(N//2+1)" +p02759,s260268784,Wrong Answer,"n = int(input()) + +if (n % 2 == 0): + print(n /2) +else: + print(n // 2 + 1)" +p02759,s987208963,Wrong Answer,"N = int(input()) +print(N/2+N%2)" +p02759,s183040653,Wrong Answer,"n = int(input()) +if n % 2 == 0: + print(n / 2) +else: + print((n + 1) / 2)" +p02759,s226010330,Wrong Answer,"N = int(input()) +ans = 0 +if(N%2 == 0): + ans = N/2 +else: + ans = N/2 + 1 + +print(ans)" +p02759,s640366600,Wrong Answer,"n=int(input()) + +if n/2==0: + print(n/2) +else: + print((n+1)/2)" +p02759,s762295699,Wrong Answer,"k = int(input()) +print((k // 2) + 1)" +p02759,s882783487,Wrong Answer,int(int(input())/2+0.5) +p02759,s489358702,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print(N//2 + 1)" +p02759,s609777031,Wrong Answer,"a = int(input()) +print(a/2 if a % 2 == 0 else a//2+1)" +p02759,s881798073,Wrong Answer,"n=int(input()) +print(n//2)" +p02759,s273695215,Wrong Answer,"n=int(input("""")) +print(n//2+1)" +p02759,s757532558,Wrong Answer,"import math +N = int(input()) +ans = math.ceil(N / 2) +print(ans)" +p02759,s248628859,Wrong Answer,"n=int(input()) +print(n//2+1) +" +p02759,s996084079,Wrong Answer,"N=int(input()) + +if N%2==0: + print(N/2) + +else: + print(round(N/2)+1)" +p02759,s030602037,Wrong Answer,"N = int(input()) + +if N//2 == 0: + print(N / 2) +else: + print((N+1) / 2)" +p02759,s435061287,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +if n%2==1: + print((n+1)/2)" +p02759,s726970550,Wrong Answer,"N = int(input()) +a = N/2 +b = N%2 +print(a+b)" +p02759,s133399352,Wrong Answer,"import math +N = int(input()) +if N % 2 == 0: + p = N/2 +else: + p = math.floor(N/2) + 1 +print(p)" +p02759,s207907163,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +if n%2==1: + print((n+1)/2)" +p02759,s190049173,Wrong Answer,"import math +n = int(input()) +print(math.floor(n+1)/2)" +p02759,s283799822,Wrong Answer,"def q1(N): + if N%2 == 1: + N = N+1 + print(N/2) + " +p02759,s895192024,Wrong Answer,"#-------------------------------------------- +#ライブラリ呼び出し +import sys +import math +#from math import sqrt +#-------------------------------------------- +N = int(input()) +print((N//2)+1)" +p02759,s100869299,Wrong Answer,"#!/usr/bin/env python3 +import collections +import itertools as it +import math +import numpy as np + +# A = input() +# A = int(input()) +# A = map(int, input().split()) +# A = list(map(int, input().split())) +# A = [int(input()) for i in range(N)] +# +# c = collections.Counter() + +print()" +p02759,s259920857,Wrong Answer,"N = int(input()) +print(N//2)" +p02759,s817423272,Wrong Answer,"n = int(input()) +print(n+1//2)" +p02759,s992415827,Wrong Answer,"a = int(input()) +out = round(a/2, 0) +print(int(out))" +p02759,s993764081,Wrong Answer,"n = input() +s = int(n)%2 +if s == 1: + print(int(n)/2 + 1) +else: + print(int(n)/2)" +p02759,s790780465,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print((n+1)/2)" +p02759,s545928679,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print((N/2)+1)" +p02759,s143857199,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s868419378,Wrong Answer,"N = 3 +if N % 2 == 1: + n = N + 1 +else: + n = N +print(int(n / 2))" +p02759,s326498405,Wrong Answer,"N = int(input()) +print(N%2+1)" +p02759,s123646921,Wrong Answer,"a=int(input()) +if a%2==0: + print(a/2) +else: + print(a//2+1)" +p02759,s307521221,Wrong Answer,"N = int(input()) +print(int(N+1)/2)" +p02759,s239927350,Wrong Answer,"import math +N = input() +n = int(N) +math.floor(n/2)" +p02759,s911033090,Wrong Answer,"n = int(input()) +print(n / 2)" +p02759,s750417544,Wrong Answer,"n = int(input()) +if n%2 ==0: + print(n//2) +else: + print(n//2) +" +p02759,s447321018,Wrong Answer,"n = int(input()) +print(n//2+1)" +p02759,s776833020,Wrong Answer,"n = int(input()) +if n % 2 ==0: + print(n / 2) +else: + print(n % 2 + 1)" +p02759,s552535226,Wrong Answer,"N = int(input()) +print(N//2)" +p02759,s128578089,Wrong Answer,"n = int(input()) +print(int(n/2))" +p02759,s533830619,Wrong Answer,"N = int(input()) + +print(N//2)" +p02759,s730800131,Wrong Answer,"N = int(input()) +if(1<=N<=100): + print(int(N/2))" +p02759,s170868150,Wrong Answer,"n=int(input()) +print(round(n/2))" +p02759,s151572241,Wrong Answer,"import math +n=int(input()) +print(math.ceil(n))" +p02759,s183356841,Wrong Answer,"import math +print(int(math.ceil(int(input()))))" +p02759,s390851298,Wrong Answer,"N=int(input()) +if N % 2 ==0: + print(N/2) +else: + print(N//2+1)" +p02759,s254961587,Wrong Answer,print(input()) +p02759,s203337059,Wrong Answer,"N = int(input()) +if N%2 == 0: + print(N/2) +else: + print((N+1)/2)" +p02759,s525929572,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print(N/2+1)" +p02759,s971265416,Wrong Answer,"n=int(input()) +if n%2 == 0: + print(n/2) +else: + print(int(n/2))" +p02759,s960600624,Wrong Answer,"num = int(input()) +a = num/2 + num % 2 +print(a)" +p02759,s667396622,Wrong Answer,"n = int(input()) +print(round(n/2))" +p02759,s649353928,Wrong Answer,"N = int(input()) + +print(N // 2 + (N % 2 if 0 else 1)) +" +p02759,s868589214,Wrong Answer,"n = int(input()) +print(n//2)" +p02759,s285327788,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(int(N/2)+1)" +p02759,s490351015,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N/2) +else: + print((N + 1)/2) +" +p02759,s609180929,Wrong Answer,"N = int(input()) + +if N % 2 != 0: + print((N/2)+1) +else: + print(N/2) +" +p02759,s117337084,Wrong Answer,"def main(): + N = int(input()) + if N%2 == 1: + print((N+1)/2) + else: + print(N/2) +main()" +p02759,s301052621,Wrong Answer,"N = int(input()) +num = N/2 +if N%2==0: + print(num) +else: + print(round(N/2)+1)" +p02759,s819699281,Wrong Answer,"n = int(input()) +ans = n//2 +print(ans)" +p02759,s973853864,Wrong Answer,"n = int(input()) +print((n+1)/2)" +p02759,s298419642,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print((n//2)+1) +" +p02759,s207350714,Wrong Answer,"N = int(input()) +print(N // 2 + 1)" +p02759,s671868810,Wrong Answer,"import math +N=5 +math.floor(N/2)" +p02759,s780486337,Wrong Answer,"N =int(input()) +if N%2 == 0: + print(N/2) +else: + print(int(N/2)+1)" +p02759,s179900594,Wrong Answer,"n = int(input()) +if n // 2: + print(n // 2 + 1) +else: + print(n // 2)" +p02759,s869640145,Wrong Answer,"a = int(input()) +if a%2 == 0: + print(a/2) +else: + print(a//2 +1)" +p02759,s729214533,Wrong Answer,"n = int(input()) +x = n / 2 +r = n % 2 +if r != 0 : + print(int(x+0.5)) +else: + print(x)" +p02759,s278073092,Wrong Answer,"N = int(input()) +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s369287541,Wrong Answer,"N=int(input()) +if(N%2==0): + print(N/2) +else: + print((N+1)/2) +" +p02759,s149033241,Wrong Answer,"import math +n = int(input()) +print(math.ceil(n))" +p02759,s877081674,Wrong Answer,print(int(input())//2+1) +p02759,s568643576,Wrong Answer,"import numpy as np + +N=int(input()) +#a = list(map(int, input().split())) +m = N%2 +if (m == 0): + print(N/2) +else: + print(N/2+1) +#for x in range(0,N,1):" +p02759,s360070249,Wrong Answer,"n = int(input()) +ans = n / 2 + +if n % 2: + print(ans) +else: + print(ans + 1)" +p02759,s347964398,Wrong Answer,"N = int(input()) + +if N % 2 != 0: + print(N/2) +else: + print((N/2)+1)" +p02759,s472776780,Wrong Answer,"N = int(input()) +if N<2: + print(0) +else: + if N%2 == 0: + print(N//2) + else: + print(N//2+1)" +p02759,s733232784,Wrong Answer,"n = int(input()) +print(n // 2 + n % 1)" +p02759,s924087637,Wrong Answer,"N=int(input()) +if N%2==0: + print(round(N/2)) +else: + print(round(N/2)+1)" +p02759,s087610112,Wrong Answer,"a = int(input()) +b = int(a / 4) +if (a % 4 !=0): + b+=1 +print(b) +" +p02759,s509970699,Wrong Answer,"N=int(input()) + +if N%2==0: + print(N/2) + +else: + print(int(N/2)+1)" +p02759,s460078070,Wrong Answer,"N = '1' +if N.isdigit() and int(N) >= 1 and int(N) <= 100: + if int(N) % 2 == 0: + ans = int(N) / 2 + else: + ans = (int(N) - 1) / 2 + 1 + print(int(ans)) +else: + print('error')" +p02759,s704558467,Wrong Answer,"N = int(input()) +if N % 2 == 0: + N /=2 + print(N) +else: + N /=2 + N+=1 + N = int(N) + print(N) +" +p02759,s520025457,Wrong Answer,"n = int(input()) +if n % 2 == 1: + print(int((n-1) / 2)) + exit(0) +print(int(n/2))" +p02759,s752620674,Wrong Answer,"import math +print(math.ceil(int(input()))) +" +p02759,s226233058,Wrong Answer,"n = int(input()) +print(n // 2 + 1 if n % 2 else 0)" +p02759,s547882925,Wrong Answer,"N = int(input()) + +print(N // 2) +" +p02759,s730524046,Wrong Answer,"N = int(input()) +print(int(N/2))" +p02759,s185691039,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(n/2) +else: + print((n//2) +1)" +p02759,s001240716,Wrong Answer,"N = int(input()) +s = N // 2 +print(s) +" +p02759,s032200663,Wrong Answer,"import math + +N=int(input()) +if N%2==0: + print(N/2) +else: + print(math.ceil(N/2))" +p02759,s907596314,Wrong Answer,"N = int(input()) +num = N/2 +nume = N/4 +if N%2==0: + print(num) +else: + print(nume) +" +p02759,s299435978,Wrong Answer,"import math +n = int(input()) +print(math.ceil(n))" +p02759,s802051109,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(int(n/2)) +else: + print(int((n-1)/2)) +" +p02759,s664436883,Wrong Answer,"N = int(input("""")) + +if N % 2 == 0: + print(N/2) + +if N % 2 != 0: + print((N//2)+1)" +p02759,s516936060,Wrong Answer,"a = int(input()) +print(round(a/2))" +p02759,s539984920,Wrong Answer,"def main(): + n = int(input()) + print(round(n/2)) + + +if __name__ == ""__main__"": + main() +" +p02759,s859538941,Wrong Answer,"def main(): + N = int(input()) + print(round((N+1)/2)) + + +if __name__ == '__main__': + main() +" +p02759,s816740240,Wrong Answer,"n = int(input()) + +print((n-1)/2)" +p02759,s828717097,Wrong Answer,"n = int(input()) +print(n//2+1)" +p02759,s019128158,Wrong Answer,"n = int(input()) +print(n // 2)" +p02759,s458421673,Wrong Answer,"N = int(input()) +print(int((N-N%2)/2))" +p02759,s472793184,Wrong Answer,"# coding: utf-8 +# Your code here! + +S = int(input()) + +if S%2==0: + print(S/2) +else: + print((S//2)+1) +" +p02759,s178630902,Wrong Answer,"N = int(input()) +if N%2==0: + print(N/2) +else: + print(int(N/2)+1)" +p02759,s887479601,Wrong Answer,"N=int(input()) + +if N%2==0: + print(N/2) + +elif N%2==1: + print(int(N/2)+1)" +p02759,s165447793,Wrong Answer,"q, mod = divmod(int(input()), 2) +q+=1 if mod == 1 else q +print(q)" +p02759,s243437768,Wrong Answer,"a = [1,2,3,4,5] + [5]*0 +print(a) +exit() + +n,m = map(int,input().split()) +s = [] +c = [] +for i in range(m): + S,C = map(int,input().split()) + s.append(S) + c.append(C) + +num = [1] + [0]*(n-1) +ans = '' + +for i in range(m): + if n!=1 and s[i] == 1 and c[i] == 0: + print(-1) + exit() + elif len(set(s)) < len(set(c)): + print(-1) + exit() + +for i in range(m): + num[s[i]-1] = c[i] + +for i in range(n): + ans += str(num[i]) + +print(ans)" +p02759,s792694027,Wrong Answer,"import math + +n=105 + +print(math.ceil(n/2))" +p02759,s057741634,Wrong Answer,"n = int(input()) + +if n%2 == 0: + print(n/2) +else: + print(n//2 + 1) + +" +p02759,s801022589,Wrong Answer,"N = int(input()) +if N % 2 == 0: + answer = N /2 +else: + answer = (N + 1) / 2 + +print(answer)" +p02759,s836815828,Wrong Answer,"N = int(input()) + +print(-(-N)//2)" +p02759,s462419805,Wrong Answer,"N=int(input()) +print(N//2)" +p02759,s629303275,Wrong Answer,"A = int(input()) +print(A // 2 + 1) +" +p02759,s016204378,Wrong Answer,"import math + +N = int(input()) +ans = 0 + +if(N%2 == 0): + ans = N/2 +else: + ans = math.floor(N/2) + 1 + +print(ans) +" +p02759,s589803967,Wrong Answer,"n = int(input()) +ans = n // 4 if n % 4 == 0 else n // 4 + 1 +print(ans) +" +p02759,s102019180,Wrong Answer,"import sys +import math +import fractions +import itertools +from collections import deque +import copy +import bisect + +MOD = 10 ** 9 + 7 +INF = 10 ** 18 + 7 +input = lambda: sys.stdin.readline().strip() + +N = int(input()) +print(int(N+1//2))" +p02759,s732403929,Wrong Answer,print(int(input())//2+1) +p02759,s256129356,Wrong Answer,"n = int(input()) +if n // 2: + print(n // 2 + 1) +else: + print(n // 2)" +p02759,s074751772,Wrong Answer,"n = int(input()) +m = 0 +if n % 2 == 1: + m = n - 1 + print(m / 2 + 1) +else: + print(n / 2)" +p02759,s759990513,Wrong Answer,"N=int(input()) +print(N/2+1)" +p02759,s879868970,Wrong Answer,"num = int(input()) +print((num/2) + (num%2))" +p02759,s320641421,Wrong Answer,"N = int(input()) +print(N//2+1)" +p02759,s336899788,Wrong Answer,"N = int(input()) + +ans = round(N / 2) + +print(ans)" +p02759,s193707296,Wrong Answer,"N = int(input()) +if N / 2 == N // 2: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s439367717,Wrong Answer,"N = int(input()) + +print(N / 2 if not N % 2 else N // 2+1) + +" +p02759,s646979674,Wrong Answer,print((int(input())+1)/2) +p02759,s262165460,Wrong Answer,"n = int(input()) +if n%2 == 1: + print((n+1)/2) +else: + print(n/2)" +p02759,s371327161,Wrong Answer,"import math +page = int(input(""num: "")) +print(math.ceil(page/2))" +p02759,s853630330,Wrong Answer,"import math + +n = int(input()) +print(math.floor(n / 2))" +p02759,s407396618,Wrong Answer,"n = int(input()) +print(n // 2)" +p02759,s097501015,Wrong Answer,"N = int(input()) +print(""{}"".format((N//2)+1))" +p02759,s230694103,Wrong Answer,"x = int(input()) +print(x / 2 + 1 if x % 2 != 0 else x / 2)" +p02759,s142896020,Wrong Answer,"N = int(input()) + +print(round(N/2)) +" +p02759,s846345671,Wrong Answer,"page = int(input()) +if page%2 == 1: + page+=1 + +answer = page/2 +print(answer)" +p02759,s616575253,Wrong Answer,print(int(input())+1//2) +p02759,s576167175,Wrong Answer,"N=int(input()) +print(N+1//2)" +p02759,s268061437,Wrong Answer,"n = int(input()) +if n/2 == 0: + print(n//2) +else: + print(n//2 + 1)" +p02759,s795090413,Wrong Answer,"import math +N = int(input()) +if( N%2 == 0 ): + print(N/2) +else: + print(math.ceil((N/2)))" +p02759,s353771792,Wrong Answer,"n = int(input()) + +n= n//2 + n%2 + + +n" +p02759,s592150289,Wrong Answer,"def main(N): + if N%2 == 0: + return N/2 + else: + return(N+1)/2 + " +p02759,s069852055,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(n / 2) +else : + print(n // 2 + 1)" +p02759,s568871100,Wrong Answer,"a = int(input()) +print(a/2 if a % 2 == 0 else a/2+1)" +p02759,s634334715,Wrong Answer,"n = int(input()) +print(n/2+n%2)" +p02759,s053715178,Wrong Answer,"n = int(input()) +ans = 0 +if n % 2 == 0: + ans = n / 2 +else: + ans = n / 2 + 1 +print(ans)" +p02759,s271446792,Wrong Answer,"x = int(input()) +if(x%2 == 0): + print(x/2) +else: + print(x/2 +1) + + + " +p02759,s808627101,Wrong Answer,"page = int(input()) +print(round(page/2))" +p02759,s031945623,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print(n//2+1)" +p02759,s561216659,Wrong Answer,"n = int(input()) + +if n % 2 == 0: + print(n/2) +else: + print(n/2+1) +" +p02759,s983359818,Wrong Answer,"N = int(input()) +if N//2 == 0: + print(N//2) +else: + print((N//2)+1)" +p02759,s865669545,Wrong Answer,"N = int(input()) +a = N % 2 +my_result = N + a +print(my_result)" +p02759,s440540986,Wrong Answer,"from math import ceil +n = int(input()) +print(round(n/2))" +p02759,s436833045,Wrong Answer,print(round(int(input())/2 + .5)) +p02759,s597102492,Wrong Answer,"s=input() +a=int(s) +d=a/2 +e=(a+1)//2 + +if a%2==0: + print(d) +else : + print(e)" +p02759,s248229532,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + res = N/2 +else: + res = N//2 + 1 + +print(res)" +p02759,s577308398,Wrong Answer,"N = int(input()) +if (N % 2) == 0: + print(N/2) +else: + print((N + 1)/2) +" +p02759,s538742071,Wrong Answer,"N = input() +N = int(N) + +if N%2==0: + print(int(N/2)) +else: + print(int(round(N/2)+1))" +p02759,s760401764,Wrong Answer,"n = int(input()) +if (n is int) or (n > 0 and n < 100): + x = n / 2 + r = n % 2 + if r != 0 : + print(int(x+0.5)) + else: + print(x)" +p02759,s586606947,Wrong Answer,"N = int(input()) +n = int(N/2) +print(n+1)" +p02759,s053259398,Wrong Answer,"import math +n= int(input()) +print(math.ceil(n)) +" +p02759,s742721092,Wrong Answer,"N = int(input()) +print(N/2+N%2)" +p02759,s036047713,Wrong Answer,"s = input().strip() +s = int(s) + +if s%2 == 0: + print(s/2) +else: + print(int(s/2)+1) +" +p02759,s226917435,Wrong Answer,print((int(input())+1)/2) +p02759,s452871841,Wrong Answer,"n = int(input()) +ans = (n / 2) + 1 +print(ans)" +p02759,s974330786,Wrong Answer,"import math +N = int(input()) + +print(math.ceil(N//2)) +" +p02759,s143181050,Wrong Answer,"print max(int(raw_input())/2,1)" +p02759,s053799428,Wrong Answer,"n = int(input()) +print(n//2) +" +p02759,s268695289,Wrong Answer,"n = int(input()) +ans = 0 + +if n % 2 == 0: + ans = n/2 +else: + ans = int(n/2) + 1 + +print(ans) +" +p02759,s278361557,Wrong Answer,"a = input() +if 'A' in a and 'B' in a: + print(""Yes"") +else: + print(""No"")" +p02759,s999009539,Wrong Answer,"n=int(input()) +print(int(n/2))" +p02759,s314184403,Wrong Answer,"n = int(input()) +if n%2 == 0: + print(n%2) +else: + print(n%2 + 1)" +p02759,s314758878,Wrong Answer,"N=11 +k=N%2 +if k==0: + print(N/2) +else: + print(N/2+0.5)" +p02759,s773931221,Wrong Answer,"n = int(input()) +if n % 2 ==0: + print(n % 2) +else: + print(n // 2 + 1)" +p02759,s296879429,Wrong Answer,"s = int(input()) +print(s/2 + s%2)" +p02759,s819483476,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N//2+1)" +p02759,s662335292,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print(n/2+0.5)" +p02759,s721272686,Wrong Answer,"n =int(input()) + +if n%2: + print((n+1)/2) +else: + print(n/2)" +p02759,s799482435,Wrong Answer,"n = input() +s = int(n)%2 +if s == 1: + print(int(n)/2 + 0.5) +else: + print(int(n)/2) +" +p02759,s636149102,Wrong Answer,"N = int(input()) + +print((round(N/2)))" +p02759,s834534039,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N//2+1)" +p02759,s126220983,Wrong Answer,"import numpy as np + +N = int(input()) + +print(np.ceil(N / 2))" +p02759,s056891746,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print((n+1)/2)" +p02759,s414609552,Wrong Answer,"n=int(input()) + +if n%2==0: + print(n/2) +else: + print(n//2+1)" +p02759,s471615884,Wrong Answer,"N=int(input()) + +if N%2==0: + print(N/2) +else: + print(N//2+1) + + + + + + + + + + +" +p02759,s723888145,Wrong Answer,"N = int(input()) +if N % 2 == 0: + n = N/2 +else: + n = (N+1)/2 +print(n)" +p02759,s893370409,Wrong Answer,"n=int(input()) +if n%2==0:print(n//2) +else:print(n//+1)" +p02759,s056849584,Wrong Answer,"# coding: utf-8 +def main(): + n = int(input()) + if n % 2 == 0: + print(n/2) + else: + print(int(n//2) + 1) + +if __name__ == '__main__': + main()" +p02759,s073409640,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print((N+1)/2) + " +p02759,s610998391,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s947069012,Wrong Answer,"N = int(input()) +print(N//2+1)" +p02759,s843572756,Wrong Answer,"N = int(input()) +result=0 + +if N%2==0: + result = N/2 +else: + result = (N+1)/2 + +print(result)" +p02759,s172051493,Wrong Answer,"N=int(input()) + +if(N%2==0): + print(N/2) +else: + print(int(N/2)+1)" +p02759,s298115068,Wrong Answer,"N = int(input()) +print(round(N / 2))" +p02759,s150021515,Wrong Answer,"n = int(input()) +res = n // 2 +print(res + (res & 2))" +p02759,s797602327,Wrong Answer,"n = int(input()) +a = n / 2 +if n % 2 == 0: + print(a) +else: + print(int(a)+1)" +p02759,s175281560,Wrong Answer,"N=int(input()) +#xs = [int(x) for x in input().split()] + + + + +print(N//2)" +p02759,s740405139,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N/2+1) +" +p02759,s306829682,Wrong Answer,print(int(input())//2+1) +p02759,s527736843,Wrong Answer,"a=int(input()) +if a%2==0: + print(a/2) +else: + print((a+1)/2)" +p02759,s078286481,Wrong Answer,"import math +print(math.ceil(int(input())))" +p02759,s996825452,Wrong Answer," +def main(): + n = int(input()) + print((n+1)/2) + +if __name__ == ""__main__"": + main()" +p02759,s277482395,Wrong Answer,"n = int(input()) + +print(n/2 + n%2)" +p02759,s549542847,Wrong Answer,print(int(input()) // 2) +p02759,s612283736,Wrong Answer,"N = int(input()) +print(N//2+1)" +p02759,s980305766,Wrong Answer,"n=int(input()) +print(int(n//2)+1)" +p02759,s159408933,Wrong Answer,"N = int(input()) +if(N % 2 == 0): + s = N / 2 +else: + s = N // 2 + 1 + +print(s) +" +p02759,s373475242,Wrong Answer,"n = int(input()) +if n % 2 <= 0 : + print(n / 2) +elif n % 2 >= 1 : + print(n // 2 +1) +" +p02759,s579855941,Wrong Answer,"def page(N): + return (N + 1) / 2" +p02759,s588359500,Wrong Answer,"N = int(input()) +check = N % 2 +if check == 0: + answer = N / 2 +else: + answer = (N + 1) / 2 +print(answer)" +p02759,s774963431,Wrong Answer,"n = int(input()) +if n % 2 == 1: + print(n//2 + 1) +else: print(n/2)" +p02759,s593089526,Wrong Answer,"n = int(input()) + +print(round(n/2))" +p02759,s909178484,Wrong Answer,"n=int(input()) +if n%2 == 0: + print(n/2) +else: + print(int(n/2)+1) +" +p02759,s190648279,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print((n+1)/2)" +p02759,s228842413,Wrong Answer,"n = int(input()) +print(n // 2 + 1)" +p02759,s968630561,Wrong Answer,print(-(-int(input()))//2) +p02759,s832217356,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N / 2) +else: + print(N // 2 + 1)" +p02759,s784693652,Wrong Answer,"n=int(input()) + +if n%2==0: + ans=n/2 +else: + ans=n//2+1 +print(ans)" +p02759,s200815116,Wrong Answer,"N = int(input()) + +print(N>>1)" +p02759,s771724218,Wrong Answer,"N = int(input()) + +if N % 2 == 0: + print(N/2) +else: + print(N/2+1)" +p02759,s279942713,Wrong Answer,"import math +n = int(input()) +math.ceil(n/2)" +p02759,s618051450,Wrong Answer,"N=int(input()) +if N%2==0: + print(N/2) +else: + print(N/2+1)" +p02759,s729809574,Wrong Answer,"n=int(input()) +print((n+2-1)/2)" +p02759,s571162981,Wrong Answer,"N=int(input()) +if N%2 == 0: + print(round(N/2)) +else: + print(round(N/2) + 1)" +p02759,s063630500,Wrong Answer,"N = int(input()) +a = N % 2 +my_result = (N + a) / 2 +print(my_result)" +p02759,s361203372,Wrong Answer,"n = int(input()) + +if n%2 == 0: + print(n/2) +else: + print(round(n/2)+1)" +p02759,s020287109,Wrong Answer,"n=int(input()) +if n%2==0: + print(n/2) +else: + print(n//2+1)" +p02759,s862567209,Wrong Answer,"import math +N = int(input()) +print(math.floor(N/2))" +p02759,s615141998,Wrong Answer,"n = int(input()) +a = n // 2 +print(a)" +p02759,s538886201,Wrong Answer,"n = int(input()) +print((n//2)+1)" +p02759,s082751347,Wrong Answer,"N = int(input()) +if N % 2 ==0: + print(N/2) + +else: + print((1+N)/2)" +p02759,s979282148,Wrong Answer,"n=int(input()) + +if 0==n/2: + n=n/2 + print(n) +else: + n=n//2+1 + print(n)" +p02765,s724876999,Accepted,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s354421962,Accepted,"import sys +sys.setrecursionlimit(10**9) +INF=10**18 +MOD=10**9+7 +def input(): return sys.stdin.readline().rstrip() + +def main(): + N,R=map(int,input().split()) + print(R+100*max(0,(10-N))) + +if __name__ == '__main__': + main() +" +p02765,s152228429,Accepted,"import sys +input = sys.stdin.readline + +def main(): + n,r=map(int,input().split()) + if n>=10: + print(r) + else: + print(int(100*(10-n)+r)) + + +if __name__ == '__main__': + main()" +p02765,s782354911,Accepted,"n, r = input().split() +n = int(n) +r = int(r) + +if n > 10: + print(r) + +else: + print((10 - n)* 100 + r) +" +p02765,s011175133,Accepted,"# cook your dish here +a,b=map(int,input().split()) +if(a>=10): + print(b) +else: + print((10-a)*100+b)" +p02765,s292607698,Accepted,"def main(n, r): + if n >= 10: + print(r) + else: + print(r + 100 * (10 - n)) + + +if __name__ == ""__main__"": + n, r = map(int, input().split()) + + main(n, r) +" +p02765,s253205198,Accepted,"a,b=input().split() +a=int(a) +b=int(b) +if a>=10: + print(b) +else: + c=b-100*a+1000 + print(c) +" +p02765,s076979519,Accepted,"N, R = map(int, input().split()) + +ans = 100*(10-N)+R +if N>=10: + print(R) +else: + print(ans)" +p02765,s258243127,Accepted,"[N,R] = list(map(int,input().split())) +if N>=10: + I=R #内部レーティング + +else: + I=R+100*(10-N) +print(I) + " +p02765,s928675202,Accepted,"N, R = map(int, input().split()) +if N < 10: + n2=100*(10-N) + R2 = R+n2 + +elif N >= 10: + R2 = R + +print(R2)" +p02765,s317018749,Accepted,"N,R = map(int,input().split()) +if N>=10: + Ans = R +else: + Ans = R+100*(10-N) +print(Ans)" +p02765,s165252564,Accepted,"N, R = map(int, input().split()) + +if N < 10: + print(R + 100*(10-N)) +else: + print(R)" +p02765,s009580166,Accepted,"N, R= map(int, input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s792529698,Accepted,"n, r = list(map(int,input().split())) +if n >= 10: + print(r) +else: + temp = 100 * (10 -n) + print(r + temp)" +p02765,s764355641,Accepted,"n, r = map(int, input().split()) +print( r+100*max(0, 10-n) )" +p02765,s898816375,Accepted,"n,r=map(int,input().split()) +if n>=10:print(r) +else:print(r+(100*(10-n)))" +p02765,s668833161,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s713326035,Accepted,"line = list(map(int,input().split())) +if line[0] >= 10: + print(line[1]) +else: + print(line[1] + (100 * (10 - line[0])))" +p02765,s428073532,Accepted,"n,r = list(map(int,input().split())) +if n >= 10: + print(r) +else: + print(r + (100 * (10-n)))" +p02765,s423250666,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s295624966,Accepted,"n,r=map(int,input().split()) +ans = r +if n<10: + ans = r+100*(10-n) +print(ans)" +p02765,s525269394,Accepted,"n, r = map(int, input().split()) +print(r + max(1000 - 100 * n, 0))" +p02765,s078083584,Accepted,"N,R=map(int, input().split()) +if N>=10: + print(R) +if 0<=N<10: + print(R+100*(10-N))" +p02765,s324401801,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s886212504,Accepted,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+(100*(10-n))) + +" +p02765,s926634308,Accepted,"a,b=input().split() +if int(a)>=10: + c=b +else: + c=int(b)+100*(10-int(a)) +print(c) +" +p02765,s838860027,Accepted,"x,y=map(int,input().split()) +if 0<=x<10 : + z=100*(10-x) + a=y+z +elif 10<=x : + a=y +print(a)" +p02765,s899992931,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + ans = r +else: + ans = 100 * (10 - n) + r + +print(ans)" +p02765,s675131625,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + answer = R +else: + answer = R + 100*(10 - N) + +print(answer)" +p02765,s172691702,Accepted,"n, r = map(int, input().split()) +ans = r + 100 * (10 - min(10, n)) +print(ans)" +p02765,s175430193,Accepted,"n, r=map(int,input().split()) +if n<10: + print(100*(10-n)+r) +else: + print(r)" +p02765,s939093084,Accepted,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+(10-n)*100)" +p02765,s847991748,Accepted,"x = input().split() +N = int(x[0]) +R = int(x[1]) + +if N >= 10: + print(R) +else: + print(R+ 100*(10-N))" +p02765,s058216953,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + rev = 100 * (10 - N) + print(R + rev)" +p02765,s027856445,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s328358046,Accepted,"N,R=map(int,input().split()) + +ans=R+(100*(10-N)) + +if N>=10: + print(R) +else: + print(ans)" +p02765,s066627966,Accepted,"n,r = map(int,input().split()) + +if n >= 10 : + print(r) + +else: + print(r + 100 * (10 - n))" +p02765,s753022655,Accepted,"N,R = map(int, input().split()) +ans = 100*(10-N)+R +if N>=10: + print(R) +else: + print(ans)" +p02765,s327498899,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R+(100*(10-N)))" +p02765,s523854511,Accepted,"n, r = list(map(int, input().split())) +print(r if n >= 10 else r + (100 * (10 - n)))" +p02765,s012409288,Accepted,"n, r = map(int, input().split()) +print(r if n >= 10 else 100 * (10 - n) + r)" +p02765,s194395180,Accepted,"import os + +def main(): + a=[int(x) for x in input().split()] + if a[0] >= 10: + print(a[1]) + else: + num = 100*(10-a[0]) + print(num + a[1]) + +if __name__ == ""__main__"": + main()" +p02765,s775287303,Accepted,"N, R = map(int, input().split()) + +if N<= 10: + print(R+100*(10-N)) +else: + print(R)" +p02765,s108354120,Accepted,"#!/usr/bin/env python3 +# %% +stdin = open(0) + +# %% +N,R = map(int, stdin.read().split()) +if N >= 10: + answer = R +else: + answer = R + 100 * (10-N) + +# %% +print(answer) + +# %% +" +p02765,s729298081,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r+1000-100*n) + " +p02765,s559117032,Accepted,"N, R = map(int, input().split()) +if N > 10: + print(R) +else: + print(R+100*(10-N)) +" +p02765,s162345977,Accepted,"#python3 + +def main(): + n,r = map(int, input().split()) + if n>=10: + print(r) + else: + print(r+100*(10-n)) +main() +" +p02765,s611501277,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + ans = r +else: + ans = r + 100*(10-n) +print(ans)" +p02765,s576759201,Accepted,"n,r=map(int,input().split()) +print(max(0,10-n)*100+r)" +p02765,s864514760,Accepted,"n,r = map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-n)) + +" +p02765,s913387451,Accepted,"N, R = map(int, input().split()) + +if N >= 10 : + print(R) +else : + print(R + 100 * (10 - N))" +p02765,s999630595,Accepted,"N, R = map( int, input().split() ) + +if N >= 10: + print( R ) +else: + print( R + 100 * ( 10 - N ) )" +p02765,s942213076,Accepted,"# -*- coding: utf-8 -*- +N, R = map(int, input().split()) + +print(100 * (10 - N) + R if N < 10 else R)" +p02765,s402174806,Accepted,"# -*- coding: utf-8 -*- +n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s108061562,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r + 1000 - 100 * n)" +p02765,s005967927,Accepted,"import sys +readline = sys.stdin.readline + +N, R = map(int, readline().split()) + +ans = None +if N >= 10: + ans = R +else: + ans = R + 100*(10 - N) +print(ans)" +p02765,s470211475,Accepted,"N, R= [int(item) for item in input().split()] + +if N >= 10: + ans = R +else: + ans = 100 * (10 - N) + R + +print(ans)" +p02765,s799991359,Accepted,"N, R = map(int, input().split()) + +if N < 10: + print(100*(10-N) + R) +else: + print(R) + " +p02765,s673490081,Accepted,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s120531845,Accepted,"n,r=map(int,input().split()) +ra=r +if n<=10: + ra=ra+1000-100*n +print(ra)" +p02765,s902934072,Accepted,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s230759365,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + r = R + 100 * (10 - N) + print(int(r))" +p02765,s888341167,Accepted,"N, R = map(int, input().split()) +if N < 10: + R += 100*(10-N) +print(R) +" +p02765,s606127532,Accepted,"n, r = map(int, input().split()) + +print(r + max(10 - n, 0) * 100) +" +p02765,s368215712,Accepted,"N,R=map(int,input().split()) +if N >= 10: + print(R) +else: + print(R+(100*(10-N))) +" +p02765,s866558124,Accepted,"N,R=map(int,input().split()) +if N<10: + print(R+100*(10-N)) +else: + print(R)" +p02765,s814502375,Accepted,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s770975733,Accepted,"N, R = list(map(int, input().split())) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s548051540,Accepted,"N,R = map(int,input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s902755516,Accepted,"N, R = map(int, input().split()) + +if N>=10: + print(R) +else: + s = 100*(10-N) + #print(s) + print(R + s)" +p02765,s089900743,Accepted,"a = input().split() +if int(a[0]) > 10: + print(int(a[1])) +else: + print(int(a[1]) + 100*(10 - int(a[0])))" +p02765,s006952360,Accepted,"N, R = map(int, input().split()) + +if N < 10: + answer = R + 100 * (10 - N) + print(answer) +else: + print(R) +" +p02765,s227540308,Accepted,"n, r = map(int, input().split()) + +print(r if n >= 10 else r + 100 * (10 - n))" +p02765,s703205165,Accepted,"n,r = (map(int, input().split())) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s928313666,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s908441837,Accepted,"N,R =map(int,input().split()) + +print(R if N>=10 else R+100*(10-N)) +" +p02765,s850531587,Accepted,"n, r = map(int, input().split()) +if n < 10: + res = 100 * (10 -n) + r +else: + res = r +print(res) +" +p02765,s026577785,Accepted,"# import numpy as np +# import math +# import copy +# from collections import deque +import sys +input = sys.stdin.readline +# sys.setrecursionlimit(10000) + + +def main(): + N,R = map(int,input().split()) + + if N >= 10: + res = R + else: + res = R + 100 * (10 - N) + + print(res) + + + +main() +" +p02765,s076050705,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s996986308,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s301275890,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print((R + 100 * (10 - N))) +" +p02765,s208916862,Accepted,"def main(): + inside_rate, outside_rate = map(int, input().split()) + correction = 0 + if inside_rate < 10: + correction = 100 * (10 - inside_rate) + print(outside_rate + correction) +main()" +p02765,s591969273,Accepted,"n,r = map(int,input().split()) +if n < 10: + h = 100*(10-n) + print(r+h) +else: + print(r) +" +p02765,s790896154,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + ans = r +else: + ans = r + 100*(10-n) + +print(ans)" +p02765,s919303852,Accepted,"n, r = map(int, input().split()) + +if (n >= 10): + print(r) +else: + print(r+100*(10-n))" +p02765,s001494055,Accepted,"N, R = map(int, input().split()) +print(R) if N >= 10 else print(R+(100*(10-N)))" +p02765,s042712502,Accepted,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R + 100*(10-N))" +p02765,s024133780,Accepted," +import sys + +# 再起回数上限変更 +sys.setrecursionlimit(1000000) + +N, R = map(int, input().split()) + +if N >= 10: + print(R) + sys.exit() + +print(R + 100 * (10 - N)) +" +p02765,s834015526,Accepted,"i = list(map(int, input().split())) +if 1 <= i[0] and i[0] <= 100: + N = i[0] +else: + print('N is invalid value.') +if 0 <= i[1] and i[1] <= 4111: + R = i[1] +else: + print('R is invalid value.') + +if N < 10: + rate = R + (100 * (10 - N)) +else: + rate = R + +print(rate)" +p02765,s468394737,Accepted,"import sys +import math +import bisect + +def main(): + n, m = map(int, input().split()) + if n < 10: + m += 100 * (10 - n) + print(m) + +if __name__ == ""__main__"": + main() +" +p02765,s640253301,Accepted,"# coding:utf-8 + +import sys +import math +import time +#import numpy as np +import collections +from collections import deque +import queue +import copy + + +#X = str(input()).split() +#a = [int(x) for x in input().split()] + + +NR = str(input()).split() +N = int(NR[0]) +R = int(NR[1]) +if(N>=10): + ans = R +else: + ans = R+100*(10-N) + + +print(ans) + +" +p02765,s493969621,Accepted,"import bisect, collections, copy, heapq, itertools, math, string +import sys +def I(): return int(sys.stdin.readline().rstrip()) +def MI(): return map(int, sys.stdin.readline().rstrip().split()) +def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) +def S(): return sys.stdin.readline().rstrip() +def LS(): return list(sys.stdin.readline().rstrip().split()) + +from collections import defaultdict +import bisect +def main(): + N, R = MI() + if N >= 10: + print(R) + else: + print(R + 1000 - 100 * N) + +if __name__ == ""__main__"": + main() +" +p02765,s650826237,Accepted,"a = list(map(int, input().split())) + +if a[0] >= 10: + print(a[1]) +else: + print(a[1] + 100 * (10 - a[0]))" +p02765,s847276247,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s073664349,Accepted,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s227566606,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s392830153,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r + (100*(10-n)))" +p02765,s819435602,Accepted,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s841917861,Accepted,"N, R = map(int, input().split()) + +#%% +if N >= 10: + ans = R +else: + ans = R + 100 * (10 - N) + +print(ans)" +p02765,s305995263,Accepted,"from collections import defaultdict, deque +import sys +import heapq +import bisect +import math +import itertools +import string +import queue +import copy +import time +# import numpy as np +from fractions import gcd + +sys.setrecursionlimit(10**8) +INF = float('inf') +mod = 10**9+7 +eps = 10**-7 + +def inp(): return int(sys.stdin.readline()) + +def inp_list(): return list(map(int, sys.stdin.readline().split())) + +def lcm(x, y): return (x * y) // gcd(x, y) + + +N, R = inp_list() +I = 0 +if N >= 10: + I = R +else: + I = R + 100 * (10 - N) +print(I) +" +p02765,s963244344,Accepted,"n,r=map(int,input().split()) +ans=r + +if n <10: + ans= r + (100*(10-n)) + +print(ans)" +p02765,s543405925,Accepted,"n, r = map(int, input().split()) + +if n < 10: print(100*(10-n)+r) +else: print(r)" +p02765,s995259745,Accepted,"def InnerRating(N, R): + if N >= 10: + return R + else: + return R + 100 * (10 - N) + +N, R = map(int, input().split()) +print (InnerRating(N, R))" +p02765,s128032276,Accepted,"k,r = map(int,input().split()) +if k>=10: + print(r) +else: + print(r+100*(10-k))" +p02765,s677121085,Accepted,"if __name__ == '__main__': + N, R = map(int, input().split()) + + if N < 10: + R += 100 * (10-N) + + print(R)" +p02765,s323521021,Accepted,"import math +import string + + +def readints(): + return list(map(int, input().split())) + + +def nCr(n, r): + return math.factorial(n)//math.factorial(n-r)*math.factorial(r) + + +n, r = map(int, input().split()) +print(r+100*(10-n) if n < 10 else r) +" +p02765,s239402207,Accepted,"N, R = map(int, input().split()) +if N >= 10: ans = R +else: ans = R + (100 * (10-N)) +print(ans)" +p02765,s160255034,Accepted,"N, R = map(int, input().split()) + +if N >= 10: print(R) +else: print(R + 100*(10-N))" +p02765,s423177773,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R + (100 * (10 - N)))" +p02765,s101589238,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + rate = R +else: + rate = R + 100 * (10 - N) + +print(rate)" +p02765,s658909058,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s933499170,Accepted,"n,r = map(int,input().split()) + +if(n>10): + print(r) +else: + print(r+(10-n)*100) +" +p02765,s037177212,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(str(r)) +else : + print(r+(100*(10-n)))" +p02765,s776612031,Accepted,"N,R = (int(x) for x in input().split()) + +if N >= 10: + print(R) +else: + print(R+(10- N)*100) " +p02765,s554315732,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n)) +" +p02765,s117136874,Accepted,"N,R=map(int,input().split()) +if N < 10: + print(R+(100*(10-N))) +else: + print(R)" +p02765,s354150013,Accepted,"n,r=map(int, input().split()) +if n < 10: + print(r + 100 * (10-n)) +else: + print(r)" +p02765,s795368076,Accepted,"n, r = map(int, input().split()) +if n>=10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s081298967,Accepted,"n, dr = list(map(int, input().split())) +if n >= 10: + print(dr) +else: + print(dr+(100*(10-n)))" +p02765,s487948678,Accepted,"Num,Rate=map(int,input().split()) +if Num>=10: + print(Rate) +else: + print(int(Rate+100*(10-Num)))" +p02765,s524728633,Accepted,"def solve(string): + n, r = map(int, string.split()) + return str(r + max(10 - n, 0) * 100) + + +if __name__ == '__main__': + import sys + print(solve(sys.stdin.read().strip())) +" +p02765,s598998001,Accepted,"N,R = map(int,input().split()) + +inside = 0 +if N >= 10: + inside = R +else: + inside = R + 100*(10-N) + +print(inside) + " +p02765,s314317873,Accepted,"n,r = list(map(int,(input().split()))) +if n<=10: + naibu =(100*(10-n)) + print(r+naibu) +else: + print(r) + " +p02765,s166305242,Accepted,"N,P=map(int, input().split()) +if N<=9: + print(100*(10-N)+P) +else: + print(P)" +p02765,s071923827,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r + (100 * (10 - n)))" +p02765,s422192270,Accepted,"n, r = map(int, input().split()) +if n < 10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s236151945,Accepted,"i = list(map(int, input().split())) +if 10<=i[0]: + print(i[1]) +else: + print(i[1]+(100*(10-i[0])))" +p02765,s396570500,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s711837892,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R + 100*(10-N)) +" +p02765,s754235727,Accepted,"n,r=map(int,input().split()) +if n<10: + print(r + 100*(10-n)) +else: + print(r)" +p02765,s817343617,Accepted,"def main(): + N, R = map(int, input().split()) + if N >= 10: + print(R) + else: + print(R+100*(10-N)) +if __name__ == ""__main__"": + main()" +p02765,s604509978,Accepted," +data = list(map(int, input().split())) +k = data[0] +r = data[1] + +if k >= 10: + print(r) +else: + inner_rate = r + (100*(10-k)) + print(inner_rate)" +p02765,s697417306,Accepted,"n,r=map(int,input().split()) +if 10<=n: + print(r) +if n<10: + print(r+(100*(10-n))) +" +p02765,s245025826,Accepted,"n,r=map(int,input().split()) +print(r if n>=10 else r+100*(10-n))" +p02765,s381017148,Accepted,"time,rate = map(int,input().split()) +ans = 0 +if time >= 10: + ans = rate +else: + ans = rate + 100*(10 - time) +print(ans)" +p02765,s842450371,Accepted,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s595600333,Accepted,"n,r=map(int,input().split()) +if n<=10: + a=100*(10-n)+r +else: + a=r +print(a)" +p02765,s590433832,Accepted,"N,R = map(int, input().split()) + +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s561253603,Accepted,"N,R=map(int,input().split()) +if N < 10: + ans=R+(10-N)*100 +else: + ans=R +print(ans)" +p02765,s997287917,Accepted,"N, p = map(int,input().split()) +if N < 10: + K = 100 * (10 - N) + print(p + K) +else: + print(p)" +p02765,s590808242,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s129053948,Accepted," + +N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s224966224,Accepted,"from sys import stdin +s = stdin.readline().rstrip().split() +n, r = int(s[0]), int(s[1]) + +if 10-n >= 0: + print(r+100*(10-n)) +else: + print(r)" +p02765,s707794400,Accepted,"N, R = map(int,input().split()) +print(R + 100 * (10 - N) if N < 10 else R)" +p02765,s044983007,Accepted,"n,r=map(int,input().split()) +print(r if n>=10 else r+100*(10-n))" +p02765,s056022557,Accepted,"n,r = map(int, input().split( )) +if n>=10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s884037380,Accepted,"n,r=map(int, input().split()) +print(r+100*(10-n) if n < 10 else r)" +p02765,s647382882,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(100*(10-n)+r)" +p02765,s027176802,Accepted,"N, R = map(int, input().strip().split()) + +if N < 10: + tmp = 100 * (10 - N) + print(R + tmp) +else: + print(R)" +p02765,s633893756,Accepted,"N,R = map(int,input().split()) + +if N<10: + print(100*(10-N)+R) +else: + print (R) +" +p02765,s127549891,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s539261052,Accepted,"input_data = input().split() + +N = int(input_data[0]) +R = int(input_data[1]) + +if N >= 10 : + print(R) +else: + print(R+100*(10-N))" +p02765,s622030450,Accepted,"N, R = map(int, input().split()) + +if N < 10: + InnerRating = 100 * (10 - N) + print(InnerRating + R) +else: + print(R)" +p02765,s925905866,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r)" +p02765,s216583947,Accepted,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s785802010,Accepted,"n,r = map(int, input().split()) +if n < 10: + k = 100*(10-n) + s = r + k +else: + s = r +print(s)" +p02765,s940300374,Accepted,"n, m = map(int, input().split()) +print(m+(n<10)*100*(10-n))" +p02765,s859155748,Accepted,"# -*- coding: utf-8 -*- +N,R = map(int, input().split()) +if N < 10: + R = R + 100 * (10 - N ) + +print(R)" +p02765,s614134270,Accepted,"n, r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s917591579,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100*(10-N))" +p02765,s376527376,Accepted,"n,r=map(int,input().split()) +print(r if n>=10 else r+100*(10-n))" +p02765,s365242084,Accepted,"N, R = map(int, input().split()) + +print(R + 100 * max(0, 10 - N)) +" +p02765,s190304265,Accepted,"def main(): + import sys + input = sys.stdin.readline + N, R = map(int,input().split()) + if N >= 10: + print(R) + elif N < 10: + print(R + 100 * (10 - N)) + +if __name__ == ""__main__"": + main()" +p02765,s670388638,Accepted,"N, R = tuple(map(int, input().split())) + + +if N >= 10: + print(R) +else: + print(R+(100 * (10 - N))) +" +p02765,s557880929,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s955389853,Accepted,"#from collections import Counter +#= int(input()) +#= map(int, input().split()) +N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + R += 100 * (10 - N) + print(R)" +p02765,s110969798,Accepted,"n,r = map(int,input().split()) +ans = 0 +if n>10: + ans = r +else: + ans = r+100*(10-n) +print(ans)" +p02765,s887905669,Accepted,"# -*- coding: utf-8 -*- +import sys +input = sys.stdin.readline + + +def main(): + n, r = map(int, input().split()) + if n <= 10: + # r = x - (100 * (10 - n)) + print(r + 100 * (10 - n)) + + else: + print(r) + + +if __name__ == '__main__': + main() +" +p02765,s107600442,Accepted,"n, r = list(map(int, input().split())) + +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s578444252,Accepted,"n, r = map(int, input().split()) + +if n <= 10: + print(r+100*(10-n)) +elif n > 10: + print(r)" +p02765,s633843498,Accepted,"n,m=map(int,input().split()) +if(n>=10): + print(m) +else: + print(m+(100*(10-n))) +" +p02765,s328732305,Accepted,"import bisect,collections,copy,heapq,itertools,math,numpy,string +import sys +sys.setrecursionlimit(10**7) + +def S(): return sys.stdin.readline().rstrip() +def I(): return int(sys.stdin.readline().rstrip()) +def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) +def LS(): return list(sys.stdin.readline().rstrip().split()) + +def main(): + N,R = LI() + print(R if N>=10 else R+100*(10-N)) + + +main() + +" +p02765,s258388987,Accepted,"N,R=map(int,input().split()) +if N<10: + print(R+(10-N)*100) +else: + print(R)" +p02765,s403290378,Accepted,"import fileinput + +n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + rr = r + 100 * (10 - n) + print(rr) + +" +p02765,s885873066,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (100 * (10-n))) +" +p02765,s887619947,Accepted,"def resolve(): + n, r = map(int, input().split()) + if n < 10: + print(r + 100*(10 - n)) + + else: + print(r) + +resolve()" +p02765,s724965805,Accepted,"N,R=map(int,input().split()) +if N<10: + print(R+(100*(10-N))) +else: + print(R)" +p02765,s369721709,Accepted,"N,R = map(int, input().split()) + +if N < 10: + print(R+(100*(10-N))) +else: + print(R)" +p02765,s533804194,Accepted,"N,R = map(int,input().split()) +if N < 10: + print(100*(10-N)+R) +else: + print(R)" +p02765,s784120371,Accepted,"N, R= map(int, input().split()) + +if N <= 10: + print(R+(100*(10-N))) +else: + print(R)" +p02765,s721316461,Accepted,"N, R = (int(x) for x in input().split()) +print(R if N >= 10 else R + (100 * (10 - N)))" +p02765,s302119659,Accepted,"n, r = map(int, input().split()) +if n <= 10: + print(r + 100 * (10 - n)) +else: + print(r) +" +p02765,s267161970,Accepted,"N, R = map(int, input().split()) + +if N < 10: + print(R+(10-N)*100) +else: + print(R)" +p02765,s608196768,Accepted,"n ,r = input().split("" "") +n = int(n) +r = int(r) +if n < 10: + print( r + 100 * (10 - n)) +else: + print(r)" +p02765,s449113995,Accepted,"n, r = map(int, input().split()) + +if n<10: + print(100*(10-n) + r) +else: + print(r)" +p02765,s849586034,Accepted,"N, R = map(int, input().split()) +if N < 10: + print(R + 100 * (10 - N)) +else: + print(R)" +p02765,s929238683,Accepted,"import re +import sys +import math +import itertools +import bisect +from copy import copy +from collections import deque,Counter +from decimal import Decimal +import functools +def s(): return input() +def k(): return int(input()) +def S(): return input().split() +def I(): return map(int,input().split()) +def X(): return list(input()) +def L(): return list(input().split()) +def l(): return list(map(int,input().split())) +def lcm(a,b): return a*b//math.gcd(a,b) +sys.setrecursionlimit(10 ** 9) +mod = 10**9+7 +cnt = 0 +ans = 0 +inf = float(""inf"") + +n,r = I() +if n < 10: + print(100*(10-n)+r) +else: + print(r) +" +p02765,s323520716,Accepted,"n,r = map(int,input().split()) + +if n>10 : + ans = r +else: + ans = r+(100*(10-n)) +print(ans)" +p02765,s095703667,Accepted,"N,R=map(int,input().split()) +if N<10 : + print(100*(10-N)+R) +else : + print(R)" +p02765,s975619215,Accepted,"N, R = map(int, input().split()) +print(R if N >= 10 else R+100*(10-N))" +p02765,s810987064,Accepted,"n, r= map(int, input().split()) +ans = 0 +if n < 10: ans = 100 * (10 - n) + r +else: ans = r +print(ans)" +p02765,s770283364,Accepted,"def resolve(): + N, R = map(int, input().split()) + if N >= 10: + print(R) + else: + print(R+100*(10-N)) +resolve()" +p02765,s978959523,Accepted,"N, R = tuple(int(n) for n in input().split()) + +print(R + max(0, 100*(10-N))) +" +p02765,s632273514,Accepted,"N, R = [int(i) for i in input().split()] + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N)) +" +p02765,s392064972,Accepted,"N,R=map(int,input().split()) +if(N>=10):print(R) +else:print(R+100*(10-N))" +p02765,s248832859,Accepted,"N, R = (int(x) for x in input().split()) +if N > 9: + print(R) +else: + print(R + (100 * (10 - N)))" +p02765,s303342354,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100*(10-N))" +p02765,s647326229,Accepted,"N , R =map(int, input().split()) +if N <=10: + print(R + 100 * ( 10 - N)) +else: + print(R)" +p02765,s921107661,Accepted,"n, r =map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+1000-100*n)" +p02765,s648203762,Accepted,"# import math +# import bisect +# import heapq +# from collections import deque +# import numpy as np + +# n, m = map(int, input().split()) +n,r = map(int,input().split()) + +ans = r +if n < 10: + ans = r + 100 * (10 - n) +print(ans) +" +p02765,s790899510,Accepted,"N,R=input().split() +N=int(N) +R=int(R) +if (R>4111)or(R<0): + None +if 1<=N<=9: + R_internal=R+100*(10-N) + print(R_internal) +elif N>=10: + R_internal=R + print(R_internal) +else: + None" +p02765,s445227688,Accepted,"def main(): + n, r = map(int, input().split()) + print(r+max(10-n, 0)*100) + + +main() +" +p02765,s649042758,Accepted,"N, R = map(int, input().split(' ')) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N)) +" +p02765,s336426913,Accepted,"#beginer +N,R=map(int, input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s363703003,Accepted,"N,R=list(map(int,input().split())) + +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s272845020,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s044000013,Accepted,"input_list= list(map(int, input().split())) +if input_list[0]<10: + print(input_list[1]+100*(10-input_list[0])) +else: + print(input_list[1])" +p02765,s113593748,Accepted,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s189892394,Accepted,"N,R = (int(x) for x in input().split()) + +if N >= 10: + print(R) +else: + print(R+100*(10-N)) +" +p02765,s855206986,Accepted,"n, r = [int(_) for _ in input().split()] + +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s734084810,Accepted,"N,R = map(int,input().split()) + +if(N <= 9): + print(str(R + 100 * (10 - N))) +else: + print(str(R))" +p02765,s332669040,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s416863292,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) + +else: + print(R + 100*(10-N))" +p02765,s135868287,Accepted,"N, R = [int(i) for i in input().split("" "")] + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s841733478,Accepted,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s629340954,Accepted,"a,b=map(int,input().split()) +if(a<10): + print(b+100*(10-a)) +else: + print(b)" +p02765,s884172049,Accepted,"N, R = list(map(int, input().split())) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s539179763,Accepted,"input= list( map(int,input().split()) ) +n = input[0] +r= input[1] + +if n<10: + print(r + (100 * (10-n)) ) +else: + print(r)" +p02765,s702552518,Accepted,"a=input().split() +(n,m)=map(int,a) +if n>=10: + print(m) +else: + print(m+100*(10-n)) +" +p02765,s914070027,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s602306054,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s909802359,Accepted,"n,r=map(int,input().split()) +if n<10: + print(r+(10-n)*100) +else : + print(r)" +p02765,s548555294,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s919049291,Accepted,"N, R = map(int, input().split()) + +if N < 10: + print(R+100*(10-N)) + +else: + print(R) +" +p02765,s357055105,Accepted,"n,r = map(int,input().split()) +ans = 0 +if n<10: + ans = r+(100*(10-n)) +else: + ans = r +print(ans)" +p02765,s943278687,Accepted,"attend, rate = input().split(' ') + +if int(attend) >= 10: + print(rate) +else: + print(int(rate) + 100 * (10 - int(attend))) +" +p02765,s046199845,Accepted,"mod = 1e9+7 +def add(a, b): + c = a + b + if c >= mod: + c -= mod + return c + +def main(): + N, R = [int(x) for x in raw_input().split()] + + if N >= 10: + print(R) + else: + print(R + ((10 - N) * 100)) + + + +main()" +p02765,s129217172,Accepted,"def A(): + N, R = map(int, input().split()) + if N >= 10: + print(R) + else: + print(R + 100*(10-N)) + +A()" +p02765,s680344606,Accepted,"# ABC 156 A +si = lambda: input() +ni = lambda: int(input()) +nm = lambda: map(int, input().split()) +nms = lambda: map(str, input().split()) +nl = lambda: list(map(int, input().split())) +n,r=nm() +if n>=10: + print(r) +elif n<10: + print(r+100*(10-n)) + +" +p02765,s346814247,Accepted,"n, r = map(int, input().split()) + +def calc(n, r): + if n >= 10: + return r + else: + return r + 100*(10-n) + +print(calc(n, r)) +" +p02765,s362576398,Accepted,"N, R = map(int, input().split("" "")) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s646492175,Accepted,"from math import floor,ceil,sqrt,factorial,log +from collections import Counter, deque +from functools import reduce +import numpy as np +import itertools +def S(): return input() +def I(): return int(input()) +def MS(): return map(str,input().split()) +def MI(): return map(int,input().split()) +def FLI(): return [int(i) for i in input().split()] +def LS(): return list(MS()) +def LI(): return list(MI()) +def LLS(): return [list(map(str, l.split() )) for l in input()] +def LLI(): return [list(map(int, l.split() )) for l in input()] +def LLSN(n: int): return [LS() for _ in range(n)] +def LLIN(n: int): return [LI() for _ in range(n)] + +N, R = MI() + +HR = R if N >= 10 else R+(100 * (10 - N)) + +print(HR) +" +p02765,s828087658,Accepted,"n, r = [int(e) for e in input().split("" "")] + +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n)) +" +p02765,s380894140,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s581965942,Accepted,"N, R = map(int, input().split()) + +if N < 10: + print(R + 100 * (10 - N)) +else: + print(R)" +p02765,s371350644,Accepted,"N, R = map(int, input().split()) +if N > 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s690924403,Accepted,"N,R = map(int,input().split()) +if N >=10: + print(R) +else: + print(100*(10-N)+R)" +p02765,s508456501,Accepted,"n, r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s729016462,Accepted,"i = list(map(int, input().split())) +if i[0]<10: + print (i[1]+100*(10-i[0])) +else: + print (i[1])" +p02765,s881627861,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (10 - n) * 100)" +p02765,s599693050,Accepted,"raw_input = input() +l = raw_input.split() +N = int(l[0]) +R = int(l[1]) + +if N <10: + R_in = 100 * (10 - N) + R + print(R_in) +else: + print(R)" +p02765,s481930429,Accepted,"N,R=map(int,input().split()) + +if N>=10: + print(int(R)) + +else: + x=R+100*(10-N) + print(int(x)) + " +p02765,s417128994,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R+100*(10-N)) +" +p02765,s559020478,Accepted,"n, r = map(int, input().split()) +if n < 10: + print(r + (10 - n) * 100) +else: + print(r)" +p02765,s493459525,Accepted,"n, r = map(int, input().split("" "")) +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r)" +p02765,s183365865,Accepted,"n, r = map(int, input().split()) +if n >=10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s081050950,Accepted,"n, r = map(int, input().split(' ')) + +if n >= 10: + ans = r +else: + ans = r + 100 * (10 - n) + +print(ans)" +p02765,s499021544,Accepted,"nr = list(map(int, input().split())) + +if nr[0] < 10 : + print(nr[1]+100*(10-nr[0])) +else: + print(nr[1]) +" +p02765,s639063687,Accepted,"# 2020/02/22 +# AtCoder Beginner Contest 156 - A + +# Input +n, r = map(int,input().split()) + +# Calc +if n >= 10: + ans = r +else: + ans = r + (100 * (10 - n)) + +# Output +print(ans) +" +p02765,s436872856,Accepted,"N,R = (int(x) for x in input().split()) + +if N >= 10: + print(R) + +else: + print(100*(10-N)+R)" +p02765,s954017013,Accepted,"arr=input().split("" "") +n,r=int(arr[0]),int(arr[1]) + +if n<10: + print(r+100*(10-n)) +else: + print(r) +" +p02765,s665138897,Accepted,"n, r = map(int, input().split()) +n = 10 if n > 10 else n +print(r + 100*(10-n)) +" +p02765,s240368247,Accepted,"n, r = map(int, input().split()) +ans = 0 + +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r)" +p02765,s724594129,Accepted,"N, R = map(int, input().split()) +if N >= 10: + ans = R +else: + ans = R + 100*(10-N) +print(ans)" +p02765,s703331375,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s492477888,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s779770248,Accepted,"N,R=list(map(int,input().split())) +if N>10: + print(R) +else: + print(R+100*(10-N))" +p02765,s583885207,Accepted,"N,R=map(int,input().split()) + +if N>=10: + print(R) +else: + ans=R+100*(10-N) + print(ans) + + " +p02765,s747889414,Accepted,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R + 100*(10-N)) " +p02765,s772025165,Accepted,"n, r = map(int, input().split()) +if n <= 10: + print(r + 100 * (10 - n)) +else: + print(r)" +p02765,s323798246,Accepted,"n, r = [int(i) for i in input().split()] +res = r if n >= 10 else r + 100*(10-n) +print(res) +" +p02765,s761366437,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(100 * (10 - N) + R)" +p02765,s055023049,Accepted,"N, R = map(int, input().split()) +print(R if N >= 10 else R+100*(10-N))" +p02765,s056115205,Accepted,"n,r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s828475288,Accepted,"N, R = map(int,input().split()) + +if N < 10: + ans = R + 100 * (10 - N) +else: + ans = R + +print(ans)" +p02765,s160741956,Accepted,"# abc156_a.py +N, R = map(int,input().split()) +if N>=10: + print(R) +else: + print(R + 100*(10-N)) +" +p02765,s770961646,Accepted,"a,b=map(int,input().split()) +if(a>=10): + print(b) +else: + print(b+100*(10-a))" +p02765,s124874519,Accepted,"def main(): + N, R = map(int, input().split()) + ans = R + 100 * max(10-N, 0) + print(ans) + + +if __name__ == ""__main__"": + main() +" +p02765,s947317457,Accepted,"N,R = map(int, input().strip().split(' ')) +print(R+100*max(0,10-N)) + +" +p02765,s237698271,Accepted,"N, R =map(int,input().split()) +print(R+100*max(10-N, 0))" +p02765,s984638895,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + x = r + print(x) +else: + x = r + 100 * (10 - n) + print(x)" +p02765,s769831861,Accepted,"def main(): + n, r = map(int, input().split("" "")) + if n > 10: + print(r) + else: + print(r + ((10 - n) * 100)) + + +if __name__ == '__main__': + main() +" +p02765,s719067234,Accepted,"from functools import reduce +from fractions import gcd +import math +import bisect +import itertools +import sys +sys.setrecursionlimit(10**7) +input = sys.stdin.readline +INF = float(""inf"") + + +# 処理内容 +def main(): + N, R = map(int, input().split()) + if N >= 10: + print(R) + else: + print(R + 100 * (10 - N)) + + +if __name__ == '__main__': + main()" +p02765,s994008001,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s893891512,Accepted,"import sys +n, R = [int(x) for x in input().split()] +if n >= 10: + print(R) + sys.exit() + +print(R+100*(10-n))" +p02765,s486043487,Accepted,"N, R = input().split() +N = int(N) +R = int(R) + +if N >= 10: + print(R) +else: + print(R + (100 * (10 - N)))" +p02765,s864765263,Accepted,"N,R = map(int,input().split()) + +if(N>=10): + print(R) +else: + print(R+100*(10-N))" +p02765,s814788949,Accepted,"import numpy as np +import math as m + +def main(**kwargs): + if n >= 10: + r = k + + else: + r = k + 100 * (10 - n) + + return r + +if __name__ == ""__main__"": + cin = np.array(input().split("" "")).astype(""int"") + n, k = cin + + cout = main(n=n, k=k) + print(cout)" +p02765,s303445442,Accepted,"n,r = map(int, input().split()) +if n<10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s253090040,Accepted,"# 156 A + +n, r = map(int, input().split()) + +if n < 10: + print(r + (100 * (10 - n))) +else: + print(r)" +p02765,s231960603,Accepted,"n, r = map(int, input().split()) +if (n >= 10): + x = r +else: + x = 100 * (10 - n) + r +print(x) +" +p02765,s483314460,Accepted,"n,r = map(int, input().split()) + +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r)" +p02765,s036815892,Accepted,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s141952516,Accepted,"def main(): + n,r = map(int, input().split()) + if n < 10: + print(r + 100*(10 - n)) + else: + print(r) + return +main() +" +p02765,s950211259,Accepted,"n, r = map(int, input().split("" "")) + +if n < 10: + print((100*(10-n)+r)) +else: + print(r)" +p02765,s327946090,Accepted,"import numpy as np + +N, R = map(int, input().split()) + +if 10 <= N: + print(R) +else: + print(R+100*(10-N))" +p02765,s750154818,Accepted,"n, r = map(int, input().split()) +if n < 10: + x = r + (100*(10-n)) +else: + x = r + +print(x)" +p02765,s458565862,Accepted,"n, r = map(int, input().split()) +if n >= 10: + inner_rating = r + print(inner_rating) +else: + inner_rating = r + (100 * (10 - n)) + print(inner_rating) + " +p02765,s136899522,Accepted,"n,r=map(int,input().split());print(r+max(0,1000-100*n))" +p02765,s331140731,Accepted,"import sys + +N, R = map(int, sys.stdin.buffer.read().split()) +rate = R + +if N < 10: + rate += 100 * (10 - N) + +print(rate) +" +p02765,s086892851,Accepted,"n,r = map(int,input().split()) +print(r if n >= 10 else r + 100*(10-n))" +p02765,s733584284,Accepted,"N,R=map(int,input().split()) +print(R+(100*(10-N) if N<10 else 0)) +" +p02765,s046292158,Accepted,"#input +N, R = map(int, input().split()) + +#output +if N >= 10: + S = R +else: + S = R + 100*(10-N) + +print(S) +" +p02765,s430743409,Accepted,"n, r = map(int, input().split()) +ans = r if n >= 10 else r + (100 * (10 - n)) +print(ans) +" +p02765,s527934829,Accepted,"import sys +import decimal # 10進法に変換,正確な計算 + +def input(): + return sys.stdin.readline().strip() + +def main(): + n, r = map(int, input().split()) + if n >= 10: + print(r) + return + ans = r + 100*(10-n) + print(ans) + + +main()" +p02765,s935150310,Accepted,"n,r=map(int,input().split()) +if n<10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s631111465,Accepted,"n = list(map(int,input().split())) +if n[0]<10: + print(100*(10-n[0])+n[1]) +else: + print(n[1])" +p02765,s989149028,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s481826223,Accepted,"#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +n,r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r+(100*(10-n))) +" +p02765,s694908252,Accepted,"n,r = map(int,input().split()) +ans = 0 + +if n >= 10: + ans = r +else: + ans = r + (100 * (10 - n)) + +print(ans)" +p02765,s626824989,Accepted,"a = [] +a = input().split() +N = int(a[0]) +R = int(a[1]) + +if N >= 10: + Rate = R +else: + Rate = R + 100 * (10 - N) + +print(Rate) + + + +#print('N=', N, 'R=', R) +" +p02765,s140755633,Accepted,"n, rating = map(int, input().split()) + +if n >= 10: + print(rating) +if n < 10: + print(rating + (10 - n)*100)" +p02765,s098163215,Accepted,"N, R = map(int,input().split()) +ans = 0 +if N < 10: + ans = R + (100 * (10 - N)) +else: + ans = R +print(ans)" +p02765,s467719626,Accepted,"n, r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(str(r+100*(10-n)))" +p02765,s780236687,Accepted,"a,b=map(int,input().split()) +if a>=10: + print(b) +else: + print(b+100*(10-a))" +p02765,s419623944,Accepted,"N,R = map(int, input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s863183985,Accepted,"n,r = map(int, input().split()) + +if n>= 10: + print (r) +else: + print (r+100*(10-n))" +p02765,s461275557,Accepted,"import sys + +def ISI(): return map(int, sys.stdin.readline().rstrip().split()) + +n, r = ISI() +if n<10: + r+=100*(10-n) +print(r) +" +p02765,s014403453,Accepted,"N, R = map(int, input().split()) + +print(R if N >= 10 else R + (100 * (10 - N)))" +p02765,s383146136,Accepted,"e_cnt, disp_rate = map(int, input().split()) +if e_cnt >= 10: + print(disp_rate) +else: + print(disp_rate + (100 * (10 - e_cnt)))" +p02765,s375677496,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) + exit() +else: + print(100 * (10 - N) + R) +" +p02765,s142727030,Accepted,"import sys +sys.setrecursionlimit(10**9) +INF=10**18 +MOD=10**9+7 +def input(): return sys.stdin.readline().rstrip() + +def main(): + N,R=map(int,input().split()) + print(R+100*max(0,(10-N))) + +if __name__ == '__main__': + main() +" +p02765,s788902393,Accepted,"#!/usr/bin/env python3 + +n,r = [int(i) for i in input().split()] + +if n < 10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s119132682,Accepted,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R + 100*(10-N))" +p02765,s207639222,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R+(10-N)*100)" +p02765,s846330966,Accepted,"N, R = map(int, input().split()) +ans = 0 + +if(N>=10): + ans = R +else: + ans = R + 100*(10 - N) + +print(ans) +" +p02765,s469037161,Accepted,"import numpy as np + +N, R = list(map(int, input().split())) + +if N < 10: + result = R + (10 - N) * 100 +else: + result = R +print(result)" +p02765,s696563537,Accepted,"n,r=input().split() +N=int(n) +R=int(r) +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s806004366,Accepted,"n, r = input().split() +n = int(n) +r = int(r) + + +if n < 10: + ans = r + 100*(10-n) +else: + ans = r +print(ans) + " +p02765,s139661687,Accepted,"i = input() +N, R = map(int, i.split()) + +if N >= 10: print(R) +else: print(R + 100 * (10-N))" +p02765,s292855759,Accepted,"N, K = map(int, input().split()) +if N >= 10: + print(K) +else: + print(K + 100*(10-N))" +p02765,s819253322,Accepted,"# problem A +N, R = input().split() +n = int(N) +r = int(R) + +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s646046466,Accepted,"n,r=map(int,input().split()) +print(r if n>9else r+100*(10-n))" +p02765,s136302363,Accepted,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R + (100 * (10 - N)))" +p02765,s894912194,Accepted,"m = input("""") +list = m.split("" "") +if eval(list[0])<10: + print(eval(list[1])+100*(10-eval(list[0]))) +if eval(list[0])>=10: + print(eval(list[1]))" +p02765,s182194839,Accepted,"n,r = map(int,input().split()) +print(r+100*(10-(min(n,10))))" +p02765,s997799485,Accepted,"a,b=map(int,input().split()) +if a>=10: + print(b) +else: + res=100*(10-a) + print(res+b)" +p02765,s370878172,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + rating = R +else: + rating = R + 100 * (10 - N) + +print(rating)" +p02765,s580468103,Accepted,"N, R = map(int, input().split()) +print(R if N >= 10 else R + 100*(10-N))" +p02765,s414629930,Accepted,"#template +from collections import Counter +def inputlist(): return [int(j) for j in input().split()] +#template +N,R = inputlist() +if N < 10: + R += 100*(10-N) +print(R)" +p02765,s837250311,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(100*(10-n)+r)" +p02765,s507063817,Accepted,"N,R=list(map(int, input().split())) +if N>=10: + print(R) +else: + print(R+(10-N)*100)" +p02765,s102323253,Accepted,"from sys import stdin + +def main(): + + input = stdin.readline + + N,R = map(int,input().split()) + + if(N>=10): + print(R) + else: + print(R+100*(10-N)) + +if __name__ == ""__main__"": + main()" +p02765,s761790033,Accepted,"n,r=map(int,input().split()) +if n<10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s428201091,Accepted,"n, r = map(int, input().split()) +print(r if n >= 10 else r + 100 * (10 - n))" +p02765,s524697969,Accepted,"n,r=map(int,input().split()) +ans=r +if(n<10):ans+=100*(10-n) +print(ans)" +p02765,s954477958,Accepted,"n,r = map(int,input().split()) +print(r + 100*max(0,10-n))" +p02765,s328331187,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r + (100 * (10 - n)))" +p02765,s284508833,Accepted,"N,R = map(int,input().split()) +if(N>=10): + print(R) +else: + print(R+100*(10-N))" +p02765,s773698856,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (100*(10 - n)))" +p02765,s697120117,Accepted,"# input +N, R = map(int, input().split()) + +# output +ans = R +if N < 10: + ans += 100*(10-N) +print(ans) +" +p02765,s359517670,Accepted,"from sys import stdin + +n,r=map(int,input().split()) + +if n < 10: + print(r + 100 * (10-n)) +else: + print(r) +" +p02765,s017998746,Accepted,"a = list(map(int, input().split())) +print(a[1] + (10 - min(a[0] , 10)) * 100) +" +p02765,s195440499,Accepted,"# coding: utf-8 + +n,r = map(int, raw_input().split()) + +if n >= 10: + print r +else: + print r + 100*(10 - n) +" +p02765,s659687993,Accepted,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + k = 100 * (10 - n) + print(r + k) +#2 2919 +#22 3051" +p02765,s381733195,Accepted,"n,r=map(int,input().split()) + +ans=r + +if n< 10: + ans=r+100*(10-n) + +print(ans) +" +p02765,s758857696,Accepted,"n, r = map(int, input().split()) +if n < 10: + r+=((10-n)*100) +print(r) +" +p02765,s304521049,Accepted,"n, r = map(int, input().split()) +print(r if n >= 10 else r + 100*(10-n)) +" +p02765,s714253854,Accepted,"#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 ff=unix + + +def solv(N, R): + if N >= 10: + return R + else: + # R = ans - 100 * (10 - N) + # ans = R + 100 * (10 - N) + return R + 100 * (10-N) + + +if __name__ == ""__main__"": + + # N R + # + N, R = map(int, input().split()) + ans = solv(N, R) + + print(ans) +" +p02765,s684364567,Accepted,"inputted = list(map(int, input().split())) +N = inputted[0] +R = inputted[1] + +internal_rating = lambda R, K: max(R, R + 100 * (10 - K)) + +answer = internal_rating(R, N) + +print(answer) +" +p02765,s495689736,Accepted,"import sys +input = sys.stdin.readline + +N, R = [int(x) for x in input().split()] + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s262383341,Accepted,"N,R = map(int,input().split()) +if N <= 10: + rate = R+(10-N)*100 +else: + rate = R + +print(rate)" +p02765,s035981372,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s848201159,Accepted,"str = input().split("" "") +n = int(str[0]) +r = int(str[1]) +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r)" +p02765,s690165637,Accepted,"inputstr = input() +inputsplit = inputstr.split() +N = int(inputsplit[0]) +R = int(inputsplit[1]) + +if N>9: + hyouji = R +else: + hyouji = R + 100*(10 - N) + +print(hyouji)" +p02765,s479334666,Accepted,"n,r=map(int,input().split()) +print(r) if n>=10 else print(r+100*(10-n))" +p02765,s954025861,Accepted,"a,b=map(int,input().split()) +if a<10: + print(b+(100*(10-a))) +else: + print(b) +" +p02765,s969561648,Accepted,"N,R=map(int,input().split()) + +if(N>=10): + print(R) +else: + print(R+100*(10-N)) + " +p02765,s410582629,Accepted,"n,r=map(int, input().split()) +if n<10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s998517435,Accepted,"n,r=map(int,input().split()) +if n<10: + r=r+(100*(10-n)) +print(r)" +p02765,s525699168,Accepted,"n, r = map(int, input().split()) +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r) +" +p02765,s423330956,Accepted,"n,r=map(int,input().split()) +inn=0 +if n<10: + inn=100*(10-n) + print(r+inn) +else: + print(r)" +p02765,s396977352,Accepted,"n, r = map(int, input().split()) +print(r + 100 * max(10 - n, 0)) +" +p02765,s443160253,Accepted,"N,R = map(int,input().split()) + +if N > 9: + print(R) +else: + R += 100*(10-N) + print(R) +" +p02765,s705766257,Accepted,"N,R = list(map(int, input().split())) + +if N <= 10: + print(R+(100*(10-N))) +else: + print(R)" +p02765,s062300023,Accepted,"N,M = map(int, input().split()) + +if N <= 9: + print(M + 100*(10 -N)) +else: + print(M) +" +p02765,s230159602,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r + 100 * (10 - n)) +else: + print(r) +" +p02765,s158439254,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n)) +" +p02765,s468076746,Accepted,"N,R=map(int,input().split()) +if N>=10: + print (R) +else: + print (R+100*(10-N))" +p02765,s226403189,Accepted,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s131295762,Accepted,"N, R = map( int, input().split() ) +if N > 10: + print( R ) +else: + print( R + 100 * ( 10 - N ) )" +p02765,s296597354,Accepted,"n,r=map(int,input().split()) +rate = 100*(10-n) +if n >= 10: + print(r) +else: + print(r+rate)" +p02765,s483127543,Accepted,"def strr(): + a=raw_input() + return a +def sstrr(): + a=raw_input().split() + return a +def intt(): + a=int(raw_input()) + return a +def iintt(): + a=[int(s) for s in raw_input().split()] + return a +def nestt(t): + a=[raw_input().split() for s in range(t)] + return a + +nr=iintt() +n=nr[0] +r=nr[1] +if n>=10: + a=r +else: + a=r+100*(10-n) +print a" +p02765,s421260746,Accepted,"N,R=[int(i) for i in input().split()] + +if N < 10: + R += 100 * (10- N) + print(R) +else: + print(R)" +p02765,s648031916,Accepted,"N,R=map(int,input().split()) +if N<10: + ans=R+(100*(10-N)) +else: + ans=R +print(ans)" +p02765,s623638737,Accepted,"[N,R]=[int(item)for item in input().split()] +print(max(R, R+100*(10-N)))" +p02765,s567630744,Accepted,"time,rate = map(int,input().split()) +ans = 0 +if time >= 10: + ans = rate +else: + ans = rate + 100*(10 - time) +print(ans)" +p02765,s484842554,Accepted,"N, R = map(int, input().split()) +if N < 10: + print(R + 100*(10-N)) +else: + print(R)" +p02765,s050864647,Accepted,"N, R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R + 100*(10 - N)) + " +p02765,s240347933,Accepted,"n, r = map(int, input().split()) +inside = 0 + +if n >= 10: + inside = r +else: + inside = r + 100*(10-n) + +print(inside)" +p02765,s286934794,Accepted,"N, R = map(int, input().split()) +if N >= 10: + ans = R +else: + ans = R + 1000 - (100 * N) +print(ans)" +p02765,s750644327,Accepted,"n,r=map(int,input().split()) +if n>9: + print(r) +else: + print(r+100*(10-n))" +p02765,s026215432,Accepted,"n,r = map(int ,input().split()) + +if n>=10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s303937931,Accepted,"import sys +from collections import deque, Counter, defaultdict +from fractions import gcd +input = lambda: sys.stdin.readline().rstrip() + +def eprint(s): + sys.stderr.write('DEBUG: {}'.format(s)) + return + +def main(): + n, r = map(int, input().split()) + if n>= 10: + print(r) + else: + # r = 100 * (10-n) + print(r+ 100*(10-n)) + return + +if __name__ == '__main__': + main()" +p02765,s330049451,Accepted,"n, r = map(int, input().split()) + +if n >= 10 : + ans = r +else : + ans = r + 100 * (10 - n) + +print(ans) +" +p02765,s327069420,Accepted,"n, r = map(int, input().split()) +ans = r + +if n<10: + ans += 100*(10-n) + +print(ans)" +p02765,s983013027,Accepted,"n,r = map(int,input().split()) +rate = 0 + +if n<10: + rate = r + 100*(10-n) +elif n>=10: + rate = r + +print(rate)" +p02765,s380057541,Accepted,"n,r = map(int,input().split()) +if n<10: + print(r+(100*(10-n))) +else: + print(r)" +p02765,s912459290,Accepted,"n, r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s530700121,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s260859771,Accepted,"N, R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R + 100*(10 - N))" +p02765,s836989945,Accepted,"import sys +sys.setrecursionlimit(10 ** 7) + +N, R = map(int, input().split()) + +if N < 10: + ans = R + 100 * (10 - N) +else: + ans = R + +print(ans) +" +p02765,s782675972,Accepted,"N,R=map(int, input().split()) + +if N>=10: + ans=R +else: + ans=R+100*(10-N) +print(ans)" +p02765,s385900696,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r+100*(10-n)) +else: + print(r) +" +p02765,s764247560,Accepted,"N,R = map(int,input().split()) + +rating = 0 +if N >= 10: + rating = R +else: + rating = R + 100 * (10-N) +print(rating)" +p02765,s655553688,Accepted,"n, r = map(int, input().split()) + +print(r if n >= 10 else r + 100 * (10 - n)) +" +p02765,s338609342,Accepted,"import sys +import math +from collections import defaultdict + +sys.setrecursionlimit(10**7) +def input(): + return sys.stdin.readline()[:-1] + +mod = 10**9 + 7 + +def I(): return int(input()) +def LI(): return list(map(int, input().split())) +def LIR(row,col): + if row <= 0: + return [[] for _ in range(col)] + elif col == 1: + return [I() for _ in range(row)] + else: + read_all = [LI() for _ in range(row)] + return map(list, zip(*read_all)) + +################# + +N,R = LI() + +if N>=10: + print(R) +else: + print(R+100*(10-N))" +p02765,s637887209,Accepted,"k, r = map(int, input().split()) + +if k >= 10: + print(r) +else: + print(r + 100*(10-k))" +p02765,s622094313,Accepted,"n,r=map(int,input().split()) +print(r if n>=10 else r+100*(10-n))" +p02765,s756556086,Accepted,"import math +def I(): + return input() +def II(): + return int(input()) +def MII(): + return map(int, input().split()) +def LMII(): + return list(map(int, input().split())) + +n, r = MII() +print(r+100*max((10-n), 0)) +" +p02765,s935009477,Accepted,"n,r=map(int,input().split());print(100*max(0,10-n)+r)" +p02765,s813958799,Accepted,"n,r=map(int,input().split()) +r+=0 if n>=10 else 100*(10-n) +print(r)" +p02765,s892853519,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s184021623,Accepted,"N,R = map(int, input().split()) + + +if N>=10: + print(R) +else: + print(R+100*(10-N)) +" +p02765,s594987084,Accepted,"def main(): + n,r=[int(i) for i in input().split()] + if n>=10: + print(r) + else: + print(r+100*(10-n)) +if __name__==""__main__"": + main()" +p02765,s918622609,Accepted,"n, r = map(int, input().split()) +i = 0 +if n < 10: + i = r + 100*(10-n) +else: + i = r +print(i)" +p02765,s000651795,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s318470880,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(int(r+100*(10-n)))" +p02765,s961695256,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (100 * (10 - n)))" +p02765,s491930921,Accepted,"N,R=list(map(int,input().split())) +R=R+(10-N)*100 if N<10 else R +print(R)" +p02765,s885596527,Accepted,"N,R=map(int,input().split()) +if N>=10:print(R) +else:print(R+100*(10-N))" +p02765,s465197442,Accepted,"n,r = map(int,input().split()) + +if n >= 10: + print(r) +else: + in_rating = r + 100 * (10-n) + print(in_rating) +" +p02765,s397722231,Accepted,"N,R = map(int,input().split()) + +if (N < 10): + ans = R + 100 * (10 - N) +else: + ans = R + +print(ans)" +p02765,s311717786,Accepted,"n, r = map(int, input().split()) +print(r + 100 * (10 - min(n, 10))) +" +p02765,s348925158,Accepted,"n,r = map(int,input().split()) + +if n >= 10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s950840236,Accepted,"#!/usr/bin/env python3 + +import sys +import math +from bisect import bisect_right as br +from bisect import bisect_left as bl +sys.setrecursionlimit(2147483647) +from heapq import heappush, heappop,heappushpop +from collections import defaultdict +from itertools import accumulate +from collections import Counter +from collections import deque +from operator import itemgetter +from itertools import permutations +from copy import deepcopy +mod = 10**9 + 7 +inf = float('inf') +def I(): return int(sys.stdin.readline()) +def LI(): return list(map(int,sys.stdin.readline().split())) + + +n,r = LI() +if n >= 10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s816737112,Accepted,"N,R=map(int,input().split()) + +if N>9: + print(R) +else: + print(R+100*(10-N))" +p02765,s223944759,Accepted,"n,r = map(int,input().split()) + +if n >= 10: + ans = r +else: + ans = r + 100*(10-n) +print(ans)" +p02765,s165829135,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r + 100*(10-n)) +else: + print(r)" +p02765,s985099548,Accepted,"def contest(N, R): + if(N > 10): + return R + else: + return R + 100 * (10-N) + +if __name__ == ""__main__"": + N, R = map(int, input().split()) + print(contest(N, R))" +p02765,s515078210,Accepted,"N, R = map(int, input().split()) +print(R + 100 * (10-N) * (N<10))" +p02765,s534582829,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s161363573,Accepted,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R + 100*(10-N))" +p02765,s400806241,Accepted,"input = raw_input +n, r = map(int, input().split("" "")) + +if n < 10: + out = r + 100 * (10-n) +else: + out = r + +print(out)" +p02765,s598306979,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s076855714,Accepted,"# -*- coding: utf-8 -*- +n, r = map(int,input().split()) + +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n)) +" +p02765,s913641497,Accepted,"n, r = map(int, input().split()) +if n <= 10: + ans = r + 100*(10-n) +else: + ans = r +print(ans)" +p02765,s531231475,Accepted,"n, r = map(int, input().split()) +print(r + 100 * (10 - min(n, 10))) +" +p02765,s581784741,Accepted,"N,R = map(int, input().split()) + +inrate = 0 + +if N >= 10 : + inrate = R +else: + inrate = R + 100*(10-N) +print(inrate)" +p02765,s268503602,Accepted,"N,R=map(int,input().split()) +print(R if N>=10 else R+100*(10-N))" +p02765,s756976626,Accepted,"N, R = map(int ,input().split()) +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s362193337,Accepted,"N, R = [int(i) for i in input().split()] +print(R if N >= 10 else R+100*(10-N)) +" +p02765,s582083871,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s048885706,Accepted,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s974253729,Accepted,"N,R = map(int, input().split()) + +print(R+100*(10-N) if N<10 else R)" +p02765,s264370223,Accepted,"N, R = map(int, input().split()) + +if N >= 10 : + print(R) +else : + print(R + 100 * (10 - N))" +p02765,s318075377,Accepted,"N,R = map(int,input().split()) +if N < 10: + print(R + 100*(10-N)) +else: + print(R)" +p02765,s492640451,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (10 - n) * 100)" +p02765,s448527339,Accepted,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R+100*(10-N))" +p02765,s141731771,Accepted,"n,r=map(int,input().split()) +if n >= 10: + print(r) +else: + print(r + (100 * (10 - n)))" +p02765,s777019200,Accepted,"N,R=map(int,input().split()) +if N < 10: + print(R + 100 * (10 - N)) +else: + print(R)" +p02765,s200851978,Accepted,"N,K=list(map(int,input().split(' '))) +if N<10: + print(K+100*(10-N)) +else: + print(K)" +p02765,s089847507,Accepted,"n, r = map(int, input().split()) + +ret = 0 +if n >= 10: + ret = r +else: + ret = r + 100 * (10 - n) + +print(""{}"".format(ret))" +p02765,s035980227,Accepted,"import sys + +f = sys.stdin +N, R = map(int, f.readline().split(' ')) + +I = R + +if N < 10: + I = R + 100 * (10 - N) + +print(I)" +p02765,s851936228,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (10-n)*100)" +p02765,s268951924,Accepted,"n, r = map(int, input().split()) + +if n <= 10: + print(r + (100 * (10 - n))) +else: + print(r) +" +p02765,s524907280,Accepted,"n, r = map(int,input().split()) + +if n >= 10: + in_rate = r +elif n < 10: + in_rate = r + 100*(10-n) + +print(in_rate)" +p02765,s221726272,Accepted,"a,b = map(int,input().split()) +if a >= 10: + print(b) +else : + print(b + ((10-a)*100))" +p02765,s044642044,Accepted,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R + 100*(10-N)) +" +p02765,s932727916,Accepted,"#Beginner +N, R = map(int,input().split()) +if N <= 10: + R += 100 * (10-N) +print(R)" +p02765,s480521016,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (100 * (10 - n)))" +p02765,s193254678,Accepted,"N, R = map(int, input().split()) +print(R if N >= 10 else R + 100*(10-N))" +p02765,s499928195,Accepted,"n,r=list(map(int,input().split("" ""))) +if n > 10: + print(r) +else: + print(""{}"".format(100*(10-n)+r))" +p02765,s353154271,Accepted,"n,r = map(int, input().split()) +print (100*(10-n)+r) if n < 10 else print (r)" +p02765,s756221269,Accepted,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s884494222,Accepted,"n, r = map(int, input().split()) +if n >= 10: + n = 10 +print(r + 100 * (10 - n))" +p02765,s724728024,Accepted,"n,r = map(int,input().split()) +print((n<10)*(r+100*(10-n)) or r)" +p02765,s730085567,Accepted,"N,M = map(int,input().split()) +if N > 9: + print(M) +else: + print(M + (100 * (10-N)))" +p02765,s642134240,Accepted,"N,R = map(int,input().split()) + +if N<10: + print(R+100*(10-N)) +else: + print(R)" +p02765,s817043759,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s792590682,Accepted,"n,r=map(int,input().split()) + +if n<10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s709937505,Accepted,"N,R=map(int,input().split()) +if N<10: + print(R+(100*(10-N))) +else: + print(R)" +p02765,s166078575,Accepted,"n, r = map(int,input().split()) + +a = 100*(10-n) +if a >0: + print(r+a) +else: + print(r)" +p02765,s562954924,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r + 100*(10-n)) +else: + print(r)" +p02765,s282768357,Accepted,"k = list(map(int, input().split())) +if k[0] >= 10: + print(k[1]) +else: + print(100*(10-k[0]) + k[1])" +p02765,s594703481,Accepted,"N,R=map(int,input().split()) + +if N>=10: + print(R) +else: + print(R+100*(10-N)) + +" +p02765,s103790483,Accepted,"n,r=map(int,input().split()) +print(r+100*(10-n) if n<10 else r)" +p02765,s682471851,Accepted,"n,r=(int(x) for x in input().split()) + +if n >= 10: + rate = r +else: + rate = r + 100 * (10 - n) + +print(rate)" +p02765,s038862332,Accepted,"n, r = [int(x) for x in input().split()] + +if n < 10: + print(r + 100*(10-n)) +else: + print(r)" +p02765,s264438139,Accepted,"#s = input().split() +N,R = map(int, input().split()) + +if N >= 10: + answer=R +else: + answer=R+100*(10-N) +print(answer)" +p02765,s355645559,Accepted,"n,r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s785759245,Accepted,"n,r=map(int,input().split()) +if n<10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s101171442,Accepted,"n, r = map(int, input().split()) + +if n < 10: + print(r + 100 * (10-n)) +else: + print(r)" +p02765,s020399892,Accepted,"[N, R] = list(map(int, input().split())) +if 10 <= N: + ans = R +else: + ans = R + 100 * (10 - N) +print(ans)" +p02765,s892041082,Accepted,"n, r = map(int, input().split()) + +if(n >= 10): + print(r) +else: + print(r+(100*(10 - n))) + +" +p02765,s018710659,Accepted," +N,R=map(int,input().split()) # 1行2列 + +if N < 10: + print(R + 100 * (10 - N)) +else: + print(R) + +" +p02765,s544954041,Accepted,"n,r=map(int,input().split()) +if(n>=10): + print(r) +else: + print(r+(100*(10-n)))" +p02765,s329403738,Accepted,"N, R = list(map(int, input().split())) +if N >= 10: + print(R) +else: + print(100 * (10 - N) + R) +" +p02765,s646535409,Accepted,"N, R = list(map(int,input().split("" ""))) + +if N < 10: + print(R+100*(10-N)) +else: + print(R) +" +p02765,s868563187,Accepted,"def main(): + K = 0 + N, R = [int(_) for _ in input().split()] + if N >= 10: + K = R + else: + K = R + 100 * (10 - N) + print(K) +main()" +p02765,s395818632,Accepted,"N, R = list(map(int, input().split(' '))) +if N >= 10: + print(R) +else: + print(R + (100 * (10 - N)))" +p02765,s852183016,Accepted,"import itertools + + +n, r = map(int, input().split()) +# p = list(map(int, input().split())) +# s = input().split() +# S = [int(input()) for i in range(int(n))] +i =0 +if n < 10: + i= 100*(10 -n) + +print(r+i) +" +p02765,s548348320,Accepted,"def solve(): + if n>=10: + return r + else: + return r+100*(10-n) + + +n, r = [int(i) for i in input().split("" "")] +print(solve())" +p02765,s825150816,Accepted,"k, n = list(map(int, input().split(' '))) +print(n + 100 * (10 - min(10, k))) +" +p02765,s081210651,Accepted,"N, R = map(int, input().split()) +1 <= N < 100 +0 <= R < 4111 + +if N < 11: + print(R+100*(10 - N)); + +else: + print(R);" +p02765,s610441665,Accepted,"n,r=map(int, input().split()) +if n >=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s086323624,Accepted,"n,r = map(int,input().split()) + +if n < 10: + print(r + 100*(10-n)) +else: + print(r)" +p02765,s871826194,Accepted,"n,r = map(int, input().split()) + +if n>=10: + print(r) +else: + print(r+(100*(10-n)))" +p02765,s950329852,Accepted,"n,r=map(int,input().split()) +if n>= 10: + print(r) +else: + print(r+100*(10-n)) +" +p02765,s088694905,Accepted,"n,r= map(int,input().split()) +if n >= 10: + print(r) +else: + print(r+100*(10-n))" +p02765,s513693705,Accepted,"N, R = map(int, raw_input().split()) + +if N > 9: + print R +else: + print R + 100*(10-N) +" +p02765,s597338795,Accepted,"N, R = map(int, input().split()) +x = 100*(10 - N) + +if N >= 10: + print(R) +else: + print(R + x) " +p02765,s139547872,Accepted,"a = raw_input() +n = int(a.split("" "")[0]) +r = int(a.split("" "")[1]) + +if n >= 10: + print(r) +else: + inner = r + (100*(10-n)) + print(inner)" +p02765,s329787058,Accepted,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r + 100*(10-n))" +p02765,s330120211,Accepted,"N,R = [int(s) for s in input().split()] + +if N >= 10: + print(R) +else: + print(R + (100 * (10 - N))) +" +p02765,s051415312,Accepted,"n,r = map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-n))" +p02765,s507976922,Accepted,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s659991976,Accepted,"a, b = map(int,input().split()) + +if a >= 10: + print(b) +else: + print(b+100*(10-a))" +p02765,s873118514,Accepted,"def f(n, r): + if n >= 10: + print(r) + else: + print(r + 100 * (10 - n)) + +n, r = map(int, input().split()) +f(n, r) +" +p02765,s712957057,Accepted,"N,R = map(int,input().split()) +if(N<10): + print(R+100*(10-N)) +else: + print(R)" +p02765,s877502205,Wrong Answer,"s=str(input()) +if s== 'AAA' or s=='BBB': + print('No') +else: + print('Yes')" +p02765,s770101098,Wrong Answer,"n,k=map(int,input().split()) +if n<10: + c=100*(10-n) + print(k-c) +else: + print(k)" +p02765,s475930685,Wrong Answer,"a,b=map(int, input().split()) + +if a >= 10: + print(b) +else: + print(b-100*(10 - a))" +p02765,s214834991,Wrong Answer,"a,b=map(int,input().split()) +print(b if a>=10 else b+100*(10-b))" +p02765,s661446684,Wrong Answer,"N,R= map(int,input().split()) +if N > 9: + print(R) +else: + print(R-100*(10-N))" +p02765,s451363040,Wrong Answer,"# int +# A = list(map(int, input().split())) +# string +# S = input().split() + +N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R - 100 * (10-N))" +p02765,s697926727,Wrong Answer,"N,K=map(int, input().split()) +for i in range(9000): + if K**i<=N=10: + print(r+100*(10-n)) +else: + print(r)" +p02765,s123093282,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10 : + print(r) +else: + print(r - 100 * (10 - n)) +" +p02765,s662956140,Wrong Answer,"n,*a=map(int,open(0).read().split());k=10**9+7 +c=(1<0:Z=Z*Y%k if d&1==1 else Z;Y=Y*Y%k;d>>=1 + c-=X*Z%k +print(c%k)" +p02765,s853934527,Wrong Answer,"N, R = map(int,input().split()) + +if N>=10: + print(R) +else: + print(10-R/100)" +p02765,s572416067,Wrong Answer,"a,b = map(int, input().split()) +if a < 10: + c=int(b-100*(10-a)) +else: + c=int(b) +print(c) +" +p02765,s306461037,Wrong Answer,"N = 2 +R = 2919 +if N<=10: + R = R + (100*(10-N))" +p02765,s010659623,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(100*(10-N)) +" +p02765,s013217632,Wrong Answer,"n,r = map(int,input().split()) +if n <= 10: + print(r-100*(10-n)) +else: + print(r)" +p02765,s606356973,Wrong Answer,"a,b = map(int,input().split()) + +c = a*b + +if c % 2 ==0: + print(""Even"") +else: + print(""Odd"") + +" +p02765,s681405417,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + R=r-100*(10-n) + print(R)" +p02765,s264577305,Wrong Answer,"a,b = map(int, input().split()) +if a < 10: + print(b-100*(10-a)) +else: + print(b) +" +p02765,s118309112,Wrong Answer,"N, R = list(map(int,input().split("" ""))) + +if N < 10: + print(R-100*(10-N)) +else: + print(R)" +p02765,s035645933,Wrong Answer,"[n, r] = map(int, input().rstrip().split(' ')) + +if n > 10: + print(r) +else: + print(r - 100 * (10 - n)) +" +p02765,s817645700,Wrong Answer,"a, b = input().split() +if int(a) < 9: + ans = int(b) - 100 * (10 - int(a)) + print(ans) +else: + print(b) + +" +p02765,s625027109,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r-100*(10-n)) +" +p02765,s540923286,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + print(100 * (10 - n)) +else: + print(r)" +p02765,s359841492,Wrong Answer,"n = input().split() +print(n) + +if int(n[0]) >= 10: + print(n[1]) +else: + print(100 * (10 - int(n[0])) + int(n[1]))" +p02765,s087533287,Wrong Answer,"N,R = map(int, input().split()) + +if N < 10: + R = R - (100 * (10 - N)) + if R < 0: + R = 0 +print(R)" +p02765,s332705088,Wrong Answer,"N, R = map(int, input().split()) +print(R + 100 * (10 - N))" +p02765,s465632870,Wrong Answer,"n, r = map(int, input().split()) + +if n <= 10: + print(r + 800) +else: + print(r)" +p02765,s110211078,Wrong Answer,"def main(): + n, r = map(int,input().split()) + if n >= 10: + print(r) + else: + print(r + 100* (10 - r)) +main()" +p02765,s716914490,Wrong Answer,"N,R = list(map(int, input().split())) +S= 10-N +if N >= 10: + print(R) +else: + print(R-(100*S))" +p02765,s484364846,Wrong Answer,"N,K=map(int,input().split()) +if N >=10: + print(K) +else: + print(K-100*(10-K)) +" +p02765,s022724941,Wrong Answer,"a,b = map(int,input().split()) + +c = a*b + +if c % 2 ==0: + print (""Even"") +else: + print(""Odd"")" +p02765,s763167151,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s028945744,Wrong Answer,"n,m=map(int,input().split()) +if 10<=n: + print(m) +else: + m=m-(10-n)*100 + print(m)" +p02765,s278561160,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r - 100 * (10-n))" +p02765,s088750909,Wrong Answer,"a,b=map(int,input().split()) +c=0 +if a >=10: + print(b) +else: + c = 100 * (10-a) + print(c)" +p02765,s476577656,Wrong Answer,"n,k=map(int,input().split()) +print(k+100*(10-k) if n<10 else k)" +p02765,s580471133,Wrong Answer,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s950762736,Wrong Answer,"n, r= map(int, input().split()) +ans = 0 +if n < 10: ans = 100 * (10 - n) +else: ans = r +print(ans)" +p02765,s153094383,Wrong Answer,"N,R = map(int,input().split()) + +if N < 10: + print(R + 100*(10-N)) +else: + print(N)" +p02765,s837688041,Wrong Answer,"n,r=map(int,input().split()) +if n<10: + print(r-100*(10-n)) +else: + print(r) +" +p02765,s863381297,Wrong Answer,"n,r = map(int,input().split()) +print(r-(100*(10-n))) +" +p02765,s228999440,Wrong Answer,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s913317699,Wrong Answer,"time,rate = map(int,input().split()) +ans = 0 +if time >= 10: + ans = rate +else: + ans = rate - 100*(10 - time) +print(ans)" +p02765,s505267510,Wrong Answer,"N,R=list(map(int,input().split())) + +if N>=10: + A=R +else: + A=100*(10-N) +print(A) + " +p02765,s960803540,Wrong Answer,"n,r=list(map(int,input().split())) + +if n<10: + r=r-100*(10-n) + +print(r) +" +p02765,s472740712,Wrong Answer,"print((lambda x:int(x[0])-max(0,100*(10-int(x[1]))))(input().split()))" +p02765,s451814071,Wrong Answer,"N, R = map(int, input().split()) + +print(R - 100 * max(0, 10-N))" +p02765,s379637573,Wrong Answer,"from sys import stdin,stdout +Pi = lambda x: stdout.write(str(x) + '\n') +S = lambda x: x*(x+1) // 2 +R = lambda:stdin.readline() +Ri = lambda x:map(int,x.split()) + +def main(): + for x in stdin: + a,b = Ri(x) + if a<10:a = 10 - a + Pi(b+(100*a)) + +if __name__ == ""__main__"": + main() +" +p02765,s048704194,Wrong Answer,"n, r = map(int, input().split()) +if n < 10: + print(r) +else: + print(r + 100*(10 - n))" +p02765,s898400632,Wrong Answer,"a = input().split() +print(int(a[1]) + 100*(10-int(a[0])))" +p02765,s780581389,Wrong Answer,"def main(): + n, r = map(int,input().split()) + if n >= 10: + print(r) + else: + print(r + 100* (10 - r)) +main()" +p02765,s807761368,Wrong Answer,"# -*- coding: utf-8 -*- +N,R = map(int, input().split()) +if N < 10: + R = R - 100 * (10 - N ) + +print(R)" +p02765,s031334048,Wrong Answer,"n, r = map(int, input().split()) +print(r - 100 * max(10 - n, 0))" +p02765,s285334843,Wrong Answer,"from sys import stdin +N,R = [int(x) for x in stdin.readline().rstrip().split()] +print(R + (100*(10-N)))" +p02765,s592401541,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + print(r) +else: + print(r + 800)" +p02765,s245466425,Wrong Answer,"n, k = map(int, input().split()) + +def calc(n, k): + i = 1 + tmp = n + while (tmp > k): + tmp = tmp - k**i + i += 1 + return i + +print(str(calc(n,k)))" +p02765,s700049539,Wrong Answer,"N, R = list(map(int, input().split())) + +print(R if N >= 10 else R - (100 * (10 - N)))" +p02765,s688957605,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(10-r))" +p02765,s137876935,Wrong Answer,"a=input().split() +nm=[] +for i in range(2): + b=int(a[i]) + nm.append(b) +if nm[0]<9: + nm[1]+=(100*(10-nm[0])) + +print(nm[1])" +p02765,s348465669,Wrong Answer,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + k = 10 - n + print(100 * k)" +p02765,s670681482,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r-100*(10-r)) +" +p02765,s576778738,Wrong Answer,"n,r=map(int,input().split()) +if n<10: + r-=100*(10-n) +print(r)" +p02765,s686734766,Wrong Answer,"n,k = map(int, input().split()) + +for i in range(1,10): + if n <= k ** i - 1: + print(i) + break" +p02765,s516691718,Wrong Answer,"from sys import stdin +N,R = [int(x) for x in stdin.readline().rstrip().split()] +print(R - (100*(10-N)))" +p02765,s166158106,Wrong Answer,"a,b = list(map(int, input().split())) +if a >= 10: + print(b) +else: + print(b-1000+100*a) +" +p02765,s697968048,Wrong Answer,"N,R = [int(i) for i in input().split()] + +if N < 10: + print(R + (100 * (N- 2))) +else: + print(R)" +p02765,s555694585,Wrong Answer,"#k = int(input()) +#s = input() +#a, b = map(int, input().split()) +#l = list(map(int, input().split())) + +n,k = map(int, input().split()) + +if (n >= 10): + print(k) +else: + print(k-100*(10-n)) +" +p02765,s856650741,Wrong Answer,"N, R = map(int, input().split()) +print(R if 10>=N else R-100*(10-N))" +p02765,s278196148,Wrong Answer,"n,k=map(int,input().split()) +ans=0 +while n>k: + n/=n + n=int(n) + ans+=1 + +print(ans+1)" +p02765,s667187326,Wrong Answer,"N,R=map(int,input().split()) +if N<10: + print(R-100*(10-N)) +else: + print(R) +" +p02765,s285894924,Wrong Answer,"a,b = map(int,input().split()) +if a >= 10: + print(b) +else : + print(b + a*100)" +p02765,s334853950,Wrong Answer,"N,R = map(int,input().split()) +if N < 10: + print(R + 100*(100-N)) +else: + print(R)" +p02765,s509736512,Wrong Answer,"n, r = map(int, input().split()) +print(r if n >= 10 else r - (100 * (10 - n)))" +p02765,s355524604,Wrong Answer,"N,R=map(int,input().split()) +if N<10: + print(100*(10-N)) +else: + print(R)" +p02765,s030567461,Wrong Answer,"N,R=map(int,input().split()) +print(R-100*(10-N))" +p02765,s821744969,Wrong Answer,"N, R = list(map(int, input().split())) + +if(N>=10): + print(R) +else: + print(R - 100*(10-N)) +" +p02765,s171427527,Wrong Answer,"n,k = map(int,input().split()) +for i in range(1,30): + if n >= k**(i-1) and n < k**i: + print(i)" +p02765,s800851582,Wrong Answer,"n, r = map(int,input().split()) +print(r) +if n < 10: + r = r + 100*(10-n) +print(r)" +p02765,s210842255,Wrong Answer,"N, R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R - 100*(10-N)) + +" +p02765,s690053212,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + a = 100 * (10^N) +else: + a = 0 +print(a + R)" +p02765,s727032403,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(100*(10-n)) + +" +p02765,s996792800,Wrong Answer,"N, R = map(int, input().split()) +print(R + 100*(10-N))" +p02765,s298255665,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R - (100 * (10 - N)))" +p02765,s062209894,Wrong Answer,"n,r=map(int,input().split("" "")) +if n >= 10: + print(r) +else: + print(r+100*(10*n)) +" +p02765,s476320418,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + rating = r +else: + rating = r - 100 * (10 - n) +print(rating)" +p02765,s310153110,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s807291028,Wrong Answer,"N, R = map(int, input().split()) + +if N < 10: + ans = R + 100 * (10 - N) +else: + ans = N + +print(ans) +" +p02765,s083839909,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + a = 100 * (10 - n) + b = r - a + if b >=0: + print(b) + else: + print(0) +else: + print(r)" +p02765,s726846787,Wrong Answer,"s = input().split() + +N = int(s[0]) +R = int(s[1]) + +if N < 9: + ans = R + 100 *(10 - N) +else: + ans = R + +print(ans)" +p02765,s646716512,Wrong Answer,"n,r = map(int,input().split()) +print(r+100*(10-n))" +p02765,s448355627,Wrong Answer,"n,r = list(map(int,input().split())) +ans = 0 +if(n < 10): + ans = r +if(n >= 10): + ans = r+100*(10-n) +print(ans)" +p02765,s318216423,Wrong Answer,"n,r=map(int,input().split()) +print(r-100*max(0,10-n))" +p02765,s626297848,Wrong Answer,"import sys +sys.setrecursionlimit(10**6) +readline = sys.stdin.readline +n,r = [int(i) for i in readline().split()] + +if n >= 10: + print(r) +else: + print(r-100*(10-n))" +p02765,s149896581,Wrong Answer,"a,b=map(int,input().split()) +if a>=10: + print(b) +else: + print(b+100*(10-b))" +p02765,s502396265,Wrong Answer,"N, R = map(int, input().split()) +print(R if 10>=N else R+1000-N*100)" +p02765,s339875665,Wrong Answer,"import sys +input = sys.stdin.readline + +N, R = [int(x) for x in input().split()] + +if N >= 10: + print(R) +else: + print(R + 100 * (10 - R))" +p02765,s291334781,Wrong Answer,"n, r = list(map(int, input().split())) +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n)) +" +p02765,s257827395,Wrong Answer,"N, R =(int(x) for x in input().split()) +if N >= 10: + print(R) +else: + print(R - 100 * (10 - N)) +" +p02765,s712892860,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R - 100 / (10 - N))" +p02765,s331865753,Wrong Answer,"n,r = map(int,input().split()) +if 10<=n : + print(r) +elif 1<= n <10: + print(r+100*(100-n)) +" +p02765,s882607585,Wrong Answer,"N,*X=map(int,open(0).read().split());print(sum(map(lambda x:(round(sum(X)/N)-x)**2,X)))" +p02765,s538436662,Wrong Answer,"N, R = list(map(int, input().split(' '))) +if N >= 10: + print(R) +else: + print(R + (100 - (10 - N)))" +p02765,s335708873,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n))" +p02765,s793907541,Wrong Answer,"n,r=map(int,input().split()) +if n<=10: + print(r+100*(10-n))" +p02765,s549342532,Wrong Answer,"N, R = map(int, input().split()) + +if N < 10: + print(R - (100*(10-N))) +else: + print(R)" +p02765,s010569361,Wrong Answer,"a,b = map(int,input().split()) +if a >= 10: + print(str(b)) +else: + print(str(100*(10-a)))" +p02765,s345738817,Wrong Answer,"N,R=map(int, input().split()) + +if N<10: + print(R+(100*(10-N))) +else: + R" +p02765,s145015953,Wrong Answer,"n, r = map(int, input().split()) +if n >= n: + print(r) +else: + print(r - (10-n)*100)" +p02765,s854358061,Wrong Answer,"n,r = map(int, input().split()) + +if n < 10: + print(100 * (10-r)) +else: + print(r)" +p02765,s604471694,Wrong Answer,"a, b = list(map(int, input().split())) +if a >= 10: + my_result = b +else: + my_result = b - 100 * (10 - a) +print(my_result)" +p02765,s589703402,Wrong Answer,"i = list(map(int, input().split())) +N = i[0] +R = i[1] + +result = R if N >= 10 else R - 100 * (10 - N) + +print(result)" +p02765,s801256822,Wrong Answer,"n, r = map(int, input().split()) +print(r+(10-n)*100)" +p02765,s258967050,Wrong Answer,"data = input().split() +if int(data[0]) > 10: + ans = data[1] +else: + ans = int(data[1]) - 100 * (10 - int(data[0])) + +print(ans) +" +p02765,s793621699,Wrong Answer,"N, R = map(int, input().split()) +print(R if 10>=N else R+100*(10-N))" +p02765,s600550458,Wrong Answer,"import sys +n,r = list(map(int, input().split())) +if n >= 10: + print(n) +else: + print(r + 100*(10-n))" +p02765,s434440870,Wrong Answer,"n, k = map(int, input().split()) +ans = 0 +if n < 10: + ans = 100*(10-n)+k +else: + ans = k +print(k)" +p02765,s953187494,Wrong Answer,"def E(N,R): + K = 100*(10-N) + if K < 0: + M =R + print(M) + else: + M = R +K + print(M)" +p02765,s111338909,Wrong Answer,"N,K = map(int,input().split()) +N += 1 +ans = 1 +for i in range(1000000): + if K**(ans) < N: + ans += 1 + else: + print(ans) + break" +p02765,s754242082,Wrong Answer,"N,R = map(int,input().split()) + +if N > 9: + print(R) +else: + print(R -1000 +100*N)" +p02765,s045254005,Wrong Answer,"n, r = map(int, input().split()) +print(r - 100 * max(0, 10 - n))" +p02765,s688556174,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10 : + print(R) + +elif N < 10 : + print(100*(10-N))" +p02765,s009429009,Wrong Answer,"from sys import * + +input = stdin.readline +lmi = lambda: list(map(int, input().split())) +mi = lambda: map(int, input().split()) +si = lambda: input().strip('\n') +ssi = lambda: input().strip('\n').split() + + +n, r = mi() +if n >= 10: + print(r) +else: + print(r-(100*(10-n)))" +p02765,s536783407,Wrong Answer,"n,r=map(int,input().split()) +s=r-100*(10-n) +if n>=10: + print(r) +else: + print(s)" +p02765,s926117296,Wrong Answer,"N,R=map(int, input().split()) +if N>=10: + print(R) +if 0<=N<10: + print(R-100*(10-N))" +p02765,s796028271,Wrong Answer,"n,k = map(int,input().split()) + +if n >= 10: + print(k) +else: + print(k + 100*(10-k)) +" +p02765,s934716957,Wrong Answer,"n,r=map(int,input().split()) +print(r+100*(10-n)) +" +p02765,s979811424,Wrong Answer,"N, R = map(int,input().split()) + +if N < 10: + print(R + 100 * (10 - R)) +else:print(R) +" +p02765,s914202874,Wrong Answer,"from sys import stdin,stdout +Pi = lambda x: stdout.write(str(x) + '\n') +S = lambda x: x*(x+1) // 2 +R = lambda:stdin.readline() +Ri = lambda x:map(int,x.split()) + +def main(): + for x in stdin: + a,b = Ri(x) + if a<10:a = 10 - a + else:a = 10 + Pi(b+(100*a)) + +if __name__ == ""__main__"": + main() +" +p02765,s405013931,Wrong Answer,"n, r = map(int,input().split()) + +if n>=10: + print(r) +else: + print(100*(10-n))" +p02765,s793877660,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10 : + print(R) + +else : + print(100*(10-N))" +p02765,s715777592,Wrong Answer,"import numpy as np + +n,r = map(int,input().split()) +print(n,r) + +if n < 10: + print(r + 1000 - 100*n) +else: + print(r)" +p02765,s940789701,Wrong Answer,"class E(): + def ee(N,R): + if int(N)==N and int(R)==R: + if 1<= N <= 100 and 0<= R <= 4111: + if N > 10: + print(R) + else: + K = 100 * (10 - N) + print(R+K) + else: + print('please input right numbers') + else: + print('please input an integer')" +p02765,s188938687,Wrong Answer,"import sys + +n, r = map(int, sys.stdin.readline().split()) + +def main(): + i = r + 100 * (10 - n) + print(i) + +if __name__ == '__main__': + main()" +p02765,s769024515,Wrong Answer,"def check_trial(n): + num = n.split() + if int(num[0]) > 10: + return True + else: + return False +def in_rating(n, result): + if result: + num = n.split() + out_rating = int(num[1]) + 100*int(num[0]) + return out_rating + else: + num = n.split() + out_rating = int(num[1]) + 100*(10-int(num[0])) + return out_rating +def main(): + n=input() + result = check_trial(n) + print(in_rating(n, result)) +main()" +p02765,s839184282,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s451203883,Wrong Answer,"N, R = map(int, input().split()) +if N>10: + print(R) +else: + print(R - (100 * (10 - N)))" +p02765,s147257875,Wrong Answer,"N, R = map(int, input().split()) +if N <= 10: + print(R - 100*(10-N)) +else: + print(R)" +p02765,s213803968,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n)) +" +p02765,s468820701,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: print(R) +else: print(R - 100*(10-N))" +p02765,s157198841,Wrong Answer,"def main(): + n, r = map(int,input().split()) + if n < 10: + return r + else: + return 100 * (10 - n) + +main()" +p02765,s961605912,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: + ans = R +else: + ans = R - 100 * (10 - N) + +print(ans)" +p02765,s269790392,Wrong Answer,"N , K = input().split() +print (100 * (10 - int(N)) + int(K))" +p02765,s844538773,Wrong Answer,"n,r = map(int,input().split()) +if n>=10: + print(r) +else: + print(r+100*(100-n))" +p02765,s971949915,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + ans = R - (100*(10-R)) + print(ans)" +p02765,s682363655,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r-(10-n)*100)" +p02765,s522016673,Wrong Answer,"N,R=map(int, input().split()) + +if N < 10: + print(R) +else: + print(R - 100*(10-N))" +p02765,s723267197,Wrong Answer,"n,r=map(int,input().split()) +if n >= 10: + ans = r +else: + ans = r + 1000 - 100 * n" +p02765,s844610536,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s801981466,Wrong Answer,"n,r=map(int,input().split()) + +if n>10: + print(r) +else: + print(r-(100*(10-n)))" +p02765,s709562695,Wrong Answer,"n,r = map(int,input().split()) + +if(n >= 10): + print(r) +else: + print(r-100*(10-n))" +p02765,s560651967,Wrong Answer,"n,r = map(int,input().split()) +if n>10: + print(r) +else: + print(100*(10-n))" +p02765,s163464332,Wrong Answer,"N,R=map(int,input().split()) +if R>=10: + a=N +else: + a=100*(10-N) +print(a)" +p02765,s416630218,Wrong Answer,"# -*- coding: utf-8 -*- +N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(int(R) - 100*(10-int(N)))" +p02765,s105829125,Wrong Answer,"n, display_rating = list(map(int, input().split("" ""))) + +if n < 10: + a = 100 * (10 - 2) +else: + a = 0 +print(display_rating + a) +" +p02765,s655472588,Wrong Answer,"deta = input().split() +n = deta[0] +r = deta[1] +if int(n)>=10: + print(r) +else: + rate = 100*(10-int(n)) + print(rate)" +p02765,s948208564,Wrong Answer,"n, r = [int(i) for i in input().split("" "")] +print(r if n >= 10 else r - 100 * (10 - n))" +p02765,s170731932,Wrong Answer,"[N, R] = [int(i) for i in input().split()] +ans = R + (100*(10-N)) +print(ans)" +p02765,s487242877,Wrong Answer,"N,R = sorted(map(int,input().split())) + +if N<=10: + print(R+100*(10-N)) +else: + print(R)" +p02765,s751514668,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10: + exit(0) +else: + r = r + 100 * (10 - n) + +print(r)" +p02765,s326863495,Wrong Answer,"n,r = map(int,input().split()) +if n>=10 : + print(r) +else : + print(r-100*(10-n)) " +p02765,s399882944,Wrong Answer,"n,r = map(int, input().split()) + +if n>10: print(r) +else: print(int(100*(19-n)+r))" +p02765,s703985553,Wrong Answer,"n, r = map(int,input().split()) + +if r<10: + print(r + 100*(10-n)) +else: + print(r)" +p02765,s844588875,Wrong Answer,"n, r = map(int, input().split()) +if n < 10: + print((r + 100*(10-r))) +else: + print(n)" +p02765,s452865550,Wrong Answer,"N, R = map(int, input().split()) + +if N <= 10: + print(R) +else: + print(R - 100 * (10 - N)) +" +p02765,s710890207,Wrong Answer,"N,R=map(int,input().split()) +c=0 +if N>=10: + c=R +else: + c=R+100*(10-c) +print(c)" +p02765,s658714486,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(100 * (10 - n))" +p02765,s385442960,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r - (100 * (10-r)))" +p02765,s180607967,Wrong Answer,"m,n = map(int,input().split()) +if m>=10: + print(n) +else: + print(n+(100-m))" +p02765,s103954267,Wrong Answer,"i = list(map(int, input().split())) +N = i[0] +R = i[1] + +if N > 10: + result = R +else: + result = 100 * (10 - N) + +print(result)" +p02765,s878141175,Wrong Answer,"#!/usr/bin/env python3 +import collections +import itertools as it +import math +#import numpy as np + +# = input() +# = int(input()) +# = map(int, input().split()) +# = list(map(int, input().split())) +# = [int(input()) for i in range(N)] +# +# c = collections.Counter() +" +p02765,s925689537,Wrong Answer,"n, r = map(int, input().split()) + +if n == 0: + print(0) +elif 0 < n >= 10: + print(r) +else: + print(r-(100*(10-n)))" +p02765,s954920268,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R-N*100) " +p02765,s659230267,Wrong Answer,"n,r=map(int,input().split()) +rate=r if n>=10 else 100*(10-r) +print(r)" +p02765,s272666091,Wrong Answer,"n,r=map(int,input().split()) +if n>=r: + print(r) +else: + print(r+100*(10-n))" +p02765,s916657303,Wrong Answer,"n, r = map(int,input().split()) +print(r-100*max(0,10-n))" +p02765,s121036085,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + print(R - (100 * (10 - N))) +else: + print(R)" +p02765,s023928880,Wrong Answer,"n,r=map(int,input().split()) +ans=r + +if n <10: + ans= r - (100*(10-n)) + +print(ans)" +p02765,s466727997,Wrong Answer,"n,r=map(int,input().split()) +if n>10: + print(r) +else: + print(r-1000+100*n) +" +p02765,s082658357,Wrong Answer,"n, r = map(int, input().split()) +print(r - 100 * max(10 - n, 0))" +p02765,s640587429,Wrong Answer,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(100*(10-R))" +p02765,s328530640,Wrong Answer,"n = list(map(int,input().split())) +if n[0]<10: + print(100*(10-n[0])) +else: + print(n[1])" +p02765,s701790497,Wrong Answer,"n,r = map(int,input().split()) + +if r < 10: + print(n-(100*(10-r))) +else: + print(n) +" +p02765,s418942894,Wrong Answer,"a,b=map(int, input().split()) + +if a > 10: + print(b) +else: + print(b-100*(10 - a))" +p02765,s891603810,Wrong Answer,"A = input().split( ) + +N = int(A[0]) +R = int(A[1]) + +if N >= 10: + print(R) + +else : + print(100*(10-N))" +p02765,s668819458,Wrong Answer,"N,K=map(int,input().split()) +print(K if N>=10 else 1000-100*K)" +p02765,s274064418,Wrong Answer,"n,ans = str(input()).split() +if int(n)<10: + ans = int(ans) - (100*(10-int(n))) +print(int(ans))" +p02765,s063716164,Wrong Answer,"# -*- coding: utf-8 -*- +N,R = map(int, input().split()) +if N <= 10: + R = R - 100 * (10 - N ) + +print(R)" +p02765,s504889252,Wrong Answer,"N, R = [int(_) for _ in input().split()] +if N >= 10: + print(R) +else: + print(100 * (10 - N))" +p02765,s600981866,Wrong Answer,"def resolve(): + N, R = map(int, input().split()) + + if N < 10: + print(R) + else: + R = R + 100 * (10 - N) + print(R) + +if __name__ == ""__main__"": + resolve()" +p02765,s325013679,Wrong Answer,"N,R = map(int,input().split()) +print(R if N >= 10 else R+N*100) +" +p02765,s875230772,Wrong Answer,"n,k = map(int,input().split()) + +if n >= 10: + print(k) +else: + print(100*(100-k))" +p02765,s437136567,Wrong Answer,"inp=input().split() + +n=int(inp[0]) +r=int(inp[1]) + +if n<10: print(r) + +else: print(r + 100*(10-n))" +p02765,s951027709,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - r))" +p02765,s777641571,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R+100*N)" +p02765,s323082971,Wrong Answer,"n, r = map(int, input().split()) +print(r if n >= 10 else r - 100 * (10 - n))" +p02765,s074479918,Wrong Answer,"def E(N,R): + if 1<= N <= 100 and 0<= R <= 4111: + K = 100*(10-N) + if K < 0: + M =R + print(M) + else: + M = R +K + print(M) + else: + print('please input right numbers') +" +p02765,s379729884,Wrong Answer,"N, R = list(map(int, input().split())) + +ans = R - 100 * max((10 - N), 0) +print(ans) +" +p02765,s954970102,Wrong Answer,"N, R = [int(x) for x in input().split(' ')] +if N < 10: + print(R) +else: + print(R + 100 * (10 - N))" +p02765,s339606251,Wrong Answer,"import numpy as np + +n,r = map(int,input().split()) +print(n,r) + +if n < 10: + print(r + 1000 - 100*n) +else: + print(r)" +p02765,s805109091,Wrong Answer,"n, r = map(int,input().split()) + +if r<10: + print(100*(10-n)) +else: + print(r)" +p02765,s050526744,Wrong Answer,"i = list(map(int, input().split())) + +N = i[0] +R = i[1] + +if N<= 10 : + I = R + +elif N >10 : + I = R + 100*(10-N) + +print(I)" +p02765,s231573013,Wrong Answer,"N, R = map(int,input().split()) +print(type(N), N, R) + +if N<10: + R=R-100*(10-N) + print(R) +else: + print(R)" +p02765,s157485021,Wrong Answer,"n,r=map(int,input().split()) +if r>=10: + print(n) +else: + print(r-(100*(10-n)))" +p02765,s423576152,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print('R') +else: + print('R+100*(10-K)') + " +p02765,s379593386,Wrong Answer,"n, r = map(int,input().split()) + +if n>=10: + print(r) +else: + print(r-(100*(10-n)))" +p02765,s498833098,Wrong Answer,"A = input().split( ) + +N = int(A[0]) +R = int(A[1]) + +if N >= 10: + print(R + N) + +else : + print(100*(10-N))" +p02765,s555726174,Wrong Answer,"def main(): + + N, R = map(int, input().split()) + if N >= 10: return R + else: return R - 100 * (10 - N) + +if __name__ == '__main__': + print(main())" +p02765,s235694547,Wrong Answer,"N,R = map(int,input().split()) +if N <= 10: + print(R) +else: + print(R + 1000 -10*N)" +p02765,s270783939,Wrong Answer,"l,n=map(int,input().split()) +p=100*(10-l) +print(p+n)" +p02765,s189471939,Wrong Answer,"def E(N,R): + if 1<= N <= 100 and 0<= R <= 4111: + K = 100*(10-N) + if K < 0: + M =R + print(M) + else: + M = R + K + print(M) + else: + print('please input right numbers') +" +p02765,s749033487,Wrong Answer,"from sys import stdin +s = stdin.readline().rstrip().split() +n, r = int(s[0]), int(s[1]) +print(r+100*(10-n))" +p02765,s466265926,Wrong Answer,"N, R = map(int, input().split("" "")) + +if N < 10: + print(R - N*100) +else: + print(R)" +p02765,s849659715,Wrong Answer,"N, R = map(int, input().split()) + +ans = R + +if N < 10: + ans -= 100 * (10 - N) + +print(ans) +" +p02765,s966624118,Wrong Answer,"a, m = map(int, input().split()) +if a >=10: + print(m) +else: + out = m - 100 *(10-a) + if out <= 1: + print(1) + else: + print(out)" +p02765,s996501854,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s926415920,Wrong Answer,"a, m = map(int, input().split()) +if a >=10: + print(m) +else: + out = m - 100 *(10-a) + print(out)" +p02765,s726828059,Wrong Answer,"n,r=map(int,input().split()) + +if n<=10: + print(100*(10-n)) +else: + print(r)" +p02765,s301052945,Wrong Answer,"N,R = input().split() +N,R = int(N),int(R) +L = R +if N < 10: + L=100*(10-N) +else: + L = R + +print(L) +" +p02765,s182516153,Wrong Answer,"#print(input()) +N, DR = map(int, input().split()) +# DR = IR - 100 * (10 - N) +# IR + 100 * (10 - N) = IR + +if N >= 10: + print(DR) +else: + print(100 * (10 - N) * DR) + +" +p02765,s097521870,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10: + print(N) + +else: + print(R-100*(10-N))" +p02765,s420177387,Wrong Answer,"N,R = map(int,input().split()) +if N < 10 : + print( 100*(10 - int(N)) ) +else : + print( 'R' )" +p02765,s107761032,Wrong Answer,"n,k = map(int,input().split()) + +y = k +cnt = 1 +while n >= k: + k *= y + cnt += 1 +print(cnt) +" +p02765,s666289602,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s991679746,Wrong Answer,"n,r=map(int,input().split()) +if n<10: + r-=100*(10-n) +print(r)" +p02765,s224077100,Wrong Answer,"N,R = list(map(int, input().split())) +if R >= 10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s495673598,Wrong Answer,"N,K = [int(i) for i in input().split()] +print(K-(100*(10-N)))" +p02765,s735163210,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-(100*(10-n)))" +p02765,s728846321,Wrong Answer,"N,R = (int(x) for x in input().split()) +if N>=10: + print(R) +else: + print(R-100*(10-N))" +p02765,s864356469,Wrong Answer,"N,R=map(int,input().split()) +u=0 +if N>=10: + u=R +else: + u=R-100*(10-N) +print(u) + +" +p02765,s243428107,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R-100*(10-N))" +p02765,s641976636,Wrong Answer,"N, R = map(int, input().split(' ')) +if N < 9: + L = R+100*(10-N) + print('{}'.format(L)) + +else: + print('{}'.format(R)) + +" +p02765,s968421600,Wrong Answer,"N, R = map(int, input().split()) + +if N > 10: + print(R) +else: + print(100 * (10 - N))" +p02765,s661346931,Wrong Answer,"N, R = map(int, input().split()) +print(R if N >= 10 else R - 100*(10-N))" +p02765,s303672345,Wrong Answer,"n,r = map(int, raw_input().split(' ')) +def f(n,r): + if n < 10: + return r + else: + return r - 100 * (10 - n) +print f(n,r)" +p02765,s886820903,Wrong Answer,"n, r = map(int,input().split()) +print(r-100*max(0,10-n))" +p02765,s086153939,Wrong Answer,"N, R = [int(x) for x in input().split(' ')] + +if N > 9: + print(R) +else: + print(R - 100 * (10 - N)) +" +p02765,s457457180,Wrong Answer,"n, r = map(int, input().split()) +ans = r - 100*(10-n) +print(ans)" +p02765,s891219326,Wrong Answer,"N, R = map(int, input().split()) + +if N < 10: + print(R - 100 * (10 - N)) +else: + print(R)" +p02765,s610940559,Wrong Answer,"N,R = map(int,input().split()) +if N < 10: + R = 100 * (10 - N) + print(R) +else: + print(R)" +p02765,s653269198,Wrong Answer,"N,R=map(int,input().split()) +print(R+100*(10-N))" +p02765,s120691803,Wrong Answer,"n, r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n))" +p02765,s670459080,Wrong Answer,"N,R=(int(i)for i in input().split()) + +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s029976016,Wrong Answer,"#ABC156-A #Beginner +n,r = map(int, input().split()) +if n >= 10: + k = 100*(10-n) + s = k + r +else: + s = r +print(s)" +p02765,s051506210,Wrong Answer,"def E(N,R): + while int(N)==N and int(R)==R: + while 1<= N <= 100 and 0<= R <= 4111: + if N > 10: + print(R) + else: + K = 100 * (10 - N) + print(R+K)" +p02765,s683611860,Wrong Answer,"N,R=map(int,input().split()) +if N<10: + print(N+(100*(10-N))) +else: + print(R)" +p02765,s870765835,Wrong Answer,"N,R = map(int,input().split("" "")) +if N >= 10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s032281503,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s920192133,Wrong Answer,"N,K = map(int,input().split()) +for i in range(1,10): + if K**i <= N < K**(i+1): + print(i+1) + break" +p02765,s895985136,Wrong Answer,"N, R = map(int, input().split()) + +if 10 <= N: + print(R) +else: + print(R - 100 * (10 - N)) +" +p02765,s932054420,Wrong Answer,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(r - (100 * (10 - n)))" +p02765,s604034121,Wrong Answer,"print((lambda x:int(x[1])-max(0,100*(10-int(x[0]))))(input().split()))" +p02765,s248870292,Wrong Answer,"N, R = map(int, input().split()) + +if (N >= 10): + ans = R +else: + ans = R + 1000 - 100 * N" +p02765,s408419764,Wrong Answer,"n, r = map(int, input().split()) +if n < 10: + k = 10 - n + kk = 100 * k + print(r - kk) +else: + print(r) + +" +p02765,s236530334,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(int(r-100*(10-n)))" +p02765,s778274046,Wrong Answer,"#--Beginner +#1行1列 +number, rate = map(int, input().split()) + +if (number < 10): + print(rate+(100*(10-number))) +elif (number <= 10): + print(rate) + +" +p02765,s586597659,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R-100*(10-N))" +p02765,s950437107,Wrong Answer,"a,b = map(int,input().split()) + +print(b if a >= 10 else b-100*(10-a))" +p02765,s872608911,Wrong Answer,"N ,R = map(int, input().split()) +if N >=10: + print(R) + +else: + r = 100*(10 - N) + R = R - r + print(R)" +p02765,s913010890,Wrong Answer,"# ABC156a + + +def main(): + import sys + input = sys.stdin.readline + sys.setrecursionlimit(10**6) + # 再帰関数を使わない限りPypyで出すこと + + n, r = map(int, input().split()) + if n >= 10: + print(r) + else: + print(100*(10-n)) + + +if __name__ == '__main__': + main() +" +p02765,s719131618,Wrong Answer,"N, R = input(""N and R: "").split() +N = int(N) +R = int(R) +if N<10: + A = (100*(10-N)) + R = R + A + print(R) +else: + print(R)" +p02765,s994162978,Wrong Answer,"print(lambda x:int(x[1])+(100*(10 - 10 if x[0]>=10 else x[0])),input().split())" +p02765,s413750711,Wrong Answer,"n, k = map(int, input().split()) +if n >= 10: + print(k) +else: + print(n + 100 * (10-k))" +p02765,s326448609,Wrong Answer,"sum,rate=map(int,input().split()) +if sum>=10: + print(rate) +else: + ans=rate-(100*(10-sum)) + print(ans) " +p02765,s365436151,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s842441069,Wrong Answer,"n, r = map(int, input().split()) +print( r if n >= 10 else r-100*(10-n)) +" +p02765,s028194433,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + print(R - 100*(10-N)) +else: + print(R) +" +p02765,s272440062,Wrong Answer,"a,b=map(int,input().split()) + +if a >=10: + c=int(b) + print(c) +else: + c=int(b-1000+100*a) + print(c) +" +p02765,s624989533,Wrong Answer,"N,R = map(int, input().split()) +if N >= 10: + print(N) +else: + print(R-(100*(10-N)))" +p02765,s871318899,Wrong Answer,"# -*- coding: utf-8 -*- +def main(): + N,R = map(int,input().split()) + if N >= 10: + print(R) + return + else: + print(R-(100*(10-N))) + +if __name__ == '__main__': + main()" +p02765,s536056654,Wrong Answer,"N,R=map(int, input().split()) +print(R+100*min(10-N,0))" +p02765,s520414389,Wrong Answer,"def solve(): + n, r = list(map(int, input().split())) + if n > 10: + print(r - 100 * (10 - n)) + return + + print(r) + return + +if __name__ == ""__main__"": + solve()" +p02765,s318461904,Wrong Answer,"n,r = map(int,input().split()) +if n < 10: + print(r-(100*(10-n))) +else: + print(r)" +p02765,s709089265,Wrong Answer," +def main(): + n, r = map(int, input().split()) + if n >= 10: + print(r) + else: + print(r - (100 * (10 - n))) + + +if __name__ == ""__main__"": + main() +" +p02765,s242951367,Wrong Answer,"N,R=map(int,input().split()) +if N<10: + print(R-(100*(10-N))) +else: + print(R)" +p02765,s267943029,Wrong Answer,"N,R = map(int,input().split()) +if int(N) < 10 : + print( 100*(10 - int(N)) ) +else : + print( 'R' ) +" +p02765,s566404996,Wrong Answer,""""""" +じょえチャンネルおもしろいよ~~~ +https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ +"""""" + +n,r=map(int,input().split()) +if n==10:print(r) +else:print(r+100*(10-n))" +p02765,s245788936,Wrong Answer,"N, R = map(int, input().split()) +if N>=10: + print(R) +else: + print(R+1000*(10-N))" +p02765,s841577646,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(100*(10-n))" +p02765,s926630882,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: + rate = R +else: + rate = R - (100 * (10 - N)) + +print(rate) +" +p02765,s647352468,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + (100 * (10-r))) +" +p02765,s071925640,Wrong Answer,"i = input().split() +N = int(i[0]) +R = int(i[1]) + +if N > 10: + result = R +else: + result = 100 * (10 - N) + +print(result)" +p02765,s674886454,Wrong Answer,"n, r = map(int, input().split()) +print(n, r) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - n))" +p02765,s675326589,Wrong Answer,"N,K = map(int, input().split()) +counter = 0 +K_ = 1 +i=True +while i==True: + K_ = K_ * K + if N < K_: + print(counter) + i=False + counter += 1" +p02765,s777000897,Wrong Answer,"n, r = map(int, input().split()) +if n < 10 : + print(r+(100*(10-n))) +else : + print(n)" +p02765,s158681783,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: + print(N) +else: + print(R + 100 * (10 - N))" +p02765,s258151868,Wrong Answer,"N, R = input(""N and R: "").split() +N = int(N) +R = int(R) +if N<10: + R = R+(100*(10-N)) + print(R) +else: + print(R)" +p02765,s084526356,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + print(r + 100 * (10 - n)) +" +p02765,s243276155,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + rating = r +else: + rating = 100 * (10 - n) +print(rating)" +p02765,s729206409,Wrong Answer,"N,K=map(int,input().split()) +A=0 +while N>=K**A: + A=A+1 + +print(A) + +" +p02765,s916283355,Wrong Answer,"n,k=map(int,input().split()) +if n<10: + c=100*(10-n) + ans=k-c + if ans<0: + print(0) + exit() + else: + print(k-c) +else: + print(k)" +p02765,s657701630,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r- 100*(10-n))" +p02765,s298487470,Wrong Answer,"# input +N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R - (100 * (10 - N)))" +p02765,s938495550,Wrong Answer,"n,m=map(int,input().split()) +if n<10: + print(m+800) +else: + print(m)" +p02765,s695192423,Wrong Answer,"N,R=map(int,input().split()) +if(N>=10): + print(R) +else: + print(R+1000-100*R)" +p02765,s192090630,Wrong Answer,"N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R - 100*(10-N))" +p02765,s657807305,Wrong Answer,"from sys import stdin + +n,k = map(int,input().split()) + +num = n +sum_k = k + +while sum_k <= n: + sum_k= sum_k * k + +print(len(str(sum_k))) +" +p02765,s584391568,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + a=R +else: + a=100*(10-N) +print(a) +" +p02765,s720810925,Wrong Answer,"N,R=input().split() + +N=int(N) +R=int(R) + +if N>=10: + print (R) +else: + print(R-(100*(10-N)))" +p02765,s650944057,Wrong Answer,"n, r = map(int, input().split()) + +if 10 <= n: print(r) +else: print(r-(100*(10-n)))" +p02765,s719894838,Wrong Answer,"def f(): + n, r = map(int,input().split()) + if n > 9: + return r + else: + return 100 * (10 - n) +" +p02765,s019828129,Wrong Answer,"def E(N,R): + if int(N)==N and int(R)==R: + if 1<= N <= 100 and 0<= R <= 4111: + if N > 10: + M =R + print(M) + else: + K = 100 * (10 - N) + M = R + K + print(M)" +p02765,s693034592,Wrong Answer,"N, R = map(int, input().split()) +if N > 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s357900738,Wrong Answer,"N,R = list(map(int, input().split())) +if N >= 10: + print(R)" +p02765,s638074677,Wrong Answer,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s567831677,Wrong Answer,"def contest(N, R): + if(N > 10): + return R + else: + return R + 100 * (10-N) + +if __name__ == ""__main__"": + N, R = map(int, input().split())" +p02765,s744586782,Wrong Answer,"n,r = map(int,input().split()) +if(n <=10): + print(r-100*(10-n)) +else: + print(r)" +p02765,s373441307,Wrong Answer,"N,K=map(int,input().split()) +if N >=10: + print(K) +else: + print(K-100*(10-N))" +p02765,s907412240,Wrong Answer,"# -*- coding: utf-8 -*- +N,R=map(int,input().split()) +print(R+100*(10-min(N, 9)))" +p02765,s685023708,Wrong Answer,"k = list(map(int, input().split())) +if k[0] >= 10: + print(k[1]) +else: + print(100*(10-k[0]))" +p02765,s473248846,Wrong Answer,"N, R = map(int, input().split("" "")) + +if N < 10: + print(R + N*100) +else: + print(R)" +p02765,s526212422,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s016592725,Wrong Answer,"N,R = map(int,input().split()) +if N >= 10: + rat = R +else: + rat = R - 100*(10-N) +print(int(rat))" +p02765,s909045878,Wrong Answer,"n,k = map(int, input().split()) + +for i in range(1,10): + if n < k ** i: + print(i - 1) + break" +p02765,s751062772,Wrong Answer,"n,r=map(int, input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s174341746,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + ans = r + 100 * (10 - r) + print(ans) +" +p02765,s433347936,Wrong Answer,"n, r = map(int, input().split()) + +ans = r +ans += 100 * (10 - n) + +print(ans) +" +p02765,s285057430,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R - 100 * (10 - N)) " +p02765,s386732664,Wrong Answer,"n,r = list(map(int,input().split())) + +if n>=10: + print(r) +else: + t = 100*(10-n) + print(r-t)" +p02765,s150665578,Wrong Answer,"# abc156_a.py +N, R = map(int,input().split()) +if N<10: + print(R + 100*10-N) +else: + print(R)" +p02765,s040954973,Wrong Answer,"N,R = map(int,input().split()) +if N<10 : + print( R -(100*(10-N))) +else: + print(R)" +p02765,s184838509,Wrong Answer,"N,R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s766842923,Wrong Answer,"N,R = map(int, input().split()) + +if N < 10: + A = 100*(10-N) + + print(R-A) +else: + print(R)" +p02765,s847237800,Wrong Answer,"a,b=list(map(int,input().split())) +if a<0: + print(100*(10-a)+b) +else: + print(b) +" +p02765,s528886631,Wrong Answer,"n, r = map(int, input().split()) +print( r if n <= 10 else r-100*(10-n)) +" +p02765,s827030897,Wrong Answer,"n, r = map(int, input().strip().split()) + +if n>=10: + print(r) +else: + print(r+100*(10-r))" +p02765,s474012058,Wrong Answer,"n,r=map(int,input().split()) + +if n>=10: + print(r) + +else: + print(100*(10-n))" +p02765,s268187827,Wrong Answer,"def E(N,R): + if int(N)==N and int(R)==R: + if 1<= N <= 100 and 0<= R <= 4111: + if N > 10: + print(R) + else: + K = 100 * (10 - N) + print(R+K)" +p02765,s675470774,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + a = 100 * (10 - n) + b = r - a + if b >=0: + print(b) + else: + print(0) +else: + print(r)" +p02765,s379020598,Wrong Answer,"N,R = input().split() + +N = int(N) +R = int(R) + +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s571944268,Wrong Answer,"L, R = map(int, input().split()) +print(type(L), L, R) + +if L < 10: + print(R + (100*(10-L))) +else: + print(R) +" +p02765,s739726273,Wrong Answer,"N, R = map(int, input().split()) +print(R if N >= 10 else R-100*(10-N))" +p02765,s995372339,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n))" +p02765,s687022045,Wrong Answer,"a,b=map(int,input().split()) +if a>=10: + print(b) +else: + print(100*(10-2)+b)" +p02765,s590406538,Wrong Answer,"N, R = map(int,input().split()) +if N >= 10: + print(N) +else: + print(R+100*(10-N))" +p02765,s333959422,Wrong Answer,"# print('input >>') +N, R = map(int,(input().split())) + +if N < 10: + ans = R - 100 * (10-N) +else: + ans = R + +# print('-----output-----') +print(ans)" +p02765,s930951058,Wrong Answer,"m,n = map(int,input().split()) +if m>=10: + print(n) +else: + print(n+(100-m))" +p02765,s799645659,Wrong Answer,"import sys + +stdin = sys.stdin + +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) +ns = lambda: stdin.readline().rstrip() # ignore trailing spaces + +n, r = na() + +if n >= 10: + print(r) +else: + print(100*(10-n))" +p02765,s633297314,Wrong Answer,"N, R = map(int, input().split()) +print(R + 100*(10-N))" +p02765,s946588214,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + print(r + 800) +else: + print(r)" +p02765,s914236941,Wrong Answer,"N,R = map(int,input().split()) +print(type(N), N, R) + +if N<10: + R=R+100*(10-N) + print(R) +else: + print(R)" +p02765,s198291769,Wrong Answer,"N,R = input(""N: "").split() +#R = input(""R: "") +N = int(N) +R = int(R) +if N<10: + A = (100*(10-N)) + R = R + A + print(R) +else: + print(R)" +p02765,s219642525,Wrong Answer,"n,r = [int(x) for x in input().split()] + +if n < 10: + print(r - 100*(10-n)) +else: + print(r)" +p02765,s193429219,Wrong Answer,"n, k=map(int,input().split()) +x=100*(100-n) +if n>9: + x=0 +print(k+x)" +p02765,s861879572,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(100-10*r)" +p02765,s094516803,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r-100*(10-n))" +p02765,s133379219,Wrong Answer,"n,r = map(int,input().split()) + +if n<10: + print(r-100*(10-n)) +else: + print(r)" +p02765,s196922024,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n)) +" +p02765,s539007329,Wrong Answer,"N, P = list(map(int, input().split())) +if N >= 10: + print(P) +else: + print(P - 100*(10-N))" +p02765,s323497824,Wrong Answer,"def E(N,R): + if int(N)==N and int(R)==R: + if 1<= N <= 100 and 0<= R <= 4111: + if N > 10: + print(R) + else: + K = 100 * (10 - N) + print(R+K) + else: + print('please input right numbers') + else: + print('please input an integer')" +p02765,s975347873,Wrong Answer,"n,r = map(int,input().split()) +ans = 0 + +if n >= 10: + ans = r +else: + ans = 100 * (10 - n) + +print(ans)" +p02765,s835318294,Wrong Answer,"n, r = map(int, input().split()) +if n >= n: + print(r) +else: + print(r + 100(10-n))" +p02765,s575215380,Wrong Answer,"N, R = map(int,input().split()) +if N >= 10 : + print(R) +else: + print(R - 100*(10-N)) + +" +p02765,s077227342,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(100*(10-n)) +" +p02765,s158910463,Wrong Answer,"import numpy as np + +i = list(map(int, input().split())) +N = i[0] +R = i[1] + +if N>=10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s042337633,Wrong Answer,"N,R = map(int, input().split()) + +if N>=10: + print(R) +else: + print(R - 100 * (10-N))" +p02765,s135080651,Wrong Answer,"N,R = list(map(int,input().split())) + +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s210265108,Wrong Answer,"N,R = map(int,input().split()) +if N > 9: + print(R) +else: + print(R + 100*(N-1))" +p02765,s066482180,Wrong Answer,"N,R =map(int,input().split()) +if N>=10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s880455886,Wrong Answer,"N,R = [int(i) for i in input().split()] + +if N < 10: + print(R + (100 * (10 - 2))) +else: + print(R)" +p02765,s557120214,Wrong Answer,"sum,rate=map(int,input().split()) +if sum>=10: + print(rate) +else: + ans=rate-100*(10-sum) + print(ans) " +p02765,s139452922,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + print(100*(10-N) + R) +print(R)" +p02765,s641011021,Wrong Answer,"n,r = map(int, input().split()) + +if n >= 10: + print(r) +else: + print(100*(10-n)) +" +p02765,s679140265,Wrong Answer,"N,R=(int(i)for i in input().split()) + +if N >= 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s891128604,Wrong Answer,"#!/usr/local/bin python +# -*- coding: utf-8 -*- +# +# ~/PycharmProjects/atcoder/B-Digits.py +# +# 1<= n <= 10**9 +# 2<= k <= 10 +# + +n, k = map(int, input().split()) + +digits = int(1) + +for digit in range(1, 30): # 2**29 < 10**9 < 2**<30 なので最高でも30桁 + if k ** digit <= n: + digits = digits + 1 + else: + break + +print(digits) +" +p02765,s829887604,Wrong Answer,"n,r=map(int,input().split("" "")) +if n >= 10: + print(r) +else: + print(r+100*(10*n)) +" +p02765,s324429687,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(100 * (10 - N))" +p02765,s347933700,Wrong Answer,"N,R = map(int,input().split()) +if N>=R: + print(R) +else: + print(R+100*(10-N))" +p02765,s730541562,Wrong Answer,"N, R = map(int, input().split()) +print(R if N>=10 else R-100*(10-N)) +" +p02765,s330522852,Wrong Answer,"n, r = [int(_) for _ in input().split()] +print(r if n >= 10 else r - 100 * (10 - n)) +" +p02765,s556596191,Wrong Answer,"N,R = map(int,input().split()) + +print(R + (100*(10-N)))" +p02765,s438786121,Wrong Answer,"N, R = map(int,input().split()) +if N >= 10 : + print(R) +else: + print(100*(10-R)) + +" +p02765,s982046540,Wrong Answer,"N, R = map(int, input().split()) + +A = int(0) + + +if N>=10: + A = N +else: + A = 100*(10-N)+R + +print(A)" +p02765,s085646449,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + ans = R - 100 * (10 - N) +else: + ans = R +print(ans)" +p02765,s082154085,Wrong Answer,"n,r = map(int,input().split()) +if (n<10): + print(r+100*(10-n)) +elif(n>10): + print(n) +" +p02765,s859338768,Wrong Answer,"def resolve(): + n, r = map(int, input().split()) + if n < 10: + print(100*(10-n)+r) + else: + print(r)" +p02765,s276145394,Wrong Answer,"N,R = map(int,input().split()) +if N < 10 : + print( 100*(10 - N) ) +else : + print( R ) +" +p02765,s963132790,Wrong Answer,"N,R = map(int,input().split()) + +if N < 10: + print(R + N) +else: + print(N)" +p02765,s447116513,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s129166674,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + naibu=r +else: + naibu=r-100*(10-n) +print(naibu)" +p02765,s587558452,Wrong Answer,"N,R=map(int, input().split()) +if N>=10: + t=R +else : + t=R+100*(10-N) +print(R) " +p02765,s944098518,Wrong Answer,"N,R = map(int,input().split()) +if N < 10: + R = R - 100 * (10 - N) + print(R) +else: + print(R)" +p02765,s547218921,Wrong Answer,"n,r = map(int,input().split()) +print(r if n >= 10 else r - 100*(10-n))" +p02765,s104131519,Wrong Answer,"n,r=map(int,input().split()) + +if n>=10: + print(r) +elif n<10: + print(r-(100*(10-n)))" +p02765,s064738615,Wrong Answer,"a,b=map(int,input().split()) +if(a<10): + print(b-100*(10-a)) +else: + print(b)" +p02765,s207078064,Wrong Answer,"N,R = map(int,input().split()) + +if N <= 10: + print(R - (10-N)*100) +else: + print(R)" +p02765,s906123049,Wrong Answer,"a, m = map(int, input().split()) +if a >=10: + print(m) +else: + out = m - 100 *(10-a) + if out <= 1: + print(1) + else: + print(out)" +p02765,s702096832,Wrong Answer,"n,r = map(int,input().split()) +if n<10: + r = 100*(10-n) +print(r) +" +p02765,s818531267,Wrong Answer,"# int +# A = list(map(int, input().split())) +# string +# S = input().split() + +N, R = map(int, input().split()) + +if N >= 10: + print(R) +else: + print(100 * (10-N))" +p02765,s884525301,Wrong Answer,"n, r = map(int, input().split()) +if n < 10: + ans = r - (100 * (10 - n)) + print(ans) +else: + print(r)" +p02765,s712256733,Wrong Answer,"n,r = map(int,input().split()) +if n >= 10: + print(r) +else: + print(100*(10-n))" +p02765,s460901693,Wrong Answer,"N,R = map(int,input().split()) +if N < 10: + print((100*(10-2))+R) +else: + print(R)" +p02765,s131633602,Wrong Answer,"n,r = map(int, raw_input().split(' ')) +def f(n,r): + if n >= 10: + return r + else: + return r - 100 * (10 - n) +print f(n,r)" +p02765,s758714640,Wrong Answer,"N, R = list(map(int, input().split())) + +if N < 10: + print(100 * (10 - N)) +else: + print(R)" +p02765,s294133508,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + O = N +else: + O = R + 100*(10-N) +print(O)" +p02765,s599909695,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + print(N + R) +print(R)" +p02765,s278389047,Wrong Answer,"N,R = list(map(int, input().split())) +if R >= 10: + print(R) +else: + print(R - (100*(10-N)))" +p02765,s857658599,Wrong Answer,"N,R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R-(100*(10-N)))" +p02765,s699130546,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R-100*(10-N))" +p02765,s053366647,Wrong Answer,"a,b = map(int,input().split()) +c= b + 100*(10-a) +print(c)" +p02765,s508983087,Wrong Answer,"n, r = map(int,input().split()) +print(r-10*max(0,10-n))" +p02765,s997462037,Wrong Answer,"N,R = map(int,input().split()) +if N< 10: + A = 10-N + print(100*A) +else: + print(R)" +p02765,s394969785,Wrong Answer,"N, R = map(int, input().split()) +if N > 10: + print(R) +else: + print(R-100*(10-N))" +p02765,s732396528,Wrong Answer,"N,R=map(int,input().split()) +if(N>=10): + print(R) +else: + print(R-100*(10-N))" +p02765,s987935038,Wrong Answer,"a,b = map(int,input().split()) +if a>=10: + print(b) +else: + print(100*(10-b))" +p02765,s710620987,Wrong Answer,"n,k = map(int,input().split()) + +for i in range(10**10): + if n <= k**(i+1) -1: + print(i+1) + exit()" +p02765,s990218033,Wrong Answer,"n, r = [int(elem) for elem in input().split()] + +if n < 10: + print(r - 100 *(10-n)) +else: + print(r)" +p02765,s390747987,Wrong Answer,"N,R = map(int,input().split()) +print(R if N <= 10 else R+N*100)" +p02765,s370880294,Wrong Answer,"n,r = map(int,input().split()) +ans = n +if n < 10: + ans = r + 100*(10-n) +print(ans)" +p02765,s849549498,Wrong Answer,"N, R = map(int, input().split()) +if N < 10: + print(R - 100 * (10 - N)) +else: + print(R)" +p02765,s854134896,Wrong Answer,"N, R = map(int, input().split()) + +print(R if 10 <= N else (R - (100 * (10 - N))))" +p02765,s045150603,Wrong Answer,"n, r = map(int,input().split()) + +if n>10: + print(r) +else: + print(r-(100*(10-n)))" +p02765,s113918915,Wrong Answer,"attend, rate = input().split(' ') + +if int(attend) >= 10: + print(rate) +else: + print(int(rate) - 100 * (10 - int(attend)))" +p02765,s099331095,Wrong Answer,"n, k = list(map(int, input().split(' '))) +print(n - 100 * (10 - min(10, k) * 2))" +p02765,s218926235,Wrong Answer,"N,R = input().split() +N,R = int(N),int(R) +L = R +if N < 10: + L = R - 100*(10-N) +else: + L = R + +print(L) +" +p02765,s931039877,Wrong Answer,"K,R = map (int, input ().split ()) +if K < 10: + print (R-100*(10-K)) +else: + print (R)" +p02765,s564811370,Wrong Answer,"N,R = map(int,input().split()) +if N <= 10: + print(R+(100*(10-2))) +else: + print(R)" +p02765,s056026104,Wrong Answer,"n,r=input().split() +n=int(n) +r=int(r) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s322981966,Wrong Answer,"n, r = map(int, input().split()) +if n <= 10: + print(r) +else: + print(r - 100 * (10 - n)) + " +p02765,s251995679,Wrong Answer,"n, k = map(int, input().split()) + +i = 0 +while n > 0: + n = n - k**i + if n < 0: + break + i += 1 + +print(i)" +p02765,s509511590,Wrong Answer,"n, r = map(int, input().split()) +if n < 10: + print(r - 100 * (10 - n)) +else: + print(r)" +p02765,s053402070,Wrong Answer,"N, R = map(int, input().split(' ')) +if N < 9: + L = R+100*(10-N) + print('{}, {}'.format(N, L)) + +else: + print('{}, {}'.format(N, R)) +" +p02765,s345811068,Wrong Answer,"tmp = input().split("" "") + +N = int(tmp[0]) +R = int(tmp[1]) + +if N >= 10: + print(R) +else: + ans = R + 100 * (100 - N) + print(int(ans))" +p02765,s501915949,Wrong Answer,"N , R = map(int,input().split()) +if N >= 10: + print(R) +else: + print(N + 100*(10 - R))" +p02765,s981778856,Wrong Answer,"N, R = map(int, input().split()) + +print(R if 10 <= N else (100 * (10 - N)))" +p02765,s430865788,Wrong Answer,"n, r = map(int, input().split()) + +if n < 10: + a = 100 * (10 - n) + print(r - a) +else: + print(r)" +p02765,s537607481,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n)) +" +p02765,s406241516,Wrong Answer,"N,R=map(int,input().split()) +if N<10: + print(100*(10-N)) +else: + print(R)" +p02765,s494820066,Wrong Answer,"N, R = map(int, input().split()) +print(R + 100 * (10 - N))" +p02765,s217695875,Wrong Answer,"N, R = map(int, input().split()) +if (N>=10): + print(R) +else: + print(R-100*(10-N))" +p02765,s491465654,Wrong Answer,"a,b=map(int,input().split()) +print(b+100*min(0,(10-a)))" +p02765,s706951766,Wrong Answer,"#A +n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n))" +p02765,s994736108,Wrong Answer,"n, r = map(int,input().split()) + +if n > 10: + print(r) +else: + print(r - 100 * (10 - n ))" +p02765,s020891757,Wrong Answer,"N,R= map(int,input().split()) +if N > 9: + print(R) +else: + print(R-10*(10-N))" +p02765,s021986627,Wrong Answer,"n,r = map(int,input().split()) +if n < 10: + print(r+100*(10-n)) +else: + print(n)" +p02765,s764998203,Wrong Answer,"a,b = list(map(int, input().split())) +if a < 10: + print(b-1000+100*a) +else: + print(b) +" +p02765,s607953214,Wrong Answer,"N,R=input().split() +N=int(N) +R=int(R) +if N>=10: + print(R) +else : + print(100*(10-N))" +p02765,s108391020,Wrong Answer,"n,r = input().split() +n = int(n) +r = int(r) + +if n >= 10: + i = r +else: + i = r + 100 * (10 - n)" +p02765,s201896084,Wrong Answer,"N, R = map(int, input().split()) +if N<=2: + print(R + (10-N)*100) +else: + print(R)" +p02765,s567055281,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r - 100 * (10 - n))" +p02765,s666443774,Wrong Answer,"def resolve(): + N, R = map(int, input().split()) + + if N < 10: + print(R) + else: + R = R + 100 * (10 - N) + print(R) + +if __name__ == ""__main__"": + resolve()" +p02765,s159043642,Wrong Answer,"n, r = map(int, input().split()) +print(n, r) + +ans = 0 +if n >= 10: + ans = r +else: + ans = r + (100 * (10 - n)) + +print(ans)" +p02765,s639454125,Wrong Answer,"n, r = map(int,input().split()) +if n < 10: + print(r-100*(10-n)) +else: + print(r) +" +p02765,s612359725,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s321976856,Wrong Answer,"N,R=map(int, input().split()) +if N>=10: + print(R) +if 0<=N<=10: + print(R+100*(10-N))" +p02765,s511237843,Wrong Answer,"n, R = map(int, input().split()) +if n >= 10: + print(R) +else: + print(R-100*(10-n))" +p02765,s015582932,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + R-=100*(10-N) + print(R) +" +p02765,s300142730,Wrong Answer,"n,r=map(int,input().split()) + +if n>=10: + print(r) +else: + print(r+10000-100*n) +" +p02765,s730540141,Wrong Answer,"def resolve(): + N, R = map(int, input().split()) + + if N >= 10: + print(R) + else: + R = R - 100 * (10 - N) + print(R) + +if __name__ == ""__main__"": + resolve()" +p02765,s360701712,Wrong Answer,"N,R = map(int, input().split()) +print(R - 100 * (10 - max(10,N)))" +p02765,s424756627,Wrong Answer,"N, R = map(int, input().split()) +rating = R if N >= 10 else R - 100*(10-N) +print(rating if rating > 0 else 0)" +p02765,s607719010,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-1000+100*n)" +p02765,s698812438,Wrong Answer,"N,K = map(int, input().split()) +counter = 0 +K_ = 1 +i=True +while i==True: + K_ = K_ * K + if K < K_: + print(counter) + i=False + counter += 1" +p02765,s861553803,Wrong Answer,"n, r = map(int, input().split()) +print(r - (10 - min(n, 10)) * 100)" +p02765,s112221112,Wrong Answer,"N, R = map(int, input().split()) +print(R if N >= 10 else 100 * (10 - N)) +" +p02765,s386306613,Wrong Answer,"n,r=map(int,input().split()) +if n<10: + r+=100*(10-r) +print(r)" +p02765,s526721903,Wrong Answer,"N,K=map(int,input().split()) +A=0 +while N>=K**A: + A=A+1 + +print(A)" +p02765,s112378704,Wrong Answer,"n,r=map(int,input().split()) +if n<10: + r+=800 +print(r)" +p02765,s536092498,Wrong Answer,"c, d = map(int, input().split()) + +print(d + 100 * (10-c))" +p02765,s283532622,Wrong Answer,"n, r = map(int, input().split()) +if n >= 10: + print(r) +else: + print(r + 100 * (10 - r))" +p02765,s645228080,Wrong Answer,"N,K=[int(s) for s in input().split()] +if N<10: + print(K-(10-N)*100) +else: + print(K)" +p02765,s539276599,Wrong Answer,"n,k = map(int,input().split()) +P = 10**9+7 + +ans = 1 +nCl = 1 +n1Cl = 1 +for l in range(1,min(k+1,n)): + nCl = nCl*(n+1-l)*pow(l,P-2,P)%P + n1Cl = n1Cl*(n-l)*pow(l,P-2,P)%P + ans = (ans+nCl*n1Cl)%P + +print(ans) +" +p02765,s094314886,Wrong Answer,"InputValue = input().split(' ') + +print(InputValue[0]) + +N = int(InputValue[0]) +R = int(InputValue[1]) + +if 0<=R<=4111 and 1<=N<=100: + if N>=10: + IR = R + print(IR,end='\n') + elif N<10: + IR = R + 100*(10-N) + print(IR,end='\n')" +p02765,s513462237,Wrong Answer,"a,b = map(int, input().split()) +if a < 10: + ans = b + 100*(10 - a) +else: + ans = b +print(b) + +" +p02765,s483822357,Wrong Answer,"n,r = map(int,input().split()) +a = min(10,n) +a = 100*(10-a) +print(r-a)" +p02765,s835258223,Wrong Answer,"N,R=map(int, input().split()) +print(R if N>=10 else R-100*(10-N))" +p02765,s795075346,Wrong Answer,"n,r=map(int,input().split()) + +if n>=10: + print(r) + +else: + print(r-(100*(10-n))) + +" +p02765,s284493084,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(R+100*(10-R)) +" +p02765,s759912647,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(R*(10-N)) +" +p02765,s228126903,Wrong Answer,"n, r = map(int, input().split()) +print(n + 100 * (10-r)) +" +p02765,s931444708,Wrong Answer,"N,R = map(int,input().split()) +if N < 10 : + print(R - 100*(10-N)) +else : + print(R)" +p02765,s803043114,Wrong Answer,"n,k=map(int,input().split()) +i=0 + + +while n>=k**i: + + i+=1 + +else: + print(i) +" +p02765,s239914862,Wrong Answer,"N,R = map(int,input().split()) + +if N >= 10: + print(R) + +else: + print(R-100*(10-N))" +p02765,s891635106,Wrong Answer,"from sys import stdin +n,k = map(int,stdin.readline().rstrip().split()) +if n >= 10: + print(k) +else: + print(n*100+k)" +p02765,s219805535,Wrong Answer,"x,y = map(int,input().split()) +print(y+(100*(10-x)))" +p02765,s045721460,Wrong Answer,"N, R = map(int, input().split()) +if N >= 10: + print(R) +else: + print(100*(10-N))" +p02765,s378318411,Wrong Answer,"N,R = list(map(int,input().split())) +print(N,R) + +if N < 10: + X = R + 100*(10-N) +else: + X = R +print(X) +" +p02765,s901464821,Wrong Answer,"n,r = map(int,input().split()) +rate = 0 + +if n<10: + rate = r + 100*(10-n) +elif n>10: + rate = r + +print(rate) +" +p02765,s492223782,Wrong Answer,"N,K=map(int,input().split()) +i=0 +while N>=K**i: + i+=1 +print(i)" +p02765,s834527382,Wrong Answer,"l = list(map(int, input().split())) + +if l[0] > 10: + print(l[1]) +else: + print(100*(10-l[1]))" +p02765,s643985668,Wrong Answer,"n,r = map(int,input().split()) + +print(100 * (10 - n) + r) +" +p02765,s854842159,Wrong Answer,"N,R = list(map(int,input().split())) +print( int(R + 100*max(0,10)) )" +p02765,s252471714,Wrong Answer,"N,R=map(int, input().split()) + +if N >= 10: + print(R) +else: + print(R - 100*(10-N))" +p02765,s581983916,Wrong Answer,"n,r = map(int,input().split()) + +if n >= 10: + print(r) +else: + r -= 100*(10-n) + print(r) +" +p02765,s167661259,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + r-=100*(10-n) + print(r) + " +p02765,s060043165,Wrong Answer,"n,r = map(int,input().split()) + +if n < 10: + print(r-(100*(10-n))) +else: + print(r) +" +p02765,s640072018,Wrong Answer,"from sys import stdin + + +def get_result(data): + N, R = data + return int(R + 100 * (10 - N)) + +if __name__ == '__main__': + data = list(map(int, stdin.readline().split(' '))) + result = get_result(data) + print(result) +" +p02765,s281010646,Wrong Answer,"import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +sys.setrecursionlimit(10 ** 7) + +n, r = map(int, readline().split()) +if 10 < r: + print(r) +else: + print(100 * (10 - n) + r) +" +p02765,s376735049,Wrong Answer,"def main(): + B = list(map(int, input().split())) + # # [1,2,3] + N = B[0] + R = B[1] + + if N < 10: + print(R) + else: + A = 100 * (10 - N) + + print(R + A) + +main()" +p02765,s987469826,Wrong Answer,"N,R = map(int,input().split()) +if N<10: + N -= 10 + float(N) + N *= 100 + R -= N + print('R') +else: + print('R')" +p02765,s769040921,Wrong Answer,"n,r = map(int,input().split()) +if 0 <= n <= 10: + print(r-100*(10-n)) +else: + print(r)" +p02765,s665786585,Wrong Answer,"n,r=map(int,input().split()) +if n>=10: + print(r) +else: + print(r-100*(10-n))" +p02765,s041727213,Wrong Answer,"N, R = map(int, input().split()) +print(R if 10>=N else R + 100*(10-N))" +p02765,s554606235,Wrong Answer,"N,R=map(int,input().split()) + +if N<10: + r=R-(100*(10-N)) +else: + r=R +print(r)" +p02765,s764969171,Wrong Answer,"N,R = map(int,input().split()) + +inside = 0 +if N >= 10: + inside = R +else: + inside = R - 100*(10-N) + +print(inside) + " +p02765,s347986281,Wrong Answer,"N,R=map(int,input().split()) +if N>=10: + print(R) +else: + print(100*(10-N))" +p02765,s926195910,Wrong Answer,"n, r= map(int, input().split()) + +if(n<10): + print(100*(10-2)+r) +else: + print(r) +" +p02765,s976164120,Wrong Answer,"n,r = map(int,input().split()) +if n > 10: + n = 10 +print( r - 100 * (10 -n))" +p02765,s030979248,Wrong Answer,"n, r = list(map(int, input().split())) + +if n >= 10: + print(n) +else: + print(r + 100 * (10 - n)) +" +p02953,s474656558,Accepted,"import sys +import numpy as np + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +N = ir() +H = np.array(lr()) +X = np.minimum.accumulate(H[::-1])[::-1] +Y = H - X +answer = np.any(Y>=2) +print('No' if answer else 'Yes') +" +p02953,s238814090,Accepted,"n = int(input()) +h = list(map(int,input().split())) +ans = 'Yes' +temp = h[0] +for i in range(1,n): + if h[i]>temp: + h[i] -= 1 + elif temp>h[i]: + ans = 'No' + temp = h[i] +print(ans)" +p02953,s921756265,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +ans = 'Yes' +_max = 0 +for i in H: + if _max < i - 1: + _max = i - 1 + if _max > i: + ans = 'No' +print(ans)" +p02953,s367911410,Accepted,"n,*l=map(int,open(0).read().split()) +t=0 +for i in l: + if it: i-=1 + t=i +else: print('Yes')" +p02953,s620754641,Accepted,"def solve(): + N = int(input()) + H = list(map(int, input().split())) + h_max = H[0] + ret = True + for h in H: + if h_max-1 > h: + ret = False + break + if h_max < h: + h_max = h + print('Yes' if ret else 'No') + +solve()" +p02953,s623761382,Accepted,"n=int(input()) +h=list(map(int, input().split())) +c=0 +if n!=1: + for i in reversed(range(n-1)): + if h[i]==h[i+1]+1: + h[i]-=1 + elif h[i]-h[i+1]>=2: + c=1 + if c==0: + print(""Yes"") + else: + print(""No"") +else: + print(""Yes"")" +p02953,s533570790,Accepted,"N = int(input()) +H = list(map(int,input().split())) +for i in range(N-1,0,-1): + if H[i] < H[i-1]: + H[i-1] = H[i-1]-1 + if H[i] < H[i-1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s793431261,Accepted,"N = int(input()) +H = list(map(int, input().split())) +max_h = H[0] +flag = 0 + +for i in range(1, N): + max_h = max(max_h, H[i]) + if max_h - H[i] > 1: + flag += 1 + +if flag: + print('No') +else: + print('Yes') +" +p02953,s283857195,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +ans = 'Yes' +H_floor = 0 +for h in H: + if h - H_floor < 0: + ans = 'No' + break + else: + H_floor = max(H_floor, h - 1) + +print(ans)" +p02953,s035369392,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +tmp = h[0] - 1 +for i in range(1,n): + if tmp == h[i]: + tmp = h[i] + elif tmp < h[i]: + tmp = h[i] - 1 + else: + print('No') + exit() +print(""Yes"")" +p02953,s129272755,Accepted,"#!/usr/bin/env python3 +def solve(a): + for i in range(len(a)-1): + if a[i+1] - a[i] <= -2: + return ""No"" + elif a[i+1] - a[i] == -1: + a[i+1] += 1 + return ""Yes"" + +def main(): + N = int(input()) + A = [0] + list(map(int,input().split())) + print(solve(A)) + +if __name__ == '__main__': + main()" +p02953,s967792481,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +base = 0 +for h in H: + if(base > h): + print(""No"") + break + base = max(base, h-1) +else: + print(""Yes"") +" +p02953,s573550756,Accepted,"import sys +N=int(input()) + +H=[int(x) for x in input().rstrip().split()] +flag=0 +mi=-1 +for i in range(N-1): + + if H[i]<=H[i+1] and mi<=H[i]: + mi=max(mi,H[i]-1) + continue + elif H[i+1] H[N-i]: + ans = 'No' + break + +print(ans)" +p02953,s058645900,Accepted,"def resolve(): + + n=int(input()) + H=list(map(int,input().split())) + def main(): + if n == 1: + return 'Yes' + maxval=0 + for i in range(n): + if maxval-2>=H[i]: + return 'No' + else: + maxval=max(maxval,H[i]) + return 'Yes' + print(main()) + + +resolve() +" +p02953,s510242326,Accepted,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +FL=False +Fx=-1 +for i in range(n-1): + if n==1: + break + if h[i]>=Fx: + FL=False + if h[i]-h[i+1]==1: + if FL: + ans=""No"" + break + else: + FL=True + Fx=h[i] + elif h[i]-h[i+1]>1: + ans=""No"" + break + +print(ans)" +p02953,s379406869,Accepted,"from sys import exit +n=int(input()) +H=list(map(int,input().split())) +H[0] -= 1 +for i in range(n-1): + if H[i]>H[i+1]: + print(""No"") + exit() + elif H[i]!=H[i+1]: + H[i+1] -= 1 +print(""Yes"")" +p02953,s835165289,Accepted,"import math +import os +import random +import re +import sys + +def check_non_decreasing_squares(n: int, a: list): + p = a[0] + for i in range(1, n): + if a[i] > p: + p = a[i] + if p - a[i] == 1 or p - a[i] == 0: + continue + print(""No"") + exit(0) + print(""Yes"") + +if __name__ == '__main__': + n = int(input()) + a = list(map(int, input().rstrip().split())) + check_non_decreasing_squares(n, a)" +p02953,s582047496,Accepted,"n = int(input()) +h_list = [int(x) for x in input().split()] + +ans = ""Yes"" +h_pre = h_list[0] +for h in h_list: + if h > h_pre: + h -= 1 + elif h < h_pre: + ans = ""No"" + break + h_pre = h +print(ans)" +p02953,s545586202,Accepted,"N = int(input()) +A = list(map(int,input().split())) +flag = 0 +for i in range(N-1,0,-1): + if A[i] >= A[i-1]: + continue + else: + if A[i-1]-A[i] == 1: + A[i-1] -= 1 + else: + flag += 1 + print(""No"") + break +if flag == 0: + print(""Yes"")" +p02953,s267180394,Accepted,"N = int(input()) +H = list(map(int, input().split())) +ans = ""Yes"" +H[0] = H[0] - 1 +base = 0 +for i in range(1, N): + if H[i] > H[i-1] : + H[i] = H[i] -1 + elif H[i] < H[i-1] : + ans = ""No"" +print(ans)" +p02953,s167268658,Accepted,"N = int(input()) +H = list(map(int, input().split())) +border = H[N-1] + +ans = True +for i in range(N-2, -1, -1): + if H[i] <= border: + border = H[i] + else: + if H[i] - 1 <= border: + border = H[i] - 1 + else: + ans = False + +if ans: + print(""Yes"") +else: + print(""No"")" +p02953,s984207669,Accepted,"n = int(input()) +klist = list(map(int,input().split())) +hlist = klist[::-1] +for i in range(n-1): + if hlist[i]+1 < hlist[i+1]: + print('No') + break + + if hlist[i]+1 == hlist[i+1]: + hlist[i+1] -= 1 +else:print('Yes')" +p02953,s914355493,Accepted,"# +N = int(input()) +H = list(map(int, input().split())) +ans = 0 +for n in range(N): + if ans - 1 > H[n]: + print(""No"") + exit() + ans = max(ans,H[n]) +print(""Yes"") + " +p02953,s240720600,Accepted,"def main(): + N = int(input()) + A = list(map(int,input().split())) + pre = A[0] + for i in A: + if pre > i: + print(""No"") + return + elif pre < i: + pre = i -1 + print(""Yes"") +if __name__ == ""__main__"": + main() " +p02953,s217099466,Accepted,"N = int(input()) +h = list(map(int, input().split())) +ans = True +MIN = h[0]-1 + +for i in range(N-1): + MIN = max(MIN, h[i]-1) + if h[i] > h[i+1]: + if h[i]-h[i+1] > 1: + ans = False + break + else: + if MIN > h[i+1]: + ans = False + break + +if ans: + print('Yes') +else: + print('No')" +p02953,s691805159,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +N=h[0] +for i in range(n): + if N-1 > h[i]: + print(""No"") + break + elif h[i] > N: + N = h[i] + +else: + print(""Yes"")" +p02953,s198497850,Accepted,"n = int(input()) +H = list(map(int,input().split())) + +ans = ""Yes"" +c=0 +for i in range(n-1): + if H[i]-1>H[i+1] : + ans = ""No"" + break + elif H[i]>H[i+1] : + c+=1 + if c>=2 : + ans = ""No"" + break + elif H[i]=2: + print('No') + exit() +print('Yes') +" +p02953,s615289312,Accepted,"import sys +#import numpy as np +import math +from fractions import Fraction +import itertools + +input=sys.stdin.readline + +n=int(input()) +a=list(map(int,input().split())) +s=set() +for i in range(n-1): + if a[n-1-i-1]>1+a[n-i-1]: + print(""No"") + exit() + elif a[n-i-2]==a[n-i-1]+1: + a[n-i-2]-=1 + s.add(i) +for i in range(n-1): + if a[i]>a[i+1] and i in s: + print(""No"") + exit() +print(""Yes"") +" +p02953,s085856503,Accepted,"N = int(input()) +H = list(int(x) for x in input().split()) +max = H[0] +ans = True + +for i in range(N): + if max < H[i]: + max = H[i] + elif max - 2 >= H[i]: + ans = False + break + +if ans: + print('Yes') +else: + print('No') +" +p02953,s791377434,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +f = True +H[0] -= 1 +for i in range(1, N): + if H[i - 1] > H[i]: + f = False + break + elif H[i - 1] < H[i]: + H[i] -= 1 + +print(""Yes"" if f else ""No"")" +p02953,s801973849,Accepted,"n = int(input()) +lis = list(map(int,input().split())) +lis[0]-=1 +for i in range(n-1): + if lis[i] < lis[i+1]: + lis[i+1] -= 1 + elif lis[i] > lis[i+1]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s653974777,Accepted,"n = int(input()) +nums = list(map(int,input().split())) +tall = 0 +for i in nums: + if tall - i >=2: + print('No') + exit() + tall = max(tall,i) +print('Yes')" +p02953,s188665356,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +prev = H[0] +flag = True +for i in range(N-1): + now = H[-i-1] + after = H[-i-2] + if after - now > 1: + flag = False + break + elif after - now == 1: + H[-i-2] -= 1 + else: + pass +print('Yes') if flag else print('No')" +p02953,s250978138,Accepted,"n = int(input()) +h = list(map(int,input().split())) +bh = h[0] + + +for i in range(1,n): + if bh>h[i]: + print(""No"") + exit() + elif h[i]>bh: + bh = h[i]-1 + else: + bh = h[i] + +print(""Yes"")" +p02953,s514663584,Accepted,"n=int(input()) +h=[int(x) for x in input().split()] +a=1 +for i in range(n-1): + if h[i]>h[i+1]: + h[i+1]+=1 + if h[i]>h[i+1]: + print(""No"") + a=0 + break +if a==1: + print(""Yes"")" +p02953,s285748129,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(len(H)-2, -1, -1): + if H[i] - H[i+1] == 1: + H[i] -= 1 + elif H[i] - H[i+1] >= 2: + print(""No"") + exit() + else: + continue + +print(""Yes"") + +" +p02953,s626403524,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1,0,-1): + if H[i] - H[i-1] == -1: + H[i-1] -= 1 + +for j in range(N-1): + if H[j] > H[j+1]: + print('No') + break +else: + print('Yes')" +p02953,s221466031,Accepted,"N = int(input()) +h = list(map(int, input().split())) + +for i in range(1, N): + if h[i] - h[i - 1] >= 1: + h[i] -= 1 + +for i in range(1, N): + if h[i] - h[i - 1] < 0: + print('No') + exit() + +print('Yes')" +p02953,s992943410,Accepted,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-2,-1,-1): + if h[i]>h[i+1]: + h[i]-=1 +for i in range(n-1): + if h[i]>h[i+1]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s418545410,Accepted,"n = int(input()) +h = list(map(int,input().split())) +tmp = h[0] +isOK = True +for i in range(1,n): + #print(tmp,h[i]) + if tmp < h[i]: + tmp = h[i] - 1 + elif tmp == h[i]: + tmp = h[i] + else: + isOK = False + break +if isOK: + print('Yes') +else: + print('No')" +p02953,s159265857,Accepted,"n = int(input()) +h = [int(i) for i in input().split()] +x = True +c = 0 +for i in range(n): + if i > 0 and h[i - 1] - h[i] >= 2: + x = False + break + elif i > 0 and h[i - 1] - h[i] == 1: + c += 1 + elif i > 0 and h[i] > h[i - 1] and c == 1: + c = 0 + if c == 2: + x = False + break +if x: + print(""Yes"") +else: + print(""No"")" +p02953,s813140841,Accepted,"n = int(input()) +h = list(map(int,input().split())) +flag = True +for i in range(n-1): + if h[i+1] - h[i] >= 1: + h[i+1] -= 1 + elif h[i+1] -h[i] == 0: + pass + else: + flag = False + break +if flag: + print('Yes') +else: + print('No') +" +p02953,s992593028,Accepted,"n=int(input()) +li=list(map(int, input().split())) +ans=""Yes"" +h=li[0] +for i in range(1,n): + if h-li[i]>=2: + ans=""No"" + break + h=max(h,li[i]) +print(ans)" +p02953,s199963269,Accepted,"#136c +N = int(input()) +H_list = [int(e) for e in input().split()] + +H_list[0] -= 1 #最初の奴は減らしても影響なし。 + +for i in range(1,N): + #print(H_list) + #print(H_list[i-1],H_list[i]) + + if H_list[i-1] < H_list[i]: + H_list[i] -= 1 + + if H_list[i-1] > H_list[i]: + print(""No"") + break +else: + print(""Yes"")" +p02953,s938001519,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H.reverse() +def main(): + for i in range(N-1): + if (H[i+1] - H[i] >= 2): + print(""No"") + return + if (H[i+1] - H[i] == 1): + H[i+1] -= 1 + print(""Yes"") + +main()" +p02953,s485367267,Accepted,"n=int(input()) +arr=list(map(int,input().split())) +for i in range(n-2,-1,-1): + if arr[i]>arr[i+1]: + arr[i]-=1 + if arr[i]>arr[i+1]: + print('No') + break +else: + print('Yes') +" +p02953,s074162341,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(1, N): + if H[i] - H[i - 1] > 0: + H[i] -= 1 + if H[i] - H[i - 1] < 0: + print(""No"") + break +else: + print(""Yes"")" +p02953,s763548232,Accepted,"n= int(input()) +if n==1: + print('Yes') + exit() +h=list(map(int,input().split())) +ans='Yes' +for i in range(n-1): + if h[i+1]>h[i]: + h[i+1]-=1 + elif h[i+1] h[i+1]: + memo = max(memo, h[i] - 1) + if h[i] - h[i+1] > 2 or h[i+1] < memo: + print(""No"") + exit() +print(""Yes"")" +p02953,s445028773,Accepted,"N = int(input()) +H = list(map(int, input().split())) +h = H[-1] +ans = ""Yes"" +for i in range(N-1, -1, -1): + if H[i] <= h+1: + h = min(h, H[i]) + else: + ans = ""No"" + break +print(ans)" +p02953,s347801164,Accepted,"N = int(input()) +hh = list(map(int, input().split())) + +for i in range(1, N): + if hh[i - 1] == hh[i]: + continue + else: + hh[i] -= 1 + if hh[i - 1] > hh[i]: + print(""No"") + exit() + +print(""Yes"") +" +p02953,s483958286,Accepted,"N=int(input()) +H=list(map(int,input().split())) +base=0 +for h in H: + if base>h: + print(""No"") + break + base=max(base,h-1) +else: + print(""Yes"")" +p02953,s193568649,Accepted,"n = int(input()) +H = list(map(int,input().split())) + +for i in range(1,n-1): + if H[n-1-i] == H[n-i] + 1: + H[n-1-i] -= 1 + elif not(H[n-1-i] == H[n-i] or H[n-1-i] < H[n-i]): + print('No') + exit() +print('Yes')" +p02953,s022348976,Accepted,"n = int(input()) +H = list(map(int, input().split())) + +i = -1 +for _ in range(n - 1): + if H[i - 1] - H[i] > 1: + ans = ""No"" + print(ans) + exit() + elif H[i - 1] - H[i] == 1: + H[i - 1] -= 1 + i -= 1 + +ans = ""Yes"" +print(ans) +" +p02953,s748457976,Accepted,"n = int(input()) +A = list(map(int,input().split())) +ans = 0 +for i in range(n-1): + if ans > A[i+1]: + print('No') + exit() + if A[i+1]-A[i] >= -1: + ans = max(A[i+1]-1,A[i]-1,ans) + if A[i+1] >= A[i] and A[i+1] > ans : + A[i+1] -=1 + else: + print('No') + exit() +print('Yes')" +p02953,s369590333,Accepted,"n=int(input()) +A=list(map(int,input().split())) +deka=-1 +for i in range(n): + if deka>=A[i]+2: + print(""No"") + exit() + deka=max(deka,A[i]) +print(""Yes"") + + " +p02953,s501106339,Accepted,"n = int(input()) +H = list(map(int,input().split())) +ans = ""Yes"" + +for i in range(n-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + + if H[i] > H[i+1]: + ans = ""No"" + break + +print(ans)" +p02953,s573967779,Accepted,"# C - Build Stairs + +n = int(input()) +h = list(int(x) for x in input().split()) + +ans = 'Yes' +flg = 0 #下がった状態フラグ +for i in range(1, n): + # 2段以上下がってる場合 + if h[i-1]-h[i]>1: + ans = 'No' + break + if h[i-1]-h[i]==1: + if flg==0: + flg = 1 + else: + ans = 'No' + break + if h[i-1]-h[i]<0: + flg = 0 + +print(ans) +" +p02953,s055122684,Accepted,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1,1,-1): + if 2<=h[i-1]-h[i]: + print(""No"") + exit() + elif 1==h[i-1]-h[i]: + h[i-1]-=1 +print(""Yes"") +" +p02953,s033684236,Accepted,"N = int(input()) +H = list(map(int,input().split())) +can = True + +for i in reversed(range(1,N)): + if H[i - 1] - 1 == H[i]: + H[i - 1] -= 1 + elif H[i - 1] - 1 > H[i]: + can = False + break + +print(['No', 'Yes'][can])" +p02953,s269156399,Accepted,"N = int(input()) +L = list(map(int,input().split())) +for i in range(N-1,0,-1): + if L[i-1] > L[i]: + if L[i-1] - 1>L[i]: + print(""No"") + exit() + L[i-1]-=1 +print(""Yes"")" +p02953,s865814807,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h.reverse() +pflag = True +for i in range(n - 1): + if h[i] < h[i + 1]: + h[i + 1] -= 1 + if h[i] < h[i + 1]: + pflag = False + break +if pflag == True: + print('Yes') +else: + print('No')" +p02953,s088860320,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i] - h[i+1] < 0: + h[i+1] -= 1 + if h[i] - h[i+1] > 0: + print(""No"") + exit() +print(""Yes"")" +p02953,s586943848,Accepted,"N = int(input()) +H = [int(x) for x in input().split()] +# print(N,H) +result = ""Yes"" +top = 0 +for i in range(len(H)): + if (H[i] < top-1 ): + result = ""No"" + break + top = max(top, H[i]) + +print(result)" +p02953,s670942691,Accepted,"n = int(input()) + +h = list(map(int,input().split())) + +height = h[0] + +q = 0 + +for i in h: + if i < height: + q = 1 + break + elif i > height: + height = i-1 + else: + height = i + +if q == 1: + print(""No"") +else: + print(""Yes"")" +p02953,s838225491,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[0] -= 1 +ans = ""Yes"" +for i in range(1, N): + if H[i-1] == H[i]: + continue + elif H[i-1] <= H[i]-1: + H[i] -= 1 + elif H[i-1] > H[i]: + ans = ""No"" + break + +print(ans) +" +p02953,s794062490,Accepted,"n = int(input()) +h = [int(x) for x in input().split()] + +for i in reversed(range(1, n)): + if h[i - 1] > h[i]: + h[i - 1] -= 1 + +flg = True +for i in range(n - 1): + if h[i] > h[i + 1]: + flg = False + break + +if flg: + print('Yes') +else: + print('No')" +p02953,s885304043,Accepted,"n = int(input()) + +h = list(map(int, input().split())) +h[0] -= 1 +for i in range(1, n): + if h[i - 1] < h[i]: + h[i] -= 1 + elif h[i - 1] == h[i]: + pass + else: + print(""No"") + break +else: + print(""Yes"")" +p02953,s137679100,Accepted,"n=int(input()) +h=list(map(int,input().split())) +t=0 +f=0 +for i in range(n-1): + if h[i]<=h[i+1]+1 and t now: + print(""No"") + exit() + elif last == now: # don't + last = now + else: # do + last = now-1 +print(""Yes"")" +p02953,s105692210,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +flag = True + +x = h[0] - 1 + +for i in range(1, n): + if h[i] < x: + flag = False + break + elif h[i] == x: + pass + else: + x = h[i] - 1 + +if flag: + print(""Yes"") +else: + print(""No"")" +p02953,s344352403,Accepted,"n = int(input()) +list_score = list(map(int, input().split())) +ans = ""Yes"" +max_value = 0 +for i in range(n): + if list_score[i] > max_value: + max_value = list_score[i] + if max_value - list_score[i] > 1: + ans = ""No"" + break + +print(ans) +" +p02953,s610975914,Accepted,"n = int(input()) +H = list(map(int,input().split())) +if n==1: print('Yes');exit() +H[0]-=1 +for i in range(n-1): + if H[i]>H[i+1]: + print('No');exit() + elif H[i]==H[i+1]: + continue + else: + H[i+1]-=1 +print('Yes')" +p02953,s409187449,Accepted,"n = int(input()) +h = [int(i) for i in input().split()] + +j = 0 +for i in range(n): + if h[i] == j: + pass + elif h[i] > j: + j = h[i] - 1 + else: + if h[i] == j: + pass + else: + print(""No"") + break +else: + print(""Yes"")" +p02953,s899901007,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] +ans = '' +for i in range(1, n): + if h[i - 1] >= h[i]: + next + elif h[i] - h[i - 1] == 1: + h[i] = h[i] - 1 + else: + ans = 'No' + break +if ans == '': + ans = 'Yes' +print(ans)" +p02953,s428381107,Accepted," +N = int(input()) +X = list(map(int, input().split())) + +cur = 0 +flag = True +for i in range(N): + cur = max(cur, X[i]) + if cur - X[i] > 1: + flag = False + +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s947280799,Accepted,"import sys +N = int(input()) +H = list(map(int, input().split())) + +H.reverse() +for n in range(1, N): + if H[n]-H[n-1]==1: + H[n] -= 1 + elif H[n]-H[n-1] > 1: + print(""No"") + sys.exit(0) +print(""Yes"")" +p02953,s830630472,Accepted,"import sys +input = lambda: sys.stdin.readline().rstrip() + +def main(): + n = int(input()) + h = list(map(int, input().split())) + for i in range(1, n): + if h[i] - h[i-1] >= 1: + h[i] -= 1 + if h[i-1] > h[i]: + print('No') + return + print('Yes') + +if __name__ == '__main__': + main()" +p02953,s355123517,Accepted,"n = int(input()) +h = list(map(int, input().split())) +#b = list(map(int, input().split())) +flag = [0]*n +for i in reversed(range(1, n)): + if h[i] < h[i-1]: + h[i-1] -= 1 + +for i in range(n-1): + if h[i] > h[i+1]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s200800655,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[-1] += 1 +for i in range(N - 2, 0, -1): + if H[i] == H[i + 1]: + continue + elif H[i] < H[i + 1]: + H[i] += 1 + else: + print(""No"") + break +else: + print(""Yes"") +" +p02953,s964779096,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(N-1,0,-1): + if H[i-1] - H[i] > 1: + print(""No"") + exit() + if H[i-1] - H[i] == 1: + H[i-1] -= 1 + +for i in range(N-1): + if H[i] > H[i+1]: + print(""No1"") + exit() + +print(""Yes"")" +p02953,s981550249,Accepted,"import sys, heapq + +N = int(input()) +H = list(map(int, sys.stdin.readline().rsplit())) + +pre = H[0] - 1 +for i in range(1, N): + h = H[i] + if h - pre > 0: + pre = h - 1 + elif h - pre == 0: + pre = h + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s653050397,Accepted,"N = int(input()) +H = list(map(int, input().split())) +f = True +now = H[0] +for i in range(0,N - 1): + #print(i, now) + #次が1以上小さい + if now - H[i + 1] >= 1: + f = not f + break + #次の方が1以上大きい + elif H[i + 1] - now >= 1: + now = H[i + 1] - 1 + +if f: + print(""Yes"") +else: + print(""No"")" +p02953,s446362403,Accepted,"def resolve(): + n = int(input()) + h = list(map(int, input().split())) + flag = 0 + for i in range(n-1): + if h[i] == h[i+1]: + continue + else: + h[i+1] -= 1 + if h[i] <= h[i+1]: + continue + else: + print(""No"") + exit() + print(""Yes"") +resolve()" +p02953,s242988345,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H.reverse() + +ans = True +for i in range(len(H) - 1): + if H[i] + 1 == H[i + 1]: + H[i + 1] -= 1 + if H[i] + 1 < H[i + 1]: + ans = False + break + +if ans: + print(""Yes"") +else: + print(""No"") +" +p02953,s718750943,Accepted,"N = int(input()) +hhh = list(map(int, input().split())) +for i in range(N - 2, -1, -1): + if hhh[i] <= hhh[i + 1]: + pass + elif hhh[i] - hhh[i + 1] == 1: + hhh[i] -= 1 + else: + print('No') + exit() +print('Yes') +" +p02953,s690988914,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +maxH = 0 +for i in range(N-1): + if H[i+1] >= maxH-1: + maxH = max(maxH,H[i+1]) + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s287038664,Accepted,"N = int(input()) +H = [i for i in map(int,input().split())] +ok=1 +for i in range(N-1,0,-1): + if H[i-1] > H[i]: + H[i-1] -= 1 + +for i in range(1,N-1): + if not H[i-1] <= H[i] <= H[i+1]: + ok=0 + break + +if ok: + print('Yes') +else: + print('No')" +p02953,s257497341,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +mx = H[0] +for h in H[1:]: + if h < mx-1: + print('No') + exit() + mx = max(mx, h) +print('Yes')" +p02953,s518367715,Accepted,"n = int(input()) +h = [int(i) for i in input().split()] +hmax = h[0] +count = 0 +for i in range(1,n): + if hmax-1 <= h[i]: + count += 1 + hmax = max(hmax,h[i]) + else: + break +if n-1 == count: + print('Yes') +else: + print('No')" +p02953,s304177722,Accepted,"N=int(input()) +H=list(map(int,input().split())) +if len(H)==1: + print(""Yes"") + exit() +for i in range(1,N): + if H[i-1]<=H[i]-1: + H[i]-=1 + elif H[i-1]>H[i]: + print(""No"") + exit() +else: + print(""Yes"")" +p02953,s957716950,Accepted,"def main(): + N = int(input()) + H = [int(h) for h in input().split()] + + increase = True + for i in reversed(range(1, N)): + if H[i] >= H[i-1]: + pass + elif H[i-1] - H[i] == 1: + H[i-1] -= 1 + else: + increase = False + break + + if increase: + print(""Yes"") + else: + print(""No"") + +if __name__ == ""__main__"": + main()" +p02953,s286984299,Accepted,"N=int(input()) +H=list(map(int,input().split())) + +for i in range(N): + if i==0: + continue + if H[i] height: + height = i-1 + else: + height = i + +if q == 1: + print(""No"") +else: + print(""Yes"")" +p02953,s475549332,Accepted,"# C - Build Stairs + +N = int(input()) +H = [int(h) for h in input().split()] +ans = 'Yes' +for i in range(1, N): + if H[i - 1] <= H[i] - 1: + H[i] -=1 + if H[i] < H[i - 1]: + print('No') + break +else: + print('Yes') +" +p02953,s650100570,Accepted,"n = int(input()) +H = list(map(int, input().split()))[::-1] +ok = True +for i in range(n-1): + if H[i] >= H[i+1]: continue + if H[i] >= H[i+1]-1: + H[i+1] -= 1 + else: + ok = False + break +print(""Yes"" if ok else ""No"")" +p02953,s570707604,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +maxh = 10 ** 10 +for i in range(len(H) - 1, -1, -1): + if H[i] > maxh + 1: + print(""No"") + break + if H[i] == maxh + 1: + maxh = H[i] - 1 + else: + maxh = H[i] +else: + print(""Yes"") +" +p02953,s951485589,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(N-1,0,-1): + if H[i] + 1 == H[i-1]: + H[i-1] -= 1 + elif H[i] < H[i-1]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s886135347,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + exit() + +for i in range(N - 1): + if H[i] < H[i + 1]: + H[i + 1] -= 1 + pass + elif H[i] > H[i + 1]: + print(""No"") + exit() + +print(""Yes"") +" +p02953,s142159860,Accepted,"n=int(input()) +h=list(map(int,input().split())) + +for i in range(n-1): + if h[i+1]>=h[i]+1: + h[i+1]-=1 + elif h[i+1] 0: + H[i] -= 1 + +pre = 0 +flg = True +for h in H: + if h < pre: + flg = False + break + pre = h +print('Yes' if flg else 'No') +" +p02953,s667663245,Accepted,"n = int(input()) +h = list(map(int,input().split()))[::-1] +ans = 'Yes' +for i in range(n-1): + if h[i+1] - h[i] >= 2: + ans = 'No' + elif h[i+1] - h[i] == 1: + h[i+1] -= 1 +print(ans)" +p02953,s088696094,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +now = 0 +for i in h: + if now < i: + now = i - 1 + elif now == i: + pass + else: + print('No') + break +else: + print('Yes') +" +p02953,s022685597,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +flg = True +for i in range(N-2, 0, -1): + if H[i] - 1 > H[i+1]: + flg = False + break + else: + if H[i] > H[i+1]: H[i] -= 1 +if flg: + print('Yes') +else: + print('No') +" +p02953,s660375376,Accepted,"import sys + +n = int(input()) +h = list(map(int, input().split())) + +def main(): + for i in reversed(range(n-1)): + if h[i] - h[i+1] > 1: + return False + exit() + elif h[i] - h[i+1] == 1: + h[i] -= 1 + else: + continue + return True + +if main() == True: + print('Yes') + sys.exit() + +h[n-1] -= 1 + +if main() == True: + print('Yes') + +else: + print('No')" +p02953,s127083681,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h[0] -= 1 +for i in range(1, n): + if h[i]-h[i-1] < 0: + print('No') + exit() + if h[i] - h[i-1] > 0: + h[i] -= 1 +print('Yes')" +p02953,s847085634,Accepted,"# coding: utf-8 +# Your code here! +import sys + +n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] +for i in range(1, n): + if h[i] >= h[i-1] + 2: + print(""No"") + sys.exit() + elif h[i] == h[i-1] + 1: + h[i] -= 1 +print(""Yes"") +" +p02953,s860230989,Accepted,"import math + +n = int(input()) +li = list(map(int, input().split("" ""))) + +for i in range(n - 1, 0, -1): + if li[i - 1] <= li[i]: + continue + li[i - 1] -= 1 + if li[i - 1] > li[i]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s447738849,Accepted,"n = int(input()) +h = list(map(int,input().split())) +h = h[::-1] + +for i in range(n-1): + if h[i+1] - h[i] == 1: + h[i+1] = h[i+1] - 1 + elif h[i+1] - h[i] > 1: + print(""No"") + exit() +else: + print(""Yes"")" +p02953,s969621370,Accepted,"def main(): + n = int(input()) + h = list(map(int, input().split())) + for i in reversed(range(1,n)): + if h[i-1] <= h[i]: + continue + h[i-1] = h[i-1] - 1 + if not h[i-1] <= h[i]: + print('No') + return + else: + continue + print('Yes') + +if __name__ == '__main__': + main()" +p02953,s761869392,Accepted,"N=int(input()) +W=list(map(int,input().split())) +for i in range(N-1,0,-1): + if W[i-1]>W[i]+1: + print(""No"") + exit() + elif W[i-1]==W[i]+1: + W[i-1]-=1 +print(""Yes"")" +p02953,s281178667,Accepted,"n = int(input()) +h = list(map(int, input().split())) +flag = True +for i in range(n-1): + if h[i] > h[i+1] + 1: + flag = False + break + elif h[i] == h[i+1] + 1: + h[i+1] += 1 +if flag: + print(""Yes"") +else: + print(""No"")" +p02953,s816776970,Accepted,"N = int(input()) +a = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + +else: + flag = True + for i in range(N-1): + if a[len(a)-1-i]-a[len(a)-2-i] < -1: + flag=False + break + if a[len(a)-1-i]-a[len(a)-2-i] == -1: + a[len(a)-2-i]-=1 + + print(""Yes"") if flag else print(""No"")" +p02953,s005339503,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +s=0 +flag = True + +if N==1: + print(""Yes"") + exit() + +for i in range(N-1): + s = max(s,H[i]) + if s-H[i+1]>1: + flag = False +if flag: + print(""Yes"") +else: + print(""No"")" +p02953,s272860539,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H = H[::-1] +ans = 'Yes' +for i in range(N-1): + if H[i+1] - H[i]> 1: + ans = 'No' + break + elif H[i+1] - H[i]> 0: + H[i+1] = H[i] +print(ans)" +p02953,s283541791,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +h = H[0] + +for i in range(N): + if H[i] >= h: + h=H[i] + elif H[i]-h == -1: + continue + else: + print('No') + exit() + +print('Yes')" +p02953,s636561024,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1): + if H[i+1] > H[i]: + H[i+1] -= 1 + if H[i+1] < H[i]: + print(""No"") + break +else: + print(""Yes"")" +p02953,s018976024,Accepted,"import sys + +def main(): + N = int(sys.stdin.readline().rstrip()) + H = list(map(int, input().split())) + + + for x in reversed(range(1, N)): + if H[x] >= H[x-1]: + pass + + elif H[x] == H[x-1] - 1: + H[x-1] -= 1 + + else: + print('No') + sys.exit() + + print('Yes') + + +main()" +p02953,s324165285,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +max=0 +cnt=0 +for i in range(N): + if max-H[i]>=2: + print('No') + break + else: + cnt+=1 + if H[i]>max: + max=H[i] +if cnt==N: + print('Yes') + " +p02953,s797863887,Accepted,"import math +import os +import random +import re +import sys + +def check_non_decreasing_squares(n: int, a: list): + for i in range(1, n): + if a[i] != a[i - 1]: + if a[i] - 1 < a[i - 1]: + print(""No"") + sys.exit(0) + a[i] -= 1 + print(""Yes"") + +if __name__ == '__main__': + n = int(input()) + a = list(map(int, input().rstrip().split())) + check_non_decreasing_squares(n, a)" +p02953,s760262300,Accepted,"from collections import deque + +N = int(input()) +H = deque(map(float, input().split())) + +ato = H.pop() + +if N == 1: + print('Yes') + exit() + +for i in range(N-1, 0, -1): + mae = H.pop() + if ato - mae < -1: + print('No') + exit() + elif ato - mae == -1: + ato = mae - 1 + else: + ato = mae + +print('Yes') +" +p02953,s451088640,Accepted,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +for i in range(n-1): + if h[i]h[i+1]: + ans=""No"" + break + +print(ans)" +p02953,s146665570,Accepted,"n=int(input()) +a=list(map(int,input().split())) +ans='Yes' +a[0]-=1 +for i in range(n-1): + if a[i]>a[i+1]: + ans='No' + elif a[i+1]>a[i]: + a[i+1]-=1 +print(ans)" +p02953,s081289557,Accepted,"n = int(input()) +h = list(map(int,input().split())) +check = True +for i in range(1,n): + if h[i] >= h[i-1]: + continue + elif h[i] + 1 == h[i-1]: + h[i] += 1 + else: + check = False + break +print(""Yes"" if check else ""No"")" +p02953,s934091301,Accepted,"def main(): + N = int(input()) + H = [int(x) for x in input().split()] + k = True + for i in range(1, N): + if H[i] >= H[i-1]: + if H[i] - 1 >= H[i - 1]: + H[i] = H[i] - 1 + else: + k = False + break + if k: + print(""Yes"") + else: + print(""No"") + + +if __name__ == ""__main__"": + main() +" +p02953,s491192155,Accepted,"N=int(input()) +List = list(map(int, input().split())) + +Max=0 +i=0 +while i=H[i+1]: + continue + else: + flag=False +print(""Yes"" if flag else ""No"")" +p02953,s992475045,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] + +for i in range(1, n): + dh = h[i] - h[i - 1] + if dh == 1: + h[i] -= 1 + elif dh > 1: + print('No') + exit() + +print('Yes') " +p02953,s080721847,Accepted,"N = int(input()) +A = [0]+list(map(int, input().split())) + +l = -1 +ans = ""Yes"" +for i in range(1, N+1): + if A[i] > A[i-1]: + A[i] -= 1 + elif A[i] == A[i-1]: + continue + else: + ans = ""No"" +print(ans)" +p02953,s849589449,Accepted,"N = int(input()) +H = [int(x) for x in input().split()] + +MAX = 0 +Flag = True +for T in range(0,N): + if H[T]>MAX: + MAX = H[T] + if MAX-H[T]>=2: + Flag = False + break +if Flag: + print('Yes') +else: + print('No')" +p02953,s815814071,Accepted,"def main(): + n=int(input()) + H=list(map(int,input().split())) + now=H[0]-1 + if n==0: + print('Yes') + return + for h in H[1:]: + if now > h: + print('No') + return + elif now == h: + now = h + else: + now = h -1 + print('Yes') +main()" +p02953,s688944015,Accepted,"n=int(input()) +h=list(map(int,input().split())) +k=h[0]-1 +for i in range(1,n-1): + if k<=h[i]-1:k=h[i]-1 + if k>h[i+1]: + print('No') + exit() +print('Yes')" +p02953,s773603113,Accepted,"import sys + + +inint = lambda: int(sys.stdin.readline()) +inintm = lambda: map(int, sys.stdin.readline().split()) +inintl = lambda: list(inintm()) +instrm = lambda: map(str, sys.stdin.readline().split()) +instrl = lambda: list(instrm()) + +n = inint() +H = inintl() + +h = H[0] + +for i in range(1,n): + if H[i]+1 < h: + print(""No"") + exit() + if H[i] > h: + h = H[i] + +print(""Yes"") +" +p02953,s010737719,Accepted,"n=int(input()) +list=list(map(int,input().split())) +temp=0 +for i in list: + if temp>i: + print(""No"") + break + else: + temp=max(temp,i-1) +else: + print(""Yes"")" +p02953,s935289301,Accepted,"n = int(input()) +h = list(map(int, input().split())) +num = 0 + +for i in range(n): + if h[i] < num-1: + print(""No"") + exit(0) + num = max(num, h[i]) + +print(""Yes"")" +p02953,s244579248,Accepted,"n = int(input()) +H = list(map(int, input().split())) +H[0] -= 1 +ans = 0 + +for i in range(n-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + if H[i] > H[i+1]: + ans = 1 + break + +if ans == 0: + print('Yes') +else: + print(""No"")" +p02953,s369195628,Accepted,"n = int(input()) +h = list(map(int, input().split())) +# sv = h[n-1] +ok = True +for i in range(n-1)[::-1]: + # if h[i] - sv + 1 >= 2: + # ok = False + if h[i] <= h[i+1]: + continue + elif h[i] == h[i+1] + 1: + h[i] -= 1 + else: + ok = False + # if h[i] - h[i-1] < 0: + # ok = False +if ok: + print('Yes') +else: + print('No')" +p02953,s364813951,Accepted,"N = int(input()) +H = list(map(int, input().split())) +ans = ""Yes"" + +for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] = H[i+1]-1 + if H[i] > H[i+1]: + ans = ""No"" + break + +print(ans) +" +p02953,s259295986,Accepted,"n = int(input()) +H = list(map(int,input().split())) +H[0] -= 1 +ans = ""Yes"" +for i in range(1,n): + if H[i] < H[i-1]: + ans = ""No"" + break + if H[i]-1 >= H[i-1]: + H[i]-=1 +print(ans)" +p02953,s389903379,Accepted,"def main(): + n = int(input()) + h_list = list(map(int, input().split())) + highest = h_list[0] + is_able = True + + for h in h_list: + if highest > h: + is_able = False + break + + if highest + 1 < h: + highest = h - 1 + + if is_able: + print(""Yes"") + else: + print(""No"") + + +if __name__ == ""__main__"": + main() +" +p02953,s047836666,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +seed = h[0] +checker = True + +for i in range(1,n): + if h[i] == h[i-1]: + continue + d = h[i] - h[i-1] + 1 + if d > 0: + checker = True + pass + elif d == 0: + if checker: + checker = False + else: + print('No') + quit() + else: + print('No') + quit() + + +print('Yes')" +p02953,s421140628,Accepted,"import sys +n = int(input()) +h = list(map(int,input().split())) + +for i in range(1,n): + if h[i] == h[i-1] - 1: + h[i] += 1 + elif h[i] <= h[i-1] - 2: + print('No') + sys.exit() +print('Yes') + +" +p02953,s897308321,Accepted,"N = int(input()) +lis = list(map(int, input().split())) + +for i in range(N-1): + if lis[i] < lis[i+1]: + lis[i+1] -= 1 + elif lis[i] == lis[i+1]: + continue + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s288902769,Accepted,"n = int(input()) +h = list(map(int, input().split())) +ans ='Yes' +mah = 0 +for i in h: + mah = max(i, mah) + if i < mah - 1: + ans = 'No' + break +print(ans)" +p02953,s832490916,Accepted,"n = int(input()) +a = list(map(int,input().split())) +m = a[0] +for i in range(1,n): + if m>a[i]+1: + print(""No"") + break + m = max(m,a[i]) +else: + print(""Yes"")" +p02953,s802359199,Accepted,"def I(): return int(input()) +def LI(): return list(map(int,input().split())) +################################################## +N = I() +H = LI() +for i in range(N): + if i==0: + H[i] -= 1 + continue + if i==N-1: + if H[i-1]<=H[i]: + continue + if H[i-1]<=H[i]-1<=H[i+1]: + H[i] -= 1 + continue + if H[i-1]<=H[i]<=H[i+1]: + continue + print('No') + break +else: + print('Yes') +" +p02953,s434939270,Accepted,"n = int(input()) +H = list(map(int,input().split())) + +for i in range(n-1): + if H[i] == 1+ H[i+1]: + H[i+1] += 1 + elif H[i] >1+ H[i+1]: + print('No') + break +else: + print('Yes') +" +p02953,s823098170,Accepted,"n=int(input()) +l=list(map(int, input().split())) +st=l[n-1] +for _ in reversed(l): + if _-1>st: + print(""No"") + exit() + elif _-1==st: + st==_-1 + else: + st=_ +print(""Yes"") + " +p02953,s146153474,Accepted,"N = int(input()) +H = list(map(int,input().split())) +if N == 1: + print('Yes') + exit() +if N == 2: + if H[0] - H[1] > 1: + print('No') + exit() + else: + print('Yes') + exit() +for i in range(N-1,0,-1): + if H[i] < H[i-1]: + H[i-1] -= 1 + if H[i] < H[i-1]: + print('No') + exit() +print('Yes')" +p02953,s331748575,Accepted,"import sys + +input = sys.stdin.readline +_ = int(input()) +nums = map(int, input().split()) +maxnum = 0 + +for x in nums: + if maxnum < x: + maxnum = x + if maxnum - x > 1: + print('No') + sys.exit() + +print('Yes') +" +p02953,s979630497,Accepted,"import sys +n=int(input()) +h=[int(x) for x in input().split()][::-1] + +for i in range(n-1): + if h[i]>=h[i+1]: + continue + elif h[i]==h[i+1]-1: + h[i+1]-=1 + else: + print(""No"") + sys.exit() +print(""Yes"") + +" +p02953,s274680533,Accepted,"n=int(input()) + +t = list(map(int,input().split())) + +for i in range(n-1, 0, -1): + #print(t) + if t[i] < t[i-1]-1: + print('No') + exit() + elif t[i] == t[i-1]-1: + t[i-1] -= 1 +print('Yes')" +p02953,s728507784,Accepted,"N = int(input()) + +List = [int(i) for i in input().split("" "")[::-1]] + +Min = List[0] +i=1 +flag = 0 + +for i in range(N): + if (List[i]-Min)>=2: + flag=1 + break + else: + if List[i]0: + if (H[i] - H[i+1])==1: + H[i] += -1 + else: + ans='No' + break +print(str(ans))" +p02953,s966731139,Accepted,"n = int(input()) +H = list(map(lambda x: int(x)-1, input().split())) +for i in range(n-1): + if H[i] > H[i+1]: + if H[i] <= H[i+1] + 1: + # 次に1を足して大きいならOK + # 足した場合は記録する + H[i+1] += 1 + else: + print('No') + break +else: + print('Yes')" +p02953,s354710614,Accepted,"import sys +import math +import itertools +import collections +import heapq +import re +import numpy as np + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: map(str, sys.stdin.buffer.readline().split()) +ri = lambda: int(sys.stdin.buffer.readline()) +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +rl = lambda: list(map(int, sys.stdin.buffer.readline().split())) + +n = ri() +h = rl() +temp = 0 +for i in h: + if temp == i: + continue + elif temp < i: + temp = i-1 + continue + else: + print('No') + exit() +else: + print('Yes') + + + + +" +p02953,s200171460,Accepted,"def main(): + _, *h=map(int, open(0).read().split()) + x=h[-1] + for y in h[-2::-1]: + if x1: + ans = 'No' + break + elif h[i-1]-h[i]==1: + h[i-1]-=1 +print(ans)" +p02953,s974284404,Accepted,"n = int(input()) +h = list(map(int,input().split())) +ans = 'Yes' +for i in range(n-1): + if h[i] > h[i+1]: + h[i+1] += 1 + if h[i] > h[i+1]: + ans = 'No' +print(ans) +" +p02953,s032725607,Accepted,"n = int(input()) +h = list(map(int, input().split())) [::-1] + + +for i in range(n-1): + if h[i] < h[i + 1]: + h[i + 1] -= 1 + if h[i] < h[i + 1]: + print('No') + exit() +print('Yes')" +p02953,s131198369,Accepted,"N = int(input()) +H = list(map(int, input().split())) +for i in range(0, N-1): + if H[N-i-2]-1 == H[N-i-1]: + H[N-i-2] = H[N-i-2]-1 + elif H[N-i-2]-1 > H[N-i-1]: + print (""No"") + break +else: + print (""Yes"")" +p02953,s654129447,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +ans = 'Yes' +for i in range(1, n)[::-1]: + if h[i] - h[i-1] == -1: + h[i-1] -= 1 + elif h[i] - h[i-1] < -1: + ans = 'No' + +print(ans) +" +p02953,s148981238,Accepted,"from collections import Counter,defaultdict,deque +from heapq import heappop,heappush,heapify +from bisect import bisect_left,bisect_right +import sys,math,itertools,fractions,pprint +sys.setrecursionlimit(10**8) +mod = 10**9+7 +INF = float('inf') +def inp(): return int(sys.stdin.readline()) +def inpl(): return list(map(int, sys.stdin.readline().split())) + +n = inp() +a = inpl() +a[0] -= 1 +for i in range(1,n): + if a[i] > a[i-1]: + a[i] -= 1 + elif a[i] < a[i-1]: + print('No') + break +else: + print('Yes') " +p02953,s993028423,Accepted,"import sys +from heapq import heappush, heappop +#input = sys.stdin.readline + +def main(): + n=int(input()) + h=list(map(int,input().split())) + ans=0 + for i in range(1,n): + if h[n-1-i]-h[n-i]>=2: + ans=1 + break + elif h[n-1-i]-h[n-i]==1: + h[n-i-1]-=1 + if ans==1: + print('No') + else: + print('Yes') + +if __name__ == '__main__': + main()" +p02953,s615886807,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +ans = ""Yes"" +m = h[0] + +for i in range(1, n): + m = max(m, h[i]) + if h[i] < m - 1: + ans = ""No"" + +print(ans) +" +p02953,s860458359,Accepted,"n = int(input()) +h = list(map(int, input().split())) + + +h[0] -= 1 +for i in range(0, n-1): + if h[i] <= h[i+1] -1: + h[i+1] -= 1 + elif h[i] > h[i+1]: + print('No') + break +else: + print('Yes')" +p02953,s837472362,Accepted,"n = int(input()) +h = list(map(int,input().split())) +prev = 10**9+1 +stair = ""Yes"" +hlen = len(h) +for i in range(n): + hgt = h[hlen-1-i] + if hgt>prev+1: + stair = ""No"" + break + elif hgt==prev+1: + prev = hgt-1 + else: + prev = hgt +print(stair)" +p02953,s919213282,Accepted,"def ii():return int(input()) +def iim():return map(int,input().split()) +def iil():return list(map(int,input().split())) +def ism():return map(str,input().split()) +def isl():return list(map(str,input().split())) + +n = ii() +H = iil() +mh = 0 +for i in H: + if mh - 1 > i: + print('No') + exit() + else: + mh = max(mh,i) +print('Yes')" +p02953,s501231524,Accepted,"#!/usr/bin/env python3 +n = int(input()) +h = list(map(int, input().split())) + +m = 0 +flag = True + +for i in h: + if m > i + 1: + flag = False + break + + if i > m: + m = i + +print('Yes' if flag else 'No') +" +p02953,s044777492,Accepted,"N=int(input()) +H=list(map(int,input().split())) +if N==1: + print(""Yes"") + exit() +if H[0]H[1]: + print(""No"") + exit() +for i in range(1,N): + if H[i-1]H[i]: + print(""No"") + exit() +print(""Yes"")" +p02953,s481458858,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +a = h[0] +for i in range(1,n): + if a == h[i]: + pass + elif a < h[i]: + h[i] -= 1 + a = h[i] + else: + print(""No"") + exit() +print(""Yes"")" +p02953,s360637902,Accepted,"N = int(input()) + +H = list(map(int,input().split())) + +c = 1 +a = ""Yes"" + +for i in range(N): + if H[i] > c: + c = H[i]-1 + elif H[i] < c: + a = ""No"" + break +print(a)" +p02953,s005570356,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +No = 0 + +tmp = H[0]-1 +for i in range(1,N): + if tmp < H[i]: + tmp = H[i]-1 + elif tmp == H[i]: + tmp = H[i] + else: + No = 1 + break + +print(""Yes"" if No == 0 else ""No"")" +p02953,s665528160,Accepted,"n = int(input()) +h = list(map(int,input().split())) +h = [0]+h+[10**9+1] +for i in range(1,n+1): + if h[i] > h[i+1]+1: + print(""No"") + exit() + elif h[i] == h[i+1]+1: + h[i] -= 1 + if h[i-1] > h[i]: + print(""No"") + exit() + else: + if h[i-1] < h[i]: + h[i] -= 1 +print(""Yes"") + + + +" +p02953,s342828188,Accepted,"def solve(): + N = int(input()) + A = list(map(int, input().split())) + ans = True + m = 0 + for i in range(N-1): + m = max(m, A[i]) + if m-1 > A[i+1]: + ans = False + return 'Yes' if ans else 'No' + +print(solve())" +p02953,s876681553,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +ans = ""Yes"" + +for i in reversed(range(1, N)): + if H[i]+1 == H[i-1]: + H[i-1] -= 1 + elif H[i] >= H[i-1]: + continue + else: + ans = ""No"" + break +print(ans) +" +p02953,s398703467,Accepted,"N=int(input()) +H=list(map(int, input().split())) +H=list(reversed(H)) +ans='Yes' +for i in range(N-1): + if H[i] max_h: + max_h = H[n] + + if H[n] < max_h-1: + ans='No' + +print(ans)" +p02953,s654011433,Accepted,"N = int(input()) +H = [int(i) for i in input().split()] + +is_true = True +before_tmp = 1 +for i in range(N - 1): + # 差分を計算 + tmp = H[i + 1] - H[i] + if tmp < 0 and (tmp <= -2 or before_tmp <= -1): + is_true = False + break + # 0の場合は飛ばす + if tmp != 0: + before_tmp = tmp + +if is_true: + print('Yes') + +else: + print('No') +" +p02953,s345820053,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +def f(): + global h + for i in range(n - 1, 0, -1): + diff = h[i - 1] - h[i] + + if diff >= 2: + return 'No' + elif diff == 1: + h[i - 1] = h[i - 1] - 1 + + return 'Yes' + +print(f())" +p02953,s246383133,Accepted," + +n = int(input()) +h = list(map(int, input().split())) + +def main(): + for i in reversed(range(n-1)): + if h[i] - h[i+1] > 1: + return False + exit() + elif h[i] - h[i+1] == 1: + h[i] -= 1 + else: + continue + return True + +if main() == True: + print('Yes') + +else: + print('No')" +p02953,s385594067,Accepted,"#!/usr/bin/env python3 + +def main(): + N = int(input()) + *H, = map(int, input().split()) + + h_min = H[0] + flag = True + for i in range(0, N): + if H[i] - 1 >= h_min: + H[i] = H[i] - 1 + elif H[i] < h_min: + flag = False + break + h_min = H[i] + + if flag: + print('Yes') + else: + print('No') + + +main()" +p02953,s021428287,Accepted,"n=int(input()) +a=[int(x) for x in input().split()] + +for i in range(n-1): + if a[i]a[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s063446813,Accepted,"n=int(input()) +li=list(map(int,input().split())) +li[0]-=1 +for i in range(1,n-1): + if li[i]>=li[i+1] and li[i]>li[i-1]: + li[i]-=1 +li2=sorted(li) +if li==li2: + print(""Yes"") +else: + print(""No"")" +p02953,s715037782,Accepted,"N=int(input()) +A=list(map(int,input().split())) +max_A=0 +for i in range(N): + if max_AH[n]: + print(""No"") + exit() + elif D<=H[n]-1: + H[n]-=1 + D=H[n] + +print(""Yes"") " +p02953,s421149430,Accepted,"n=int(input()) +h=list(map(int,input().split())) +maximum=h[0] +ans=""Yes"" +for i in range(1,n): + maximum = max(maximum,h[i]) + if h[i]+1H[i+1]+1: + print(""No"") + break + elif H[i]==H[i+1]+1: + H[i]-=1 + H[i+1]+=1 +else: + print(""Yes"") +" +p02953,s573708584,Accepted,"N = int(input()) +Hs = list(map(int, input().split())) + +tmp = Hs[0] +for h in Hs: + if tmp - h > 1: + print(""No"") + exit() + if h > tmp: + tmp = h +print(""Yes"") +" +p02953,s520980324,Accepted,"import sys +n = int(input()) +l = list(map(int,input().split())) +maxs=l[0] +for i in range(1,n): + if l[i]=maxs: + maxs=l[i] + +print(""Yes"")" +p02953,s530537009,Accepted,"def main(): + N = int(input()) + H = list(map(int, input().split("" ""))) + flag = True + for i in range(N - 1): + if H[i] - H[i + 1] < 0: + H[i + 1] -= 1 + for j in range(N - 1): + if H[j + 1] - H[j] < 0: + flag = False + break + if flag: + print(""Yes"") + else: + print(""No"") + + +if __name__ == '__main__': + main()" +p02953,s746791941,Accepted,"n=int(input()) +#n,m=map(int,input().split()) +#t=int(input()) +hl=list(map(int,input().split())) +#l=[list(map(int,input().split())) for i in range(n)] + +flag=""Yes"" + +for i in range(n-2,-1,-1): + righth=hl[i+1] + cur=hl[i] + if cur<=righth: + pass + elif cur==righth+1: + hl[i]=cur-1 + else: + flag=""No"" + break + +print(flag) + + +" +p02953,s787243790,Accepted,"N = int(input()) +H = list(map(int, input().split())) +import sys +prev = -999 +for i in range(N): + if prev <= H[i] - 1: + prev = H[i] - 1 + elif prev == H[i]: + prev = H[i] + else: + print('No') + sys.exit(0) +print('Yes')" +p02953,s593546855,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h[0] -= 1 +for i in range(1, n-1): + if h[i] == h[i+1] + 1: + if h[i-1] != h[i]: + h[i] -= 1 + else: + print('No') + exit() + elif h[i] < h[i+1] + 1: + if h[i-1] != h[i]: + h[i] -= 1 + else: + print('No') + exit() +print('Yes')" +p02953,s098440470,Accepted,"n = int(input()) +hoge_list = list(map(int,input().split())) +h_list = hoge_list[::-1] +mae = h_list[0] +s = 0 +for h in h_list: + if h <= mae: + mae = h + elif h-1 == mae: + mae = h-1 + else: + print('No') + s += 1 + break +if s == 0: + print('Yes')" +p02953,s864644067,Accepted,"import sys +input = sys.stdin.readline +sys.setrecursionlimit(10**7) +inf = 10**17 +mod = 10**9+7 + +n = int(input()) +h = list(map(int, input().split())) + +flag = True +for i in reversed(range(1,n)): + if h[i-1] <= h[i]: continue + if h[i-1]-1 <= h[i]: h[i-1] -= 1 + elif h[i] < h[i-1]-1: + flag = False + break + +if flag: print(""Yes"") +else: print(""No"") +" +p02953,s433002647,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-2, 0 , -1): + if h[i] > h[i+1]: + h[i] -= 1 + if h[i] > h[i+1]: + print('No') + break +else: + print('Yes') " +p02953,s336943095,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H = H[::-1] +flag = True +for i in range(N-1): + if H[i+1] > H[i]: + H[i+1] -= 1 + if H[i+1] > H[i]: + flag = False + break + +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s281754476,Accepted,"N = int(input()) +H = list(map(int,input().split())) +flag = True +num = 0 +for i in range(N-1): + if H[i] - 1 == H[i+1] and H[i+1] >= num: + num = H[i+1] + elif H[i] - 1 == H[i+1] and H[i+1] < num: + flag = False + break + elif H[i] -1 > H[i+1]: + flag = False + break +if flag == True: + print(""Yes"") +else: + print(""No"")" +p02953,s766049292,Accepted,"n = int(input()) +H = list(map(int, input().split())) + +H[0] -= 1 +for i in range(1, n): + if H[i-1] < H[i]: + H[i] -= 1 +print('Yes' if all(h0 <= h1 for h0, h1 in zip(H, H[1:])) else 'No')" +p02953,s916987948,Accepted,"N = int(input()) +H = list(map(int, input().split())) +flag = True +for i in range(N-2, 0, -1): + defe = H[i] - H[i+1] + if defe > 1: + flag = False + break + elif defe == 1: + H[i] -= 1 +print('Yes' if flag else 'No') +" +p02953,s970540800,Accepted,"import sys +input = sys.stdin.readline + + +def main(): + n = int(input()) + h = list(map(int, input().split())) + hi = 0 + lo = 10**9 + for i in range(0, n): + hi = max(h[i], hi) + if h[i] == hi: + lo = hi + lo = min(h[i], lo) + if hi-lo >= 2: + print(""No"") + exit() + + print(""Yes"") + + +if __name__ == '__main__': + main()" +p02953,s010248481,Accepted,"def main(): + N = int(input()) + H = list(map(int, input().split())) + Max = 0 + for i in range(N): + if H[i] > Max: + H[i] -= 1 + Max = H[i] + elif H[i] == Max: + pass + else: + print('No') + return + print('Yes') +main()" +p02953,s773402510,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(len(H)-1, 0, -1): + if H[i-1] == H[i] + 1: + H[i-1] -= 1 + elif H[i-1] > H[i]: + print('No') + break +else: + print('Yes') +" +p02953,s328827412,Accepted,"import sys +N = int(input()) +HN = list(map(int,input().split())) +HN.reverse() +if N == 1: + print(""Yes"") + sys.exit() + +for n in range(N-1): + left = HN[n] + right = HN[n+1] + if left-right >= 0: + continue + elif left-right == -1: + HN[n+1] -= 1 + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s698413769,Accepted,"def check(): + N = int(input()) + H = list(map(int, input().split())) + for i in range(N-2,-1,-1): + if H[i]>H[i+1]+1: + return 'No' + if H[i]>H[i+1]: + H[i] -= 1 + return 'Yes' +print(check())" +p02953,s021169499,Accepted,"n=int(input()) +h=list(map(int,input().split())) +x=h[0]-1 +ans='Yes' +for i in h[1:]: + x=max(x,i) + if x-i>=2: + ans='No' +print(ans)" +p02953,s806255359,Accepted,"n = int(input()) +A = list(map(int, input().split( ))) +cnt = 0 +for i in range(n-1): + if A[i] < A[i+1]: + A[i+1] -= 1 + cnt += max(A[i] - A[i+1],0) + if cnt >= 1: + print('No') + exit() +print('Yes')" +p02953,s448955421,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(1, N): + if H[-i] < H[-(i+1)]: + H[-(i+1)] -= 1 + if H[-i] < H[-(i+1)]: + print(""No"") + exit() +print(""Yes"")" +p02953,s091016627,Accepted,"def main(): + n = input() + h = list(map(int, input().split()))[::-1] + low = h[0] + for i in h: + if low > i: + low = i + elif i - low > 1: + print(""No"") + return + print(""Yes"") + +if __name__ == ""__main__"": + main()" +p02953,s199275178,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(1,n): + if h[i-1]-h[i]>0: + print('No') + exit() + elif h[i-1]-h[i] <= -1: + h[i] -= 1 +print('Yes') +" +p02953,s944803327,Accepted,"def q3(): + N = int(input()) + H = [int(i) for i in input().split()] + ans = 'Yes' + if len(H) == 1: + print(ans) + return + + for i in range(len(H)): + if i == 0: + H[i] -= 1 + elif H[i-1] - H[i] < 0: + H[i] -= 1 + elif H[i-1] - H[i] >= 1: + ans = 'No' + break + + print(ans) + + +if __name__ == '__main__': + q3() +" +p02953,s416116186,Accepted,"n=int(input()) +h=list(map(int,input().split())) +base=0 +for i in h: + if base>i: + ans=""No"" + break + base=max(base,i-1) +else: + ans=""Yes"" +print(ans)" +p02953,s608310753,Accepted,"N = int(input()) + +stairs = list(map(int, input().split("" ""))) +min = 0 + +for i in range(N): + stair = stairs[i] + if min > stair: + print(""No"") + exit(0) + if stair - 1 > min: + min = stair - 1 + +print(""Yes"") +" +p02953,s664439712,Accepted,"n=int(input()) +l=list(map(int,input().split())) +t=0 +for i in l: + if it: t=i-1 +print('Yes')" +p02953,s446272812,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1): + if (H[i] < H[i+1]): + H[i+1] -= 1 + if (H[i] > H[i+1]): + print('No') + exit() + +print('Yes')" +p02953,s930083911,Accepted,"def main(): + N = int(input()) + H = list(map(int,input().split())) + ans = ""Yes"" + + for i in reversed(range(N-1)): + if H[i]>H[i+1]: + H[i] -= 1 + if H[i]>H[i+1]: + ans = ""No"" + break + print(ans) + +if __name__ ==""__main__"": + main()" +p02953,s423836229,Accepted,"N = int(input()) +H = list(map(int,input().split())) +m = 0 +for k in range(1,N): + if H[k-1] > H[k]+1 or H[k] < m: + print(""No"") + exit(0) + elif H[k-1] == H[k]+1: + m = H[k] +print(""Yes"") +" +p02953,s295794526,Accepted,"n = int(input()) +li = list(map(int,input().split())) +flag = True +last = 0 +for i,l in enumerate(li): + #print(last,l) + if i == 0: + last = l-1 + if last > l: + flag = False + break + elif last == l: + last = l + else: + last = l-1 +if flag: + print('Yes') +else: + print('No')" +p02953,s115534216,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +count = 0 +for i in H: + if i+2 <= count: + print('No') + exit() + else: + count = max(i,count) +print('Yes')" +p02953,s039079715,Accepted,"n = int(input()) +h = [int(i) for i in input().split()] +h.reverse() +next = h[0] +import sys +for i in h[1:]: + if i - next > 1: + print('No') + sys.exit() + elif i - next == 1: + next = i - 1 + else: + next = i +print('Yes')" +p02953,s158869770,Accepted,"n=int(input()) +l=list(map(int,input().split())) + +max=0 +flag=0 +for i in range(n): + if l[i] >= max: + max=l[i] + else: + if max-l[i] == 1: + continue + else: + flag=1 + break + +if flag == 1: + print(""No"") +else: + print(""Yes"")" +p02953,s202572727,Accepted,"n = int(input()) +H = list(map(int, input().split())) +for i in range(n-1, 1, -1): + if H[i - 1] - H[i] > 1: + print('No') + exit() + elif H[i - 1] > H[i]: + H[i - 1] -= 1 +print('Yes')" +p02953,s977943242,Accepted,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n): + if i == 0 or h[i - 1] < h[i]: + h[i] -= 1 +for i in range(n - 1): + if h[i] > h[i + 1]: + print('No') + break +else: + print('Yes') +" +p02953,s305791534,Accepted,"n = int(input()) +H = list(map(int, input().split())) +flag = True +H[0] -= 1 +for i in range(1, n): + if H[i] - H[i - 1] > 0: + H[i] -= 1 + elif H[i] - H[i - 1] < 0: + flag = False + +print('Yes' if flag == True else 'No')" +p02953,s654649362,Accepted,"# -*- coding: utf-8 -*- +n = int(input()) +h = [int(i) for i in input().split()] + +flag = True +for i in reversed(range(n - 1)): + if h[i] - h[i + 1] == 1: + h[i] -= 1 + elif h[i] > h[i + 1]: + flag = False +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s248614328,Accepted,"N = int(input()) +H = list(map(int, input().split())) +element = H[-1] +for i in reversed(H): + if i > element: + if i - 1 == element: + continue + else: + print(""No"") + exit() + else: + element = i +print(""Yes"") +" +p02953,s404750364,Accepted,"n = int(input()) +*h, = map(int, input().split()) +for i in range(1, n): + if h[i] > h[i-1]: + h[i] -= 1 +print('Yes' if all(h[i] <= h[i+1] for i in range(n-1)) else 'No')" +p02953,s293191231,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + exit() + +flag = True +for i in range(N-1, -1, -1): + + if H[i] >= H[i-1]: + pass + elif H[i] + 1 == H[i-1]: + H[i-1] -= 1 + +for i in range(N-1): + if H[i] > H[i+1]: + flag = False + +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s238499681,Accepted,"N = int(input()) +H = list(map(int, input().split())) +yesno = 'Yes' +p=0 +for i in range(N-1): + if H[i] < H[i+1]: + p=0 + elif H[i] == H[i+1]: + p=p + elif H[i] - 1 == H[i+1]: + p += 1 + if p == 2 : + yesno = 'No' + break + else: + yesno = 'No' + break +print(yesno)" +p02953,s368785137,Accepted,"N = int(input()) +arr = list(map(int, input().split())) + +for i in range(N-1): + if arr[i] == arr[i+1]+1: + arr[i+1] +=1 + + if arr[i] > arr[i+1]: + print('No') + exit() + +print('Yes')" +p02953,s194522211,Accepted,"import numpy as np +N = int(input()) +H = np.array(list(map(int, input().split()))) + +tmp_1 = H[np.where(H==H.max())[0].min():] +ans_1 = min(tmp_1) > max(H)-2 + +tmp2 = H[1:] - H[:-1] + +ans_2 = all(tmp2 > -2) + +print(""Yes"") if ans_1 & ans_2 else print(""No"")" +p02953,s991095345,Accepted,"n = int(input()) +li_h = list(map(int, input().split())) +sum_ = 0 +if len(li_h) == 1: + print('Yes') +else: + b = True + max_ = li_h[0] + for i in range(len(li_h)): + if li_h[i] > max_: + max_ = li_h[i] + if max_ - li_h[i] > 1: + b = False + if b: + print('Yes') + else: + print('No')" +p02953,s458679948,Accepted,"n = int(input()) +h = list(map(int,input().split())) +for i in range(1,n): + if h[i-1] > h[i]: + print('No') + exit() + elif h[i-1] + 1 <= h[i]: + h[i] -= 1 +print('Yes')" +p02953,s358205533,Accepted,"n = int(input()) +lst = [0] + list(map(int, input().split())) +reach = False +for i in range(n): + if reach: + if lst[i + 1] - lst[i] <= -1: + print('No') + exit() + elif lst[i + 1] - lst[i] >= 1: + reach = False + else: + if lst[i + 1] - lst[i] == -1: + reach = True + elif lst[i + 1] - lst[i] <= -2: + print('No') + exit() +print('Yes')" +p02953,s158750732,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(1,n): + if h[i] < h[i-1]: + h[i] += 1 + +for i in range(1,n): + if h[i] < h[i-1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s073902632,Accepted,"n = int(input()) +li = list(map(int,input().split())) + +li.reverse() + +ope=0 +flg=0 + +for i in range(1,n): + chk = li[i]-li[i-1] + if chk>1: + print('No') + flg = 1 + break + elif chk==1: + li[i]-=1 + else: + continue + +if flg==0: + print('Yes')" +p02953,s007091747,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(N-1): + if (H[N-2-i] - 1) == H[N-1-i]: + H[N-2-i] -= 1 + elif (H[N-2-i] - 1) < H[N-1-i]: + pass + else: + print('No') + break +else: + print('Yes')" +p02953,s855058576,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h.reverse() + +for i in range(n-1): + diff = h[i+1] - h[i] + if diff == 1: + h[i+1] -= 1 + elif diff > 1: + print('No') + exit() + else: + pass + +print('Yes')" +p02953,s380267717,Accepted,"n=int(input()) +h=list(map(int,input().split())) +max=h[0] +flag=0 +for i in h: + if i>=max: + max=i + elif max-i>=2: + flag=1 + break +if flag==0: + print(""Yes"") +else: + print(""No"")" +p02953,s316850745,Accepted,"N=int(input()) +H=list(map(int,input().split())) + +if N==1:print('Yes') +else: + MAX=H[0] + ok=1 + for i in range(1,N): + if H[i]>MAX:MAX=H[i] + if H[i]<=MAX-2: + ok=0 + break + if ok==1:print('Yes') + else:print('No')" +p02953,s327496025,Accepted,"N=int(input()) +H=list(map(int,input().split())) +base=0 +for h in H: + if base>h: + print(""No"") + break + base=max(base,h-1) +else: + print(""Yes"")" +p02953,s816898860,Accepted,"import sys +input = sys.stdin.readline +import math +import collections +def I(): return int(input()) +def MI(): return map(int, input().split()) +def LI(): return list(map(int, input().split())) + +n=I() +Hs=(LI()) +if n==1: + print(""Yes"") + sys.exit() +for i in range(1,n): + #print(Hs[-i]) + if Hs[-i-1]==Hs[-i]+1: + Hs[-i-1]-=1 + elif Hs[-i-1]>Hs[-i]+1: + print(""No"") + sys.exit() +if i==n-1: + print(""Yes"")" +p02953,s206611812,Accepted,"N = int(input()) +H = list(map(int, input().split())) +mx = H[-1] +for i in range(N-1, -1, -1): + if H[i] <= mx: + mx = min(mx, H[i]) + elif H[i]-1 <= mx: + mx = min(H[i]-1, mx) + else: + print('No') + exit() +print('Yes')" +p02953,s715220896,Accepted,"n=int(input()) + +h=[int(x) for x in input().split()] + + +flag = True + +if n==1: + print('Yes') +else: + for i in range(n-1): + l=h[i] + r=h[i+1] + if l < r: + h[i+1]-=1 + else: + h[i+1]=l + if l > r: + flag=False + + if flag: + print('Yes') + else: + print('No') +" +p02953,s646327623,Accepted," +N = int(input()) +H = list(map(int,input().split())) + +cnt =0 +for i in range(N-1): + if H[i] < H[i+1] : + H[i+1] -= 1 + elif H[i] != H[i+1] : + cnt += 1 + +if cnt != 0: + print('No') +else : + print('Yes')" +p02953,s330476769,Accepted,"import sys +N=int(input()) +H=list(map(int,input().split())) +for i in range(1,N): + if H[i-1]<=H[i]: + pass + elif H[i-1]==H[i]+1: + H[i]+=1 + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s830627440,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +ans = 'Yes' + +if N > 1: + H_rev = list(reversed(H)) + + for i in range(N-1): + if H_rev[i] < H_rev[i+1]: + H_rev[i+1] -= 1 + + if H_rev[i] < H_rev[i+1]: + ans = 'No' + break + +print(ans)" +p02953,s391790463,Accepted,"n = int(input()) +H = list(map(int,input().split())) +m = H[0] +for i in range(n-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + elif H[i] > H[i+1]: + print(""No"") + break +else: + print(""Yes"") + " +p02953,s672771661,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(N-1): + if H[i+1] - H[i] > 0: + H[i+1] -= 1 + +for i in range(N-1): + if H[i+1] < H[i]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s207873262,Accepted,"n=int(input()) +l=list(map(int,input().split())) +t=l.pop(0)-1 +for i in l: + if it: t=i-1 +print('Yes')" +p02953,s168190677,Accepted,"N = int(input()) +H = list(map(int,input().split())) +for i in range(N-2,0,-1): + if H[i]> H[i+1]: + H[i] -=1 + if H[i] > H[i+1]: + print('No') + break +else: + print('Yes') +" +p02953,s651071299,Accepted,"def main(): + n = int(input()) + arr = list(map(int,input().split())) + for i in range(1,len(arr)): + if arr[i]>arr[i-1]: + arr[i]-=1 + elif arr[i]= 1 and i > cnt: + cnt = i - 1 + elif i >= 1 and i == cnt: + pass + else: + print(""No"") + break +else: + print(""Yes"")" +p02953,s176665646,Accepted,"n=int(input()) +h=list(map(int,input().split())) +if n==1: + print(""Yes"") + exit() +for i in range(1,n): + if h[i]-h[i-1]<=-1: + print(""No"") + exit() + elif h[i]-h[i-1]==0: + pass + elif h[i]-h[i-1]>=1: + h[i]-=1 +print(""Yes"") +" +p02953,s013945431,Accepted,"def check(): + N = int(input()) + H = list(map(int, input().split())) + for i in range(N-1): + if H[i]>H[i+1]+1: + return 'No' + if H[i]==H[i+1]+1: + H[i+1] += 1 + return 'Yes' +print(check())" +p02953,s904532695,Accepted,"n = int(input()) +lh = [int(w) for w in input().split()] + +cond = True +nh = lh[0]-1 +for i in range(1, n): + if lh[i] == nh: + continue + elif lh[i] > nh: + nh = lh[i]-1 + continue + else: + cond = False + break + +print(""Yes"" if cond else ""No"") +" +p02953,s819201730,Accepted,"#!/usr/bin/env python3 + +N = int(input()) +lst = [int(h) for h in input().split()] + +def judge(): + cur = lst[0] + for i in range(1, N): + if lst[i] < cur - 1: + return False + if lst[i] > cur: + cur = lst[i] + return True + +if judge(): + print('Yes') +else: + print('No') + +" +p02953,s514998488,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +maxi = 0 +for i in range(N): + if H[i] > maxi: + maxi = H[i] + elif H[i] < maxi: + if maxi - H[i] > 1: + print(""No"") + break +else: + print(""Yes"") +" +p02953,s143420549,Accepted,"import sys +n, *lst = map(int, sys.stdin.read().split()) + +a = lst[-1] +for i in lst[::-1]: + if i > a + 1: + print('No') + quit() + if i < a: + a = i +else: + print('Yes')" +p02953,s516467860,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +fl = True +for i in range(1,N): + if H[i]-H[i-1]>0: + H[i] -= 1 + +for i in range(1,N): + if H[i]-H[i-1]<0: + fl = False + break + +print('Yes') if fl else print('No')" +p02953,s323932590,Accepted,"import sys + +n = int(input()) +h = list(map(int, input().split())) + +if n == 1: + print(""Yes"") + sys.exit() + +h[0] -= 1 +for i in range(1, n-1): + if h[i-1] < h[i]: + h[i] -= 1 + if h[i] > h[i+1]: + print(""No"") + sys.exit() + +if h[n-2] <= h[n-1]: + print(""Yes"") +else: + print(""No"")" +p02953,s933798335,Accepted,"# -*- coding: utf-8 -*- +n = int(input()) +h = [int(i) for i in input().split()] + +for i in reversed(range(1, n)): + if h[i - 1] > h[i]: + h[i - 1] -= 1 +#print(h) +#print(sorted(h)) +if h != sorted(h): + print(""No"") +else: + print(""Yes"") +" +p02953,s662904811,Accepted,"#!/usr/bin/env python3 +import sys +def input(): + return sys.stdin.readline()[:-1] + +def main(): + N = int(input()) + H = list(map(int, input().split())) + + k = 0 + for i in range(N - 1): + k += H[i + 1] - H[i] + if k > 0: + k = 0 + if k <= -2: + print('No') + exit() + print('Yes') + + +if __name__ == '__main__': + main() +" +p02953,s532797348,Accepted,"N=int(input()) +S=list(map(int,input().split())) +Z=[0]*N +start=S[0] +for i in range(1,N): + Z[i]=S[i]-start + if S[i]>start: + start=S[i] + + +flug=False +for i in range(N): + + if Z[i]<=-2: + print(""No"") + exit() + + +print(""Yes"")" +p02953,s638901423,Accepted,"n = int(input()) +h = list(map(int,input().split())) +maxer = 1 +for i in range(n): + if h[i] > maxer: + maxer = h[i]-1 + elif h[i] == maxer: + pass + else: + print(""No"") + exit() +print(""Yes"")" +p02953,s538694825,Accepted,"n = int(input()) +H = list(map(int, input().split())) +for i in range(n): + #print(H) + if i == 0: + H[i] -= 1 + else: + if H[i] < H[i-1]: + print('No') + exit() + elif H[i] == H[i-1]: + continue + else: + H[i] -= 1 + +#print(H) + +for i in range(1, n): + if H[i] < H[i-1]: + print('No') + exit() +else: + print('Yes') +" +p02953,s663518038,Accepted,"n = int(input()) +h = list(map(int,input().split())) +ans = ""Yes"" + +for i in range(1,n): + if h[-i-1] > h[-i]: + h[-i-1] = h[-i-1] - 1 + + if h[-i-1] > h[-i]: + ans = ""No"" + break + +print(ans)" +p02953,s901358918,Accepted,"N = int(input()) +H = [int(i) for i in input().split()] + +flag = False +for i in range(1,N): + if H[i] - H[i-1] == 0: + continue + elif H[i] - H[i-1] < 0: + flag = True + break + elif H[i] - H[i-1] > 0: + H[i] -= 1 + +if flag: + print(""No"") +else: + print(""Yes"")" +p02953,s922797388,Accepted,"n = int(input()) +h = list(map(int,input().split())) +j = h[0] + +for i in range(1,n): + if h[i] > j: + h[i] -= 1 + j = h[i] + else: + pass + +l = list(h) +l.sort() +if h == l: + print('Yes') +else: + print('No')" +p02953,s221154812,Accepted,"N=int(input()) +H=list(map(int,input().strip().split())) + +MAX=H[0] + +for n in range(N): + if MAX-H[n]>=2: + print(""No"") + break + else: + MAX=max(MAX,H[n]) +else: + print(""Yes"")" +p02953,s241922681,Accepted,"N=int(input()) +H=list(map(int,input().split())) +a=H[0] +for i in range(1,N): + if H[i]H[i]: + flg+=1 + +if flg!=0: + print('No') +else: + print('Yes') +" +p02953,s951852127,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +ans = ""Yes"" +H[0] -= 1 +for i in range(1, N): + if H[i - 1] > H[i]: + ans = ""No"" + break + if H[i - 1] < H[i]: + H[i] -= 1 + +print(ans)" +p02953,s698927914,Accepted,"import sys +N = int(input()) +H = list(map(int, input().split())) + +for i in range(N - 1): + + if H[i] - H[i + 1] > 1: + print(""No"") + sys.exit() + + elif H[i] - H[i + 1] == 1: + H[i + 1] += 1 + +print(""Yes"")" +p02953,s697831284,Accepted,"n = int(input()) +h = list(map(int, input().split())) +tmp = h[-1] +ans = 'Yes' + +for i in range(2,n+1): + if tmp - h[-i] == -1: + tmp = h[-i]-1 + elif tmp - h[-i] < -1: + ans = 'No' + break + else: + tmp = h[-i] + +print(ans)" +p02953,s584866884,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[0] -= 1 +T = True +for i in range(1, N-1): + if H[i-1]==H[i] and H[i]<=H[i+1]: + continue + elif H[i-1]= s[i+1] and s[i] > M: + s[i] -= 1 + if s[i] < M: + print(""No"") + exit() + M = s[i] + +if M <= s[-1]: + print(""Yes"") +else: + print(""No"")" +p02953,s296033173,Accepted,"#!/usr/bin/env python3 + +n = int(input()) +h = list(map(int, input().split())) + +h.reverse() + + +ans = 0 +for i in range(1, len(h)): + if h[i-1]-h[i] >= 0: + continue + elif h[i-1]-h[i] == -1: + h[i] -= 1 + else: + print(""No"") + exit() + +print(""Yes"") +" +p02953,s532438279,Accepted,"n = int(input()) +a = list(map(int, input().split())) + +pre = a[0] +ok = True +for i in range(n): + if pre > a[i]: + ok = False + break + if a[i] > pre: + a[i] -= 1 + + pre = a[i] + +print('Yes' if ok else 'No') +" +p02953,s059962911,Accepted,"N = int(input()) +H = list(map(int, input().split())) +f = 0 +maxtmp = H[0] +shave = 0 +for i in range(N-1): + if H[i]-1>H[i+1] or (H[i]-1==H[i+1] and shave==1): + f = 1 + break + elif H[i]-1==H[i+1] and shave==0: + maxtmp = H[i+1] + shave = 1 + elif H[i]==H[i+1]: + pass + else: + maxtmp = H[i+1] + shave = 0 +if f == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s994308446,Accepted,"n=int(input()) +h=list(map(int,input().split())) + +ans='Yes' +m=0 +for i in range(1,n): + m=max(m,h[i]) + if h[i] h[i+1]: + print(""No"") + exit() + +print(""Yes"") +" +p02953,s275450470,Accepted,"import sys +N=int(input()) +L=list(map(int,input().split())) +L=list(map(int,list(reversed(L)))) +for i in range(1,N): + if L[i]>L[i-1]+1: + print(""No"") + sys.exit() + elif L[i]==L[i-1]+1: + L[i]=L[i]-1 +print(""Yes"")" +p02953,s644934304,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +f = True +maxh = None +for i in range(n - 1, 0, -1): + if i == n - 1: + continue + if h[i] - h[i + 1] == 1: + h[i] -= 1 + elif h[i] - h[i + 1] > 1: + print(""No"") + exit(0) +print(""Yes"") +" +p02953,s331377780,Accepted,"# ans + +N = int(input()) +H = list(map(int, input().split())) + +if H == 1: + print('Yes') + exit() + +for i in range(1, N): + if H[i-1] == H[i]: + pass + elif H[i-1] < H[i]: + H[i] -= 1 + else: + print('No') + exit() + +print('Yes')" +p02953,s388929713,Accepted,"N = int(input()) +HB = input().split(' ') +HB = [int(HB[i]) for i in range(N)] +Hs = [0] +for i in range(N): + H = HB[i] + if Hs[i] > H: + print('No') + break + else: + if Hs[i] == H: + Hs.append(H) + else: + H = H - 1 + Hs.append(H) +else: + print('Yes')" +p02953,s359023508,Accepted,"N=int(input()) +H=list(map(int,input().split())) +min = 1e12 +success = True +for i in range(N): + if H[N-1-i] <= min + 1: + if H[N-1-i] < min: + min = H[N-1-i] + else: + success = False + break +print('Yes' if success else 'No') +" +p02953,s547711065,Accepted,"n=int(input()) +hi=[] +for i in map(int,input().split()): + hi.append(i) +YesNo=""Yes"" +for i in range(n-1,1,-1): + if hi[i]+2<=hi[i-1]: + YesNo=""No"" +# print(""No"") + break + elif hi[i]+1==hi[i-1]: + hi[i-1]=hi[i-1]-1 +print(YesNo)" +p02953,s670018828,Accepted,"N,*H=map(int,open(0).read().split()) +H[0]-=1 +def main(): + for i in range(1,N): + if H[i-1] H[i+1]: + bl = False + +print('Yes' if bl else 'No')" +p02953,s447832772,Accepted,"import sys +n = int(input()) +h = list(map(int,input().split())) +h = h[::-1] + +for i in range(n-1): + if h[i] < h[i+1]: + h[i+1] -= 1 + +ans = 'Yes' +for j in range(n-1): + if h[j] < h[j+1]: + print('No') + sys.exit() + +print(ans)" +p02953,s452385128,Accepted,"import sys +stdin = sys.stdin + +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(stdin.readline().rstrip()) +nm = lambda: map(int, stdin.readline().split()) +nl = lambda: list(map(int, stdin.readline().split())) + +N=int(input()) +H=nl() +flag=True + +H[0]-=1 +for i in range(1,N-1): + if(H[i-1]H[i+1]): + flag=False + +print('Yes' if flag==True else 'No') +" +p02953,s705851744,Accepted,"N = int(input()) +H = [int(s) for s in input().split()] +for i in range(N - 1): + if H[i + 1] - H[i] >= 0: + H[i + 1] -= H[i + 1] != H[i] + else: + print('No') + exit(0) + +print('Yes')" +p02953,s056624958,Accepted,"import sys +n=int(input()) +h=list(map(int, input().split())) + +mx=0 +for i in range(n): + if h[i]<=mx-2: + print(""No"") + sys.exit() + if h[i]>mx: + mx=h[i] + + +print(""Yes"")" +p02953,s456335357,Accepted,"# ABC136C + +n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] +ans = ""Yes"" +for i in range(len(h)-1): + if h[i] < h[i+1]: + if h[i]+1 == h[i+1]: + h[i+1] -= 1 + else: + ans = ""No"" + break +print(ans) +" +p02953,s820767063,Accepted,"n = int(input()) +h = list(map(int,input().split())) +for i in range(n-1): + if h[i+1] > h[i]: + h[i+1] -= 1 + elif h[i+1] < h[i]: + print('No') + break +else: + print('Yes')" +p02953,s897301600,Accepted,"N = int(input()) +H = [int(i) for i in input().split()] +for i in range(N-1,0,-1): + if(H[i] < H[i-1]): + H[i-1] -= 1 +for i in range(N-1): + if(H[i] > H[i+1]): + print(""No"") + exit() +print(""Yes"")" +p02953,s095658815,Accepted,"import sys +n = int(input()) +h = list(map(int,input().split())) + +if n == 1: + print(""Yes"") + sys.exit() + +for i in range(n-1,0,-1): + if h[i] != h[i-1]: + if h[i] - h[i-1] < -1: + print(""No"") + sys.exit() + elif h[i] - h[i-1] < 0: + h[i-1] -= 1 + +print(""Yes"")" +p02953,s121667789,Accepted,"n=int(input()) +l=list(map(int,input().split())) +if(n==1): + print(""Yes"") +else: + f=0 + for i in range(n-1,-1,-1): + if(l[i]+1==l[i-1]): + l[i-1]-=1 + for i in range(n-1): + if(l[i+1]= 2 : + for i in range(1,n): + if h[i-1] > h[i]: + h[i-1] = h[i-1] - 1 + if h[i-1] > maxh: + maxh = h[i-1] + if h[i-1] > h[i] or maxh > h[i] : + Flag = ""No"" + +print(Flag)" +p02953,s445232120,Accepted,"def resolve(): + N = int(input()) + H = list(map(int, input().split())) + + for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + + if H[i] > H[i+1]: + print('No') + return + + print('Yes') + + return +resolve()" +p02953,s671153047,Accepted,"n,*h=map(int,open(0).read().split()) +for i in range(n-1)[::-1]: + if h[i+1] h[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s020731714,Accepted,"def main(): + n = int(input()) + h_list = list(map(int, input().split())) + for i in range(n - 1)[::-1]: + if h_list[i] == h_list[i + 1] + 1: + h_list[i] = h_list[i] - 1 + elif h_list[i] > h_list[i + 1] + 1: + print(""No"") + return + print(""Yes"") + +main()" +p02953,s928219957,Accepted,"n = int(input()) +hl = list(map(int, input().split())) + +curr = hl[0]-1 +for i in range(1,n): + if hl[i] > curr: + curr = hl[i]-1 + elif hl[i] == curr: + pass + else: + print('No') + break +else: + print('Yes')" +p02953,s283539181,Accepted,"N = int(input()) +H = list(map(int,input().split())) +f = 0 +for i in range(1,N): + if H[-(i+1)] <= H[-i]: + continue + else: + if H[-(i+1)]-H[-i] == 1: + H[-(i+1)] -= 1 + else: + f += 1 + break +if f == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s568596663,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i+1] - h[i] == -1: + h[i+1] += 1 + elif h[i+1] - h[i] < -1: + print(""No"") + quit() + +print(""Yes"")" +p02953,s359916040,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h[0] -= 1 +for i in range(1,n): + if h[i-1] <= h[i]-1: + h[i] -= 1 + elif h[i-1] > h[i]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s271836028,Accepted,"N=int(input()) +H=list(map(int,input().split())) +M=1 +ans=""Yes"" + +for i in range(N): + if M h[i+1]: + if maxv-h[i+1] >= 2: + ans = False + elif maxv < h[i+1]: + maxv = h[i+1] +if ans == True: + print('Yes') +else: + print('No')" +p02953,s144062553,Accepted,"N=int(input()) +H=list(map(int,input().split())) +base=0 +for h in H: + if base>h: + print(""No"") + break + base=max(base,h-1) +else: + print(""Yes"")" +p02953,s099279400,Accepted,"N=int(input()) +H=list(map(int, input().split())) +L=[float('inf')]*N +L[N-1]=H[N-1] +for i in range(1,N): + a=H[N-i-1] + if a-1>L[N-i]: + print('No') + exit() + L[N-i-1]=min(a,L[N-i]) +else: + print('Yes')" +p02953,s766255123,Accepted,"n = int(input()) +h = map(int, input().split()) + +height = 0 + +for k in h: + + if k - height >= -1: + height = max(height, k) + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s432577355,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[0] -= 1 +T = True +for i in range(1, N-1): + if H[i-1]==H[i] and H[i]<=H[i+1]: + continue + elif H[i-1] h: + return 'No' + if max_h <= h-1: + max_h = h + return 'Yes' + +print(check())" +p02953,s608901310,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[0]-=1 +for i in range(N-1): + if H[i+1] - H[i] > 0: + H[i+1]-=1 + if H[i] - H[i+1] > 0: + print('No') + exit() +print('Yes')" +p02953,s070390364,Accepted,"def main(): + n = int(input()) + num_list = list(map(int, input().split())) + + flag = True + + for i in range(n-1): + if num_list[i] != 1 and num_list[i-1] < num_list[i]: + num_list[i] -= 1 + if num_list[i] > num_list[i+1]: + flag = False + break + + print('Yes' if flag else 'No') + +if __name__ == '__main__': + main()" +p02953,s487311758,Accepted,"N = int(input()) +H = tuple(reversed(tuple(map(int, input().split())))) +assert len(H) == N + +result = True +prev = None +for i,h in enumerate(H): + if prev is not None: + if h > prev + 1: + result = False + break + if h < prev + 1: + prev = h + else: + prev = h +print('Yes' if result else 'No')" +p02953,s464741289,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(1, N)[::-1]: + d = H[i] - H[i-1] + if d >= 0: + continue + elif d == -1: + H[i-1] -= 1 + else: + print(""No"") + exit() +print(""Yes"")" +p02953,s353800794,Accepted,"# -*- coding: utf-8 -*- +n = int(input()) +h = list(reversed(list(map(int, input().split())))) + +cnt = 0 +for i in range(n-1): + if h[i+1] - h[i] > 1: + print('No') + exit(0) + elif h[i+1] - h[i] == 1: + h[i+1] -= 1 + +print('Yes') +" +p02953,s004943379,Accepted,"input() +a=list(map(int,input().split())) +pivot=0 +flag=0 +for i in a: + if pivot1:flag=1;break +print('YNeos'[flag::2])" +p02953,s291525928,Accepted,"N = int(input()) +H = list(map(int,input().split())) +i = 0 +H[0] -= 1 + +while True: + if N == 1: + answer = 'Yes' + break + if H[i]H[i+1]: + answer = 'No' + break + i += 1 + if i == N-1: + answer = 'Yes' + break +print(answer)" +p02953,s312226504,Accepted,"n = int(input()) +a = list(map(int, input().split())) + +flag = True +for i in range(n-1): + if a[n-i-2] > a[n-i-1]: + a[n-i-2]-= 1 + + if a[n-i-2] > a[n-i-1]: + flag = False + break + +print(""Yes"") if flag else print(""No"") +" +p02953,s821150737,Accepted,"n = int(input()) +hs = map(int, input().split()) +hsrev = list(hs)[::-1] + +for i in range(len(hsrev)-1): + if hsrev[i] < hsrev[i+1]: + hsrev[i+1] -= 1 + if hsrev[i] < hsrev[i+1]: + print(""No"") + exit() + +print(""Yes"") +" +p02953,s129777022,Accepted,"n, *h = map(int, open(0).read().split()) + +for i in range(n-1): + s = h[-i-2] - h[-i-1] + if s == 1: + h[-i-2] -= 1 + elif s > 1: + print(""No"") + exit() +print(""Yes"")" +p02953,s484493193,Accepted,"#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Created: Jul, 13, 2020 15:38:31 by Nobody +# $Author$ +# $Date$ +# $URL$ +__giturl__ = ""$URL$"" + + +from collections import defaultdict +from collections import deque +from collections import OrderedDict +import itertools +from sys import stdin +input = stdin.readline + + +def main(): + N = int(input()) + H = list(map(int, input().split())) + + for i in range(1, N): + if H[i] >= H[i-1]: + continue + elif H[i] + 1 == H[i-1]: + H[i] += 1 + else: + print('No') + return + print('Yes') + + +if(__name__ == '__main__'): + main() +" +p02953,s263631686,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") +else: + f = 1 + for i in range(1, N-1): + if H[-i-1] <= H[-i]: + continue + elif H[-i-1]-1 == H[-i]: + H[-i-1] -= 1 + else: + f = 0 + break + if f: + print(""Yes"") + else: + print(""No"") +" +p02953,s920760363,Accepted,"n = int(input()) +H = list(map(int, input().split())) +b = -1 +for h in H: + if b > h: + if b != h+1: + print(""No"") + exit() + else: + b = h+1 + else: + b = h + +print(""Yes"")" +p02953,s398701617,Accepted,"n=int(input()) +a=list(map(int,input().split())) +for i in range(n): + if i!=0: + if a[i]>a[i-1]: + a[i]-=1 + else: + a[i]-=1 +for i in range(n): + if i!=n-1: + if a[i]>a[i+1]: + print('No') + exit() +print('Yes')" +p02953,s707260170,Accepted,"#https://atcoder.jp/contests/abc136/tasks/abc136_c + +n = int(input()) +h = [int(i) for i in input().split()] + +flag = 'Yes' +for i in reversed(range(n - 1)): + if h[i+1] - h[i] < 0 and h[i+1] - h[i] >= -1: + h[i] -= 1 + elif h[i+1] - h[i] <= -2: + flag = 'No' + break +print(flag)" +p02953,s621827758,Accepted,"n=int(input()) +l=list(map(int,input().split())) +i=n-1 +flag=False +while 1<=i and i<=n-1: + if l[i]+2<=l[i-1]: + print('No') + flag=True + break + elif l[i]+1==l[i-1]: + l[i-1]-=1 + i-=1 + else: + i-=1 +if flag==False: + print('Yes')" +p02953,s605087244,Accepted,"n = int(input()) +h = list(map(int, input().split())) +maxx = 0 +ans = 1 +for i in range(n): + if h[i] - maxx >= -1: + maxx = max(h[i], maxx) + else: + ans = 0 +print([""No"", ""Yes""][ans]) +" +p02953,s290644842,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +if N == 1: + print('Yes') +else: + for i in range(N-1): + if H[N-1-i] + 2 <= H[N-1-i-1]: + print('No') + break + elif H[N-1-i] + 1 == H[N-1-i-1]: + H[N-1-i-1] -= 1 + elif i == N-2 and H[0] <= H[1] + 1: + print('Yes') +" +p02953,s589351212,Accepted,"n=int(input()) + +h=[int(x) for x in input().split()] +m=h[0] +for i in range(n): + #print(c,-i) + #print(m) + if h[i]=2: + print(""No"") + exit() + else: + h[i+1]-=1 +print(""Yes"")" +p02953,s255438281,Accepted,"def main(): + N = int(input()) + H = [int(i) for i in input().split()] + + flag = True + for i in range(N-1)[::-1]: + if H[i] > H[i+1]: + if H[i] - H[i+1] == 1: + H[i] -= 1 + else: + flag = False + + if flag: + print(""Yes"") + else: + print(""No"") + + +if __name__ == '__main__': + main() +" +p02953,s218595554,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1, 0, -1): + sa = h[i-1] - h[i] + + if sa > 1: + print(""No"") + exit() + elif sa > 0: + h[i-1] -= 1 + else: + pass + +print(""Yes"")" +p02953,s006931509,Accepted,"n = int(input()) +stair = input().split(' ') + +for i in range(0, n - 1): + if (int(stair[i]) < int(stair[i+1])): + stair[i+1] = int(stair[i+1]) - 1 + + if (int(stair[i]) > int(stair[i+1])): + print(""No"") + exit() + + +print(""Yes"") +" +p02953,s747365920,Accepted,"N = int(input()) +Hs = list(map(int, input().split())) + +for i in reversed(range(N-1)): + if Hs[i] - Hs[i+1] >= 2: + print('No') + break + elif Hs[i] - Hs[i+1] == 1: + Hs[i] -= 1 +else: + print('Yes') +" +p02953,s109395917,Accepted,"n= int(input()) +a = [int(i) for i in input().split()] + +life = 1 +for i in range(n-2, -1,-1): + if a[i]>a[i+1]+1: + print(""No"") + break + elif a[i]==a[i+1]+1: + a[i] -= 1 +else: + print(""Yes"")" +p02953,s044783699,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(n-1): + if h[n-1-i] < h[n-1-i-1]: + h[n-1-i-1] -= 1 +for i in range(1,n): + if h[i] < h[i-1]: + print('No') + exit() + +print('Yes') + " +p02953,s164606381,Accepted,"n = int(input()) +h = [int(i) for i in input().split()] +for i in range(2, n + 1): + if h[n-i] > h[n-i+1]: + if h[n-i] - 1 == h[n-i+1]: + h[n-i] -= 1 + else: + print(""No"") + exit() + +for i in range(2, n + 1): + if h[n-i] > h[n-i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s284560337,Accepted,"n = int(input()) +S = list(map(int, input().split()))[::-1] + +flag = True +for i in range(1, n): + if S[i] > S[i-1]: + S[i] -= 1 + + if S[i] > S[i-1]: + flag = False + break + +print(""Yes"" if flag else ""No"") + " +p02953,s643593065,Accepted,"N = int(input()) +H = list(map(int, input().split())) +now = H[0] + +for h in H: + if h > now: + now = h - 1 + elif h == now: + continue + else: + print('No') + exit() +print('Yes')" +p02953,s650904258,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h.reverse() +for i in range(n-1): + if h[i]h[j+1]: + print('No') + exit() +else: + print('Yes')" +p02953,s155088815,Accepted,"N=int(input()) +H=list(map(int,input().split())) +HR=list(reversed(H)) + +for i in range(1,N): + if HR[i]>HR[i-1]: + HR[i]-=1 + if HR[i]>HR[i-1]: + print('No') + exit() +print('Yes')" +p02953,s424685430,Accepted,"n=int(input()) +H=list(map(int,input().split())) + +isOK=True +for i in range(n-1,0,-1): + diff=H[i-1]-H[i] + if diff<1: + pass + elif diff==1: + H[i-1]-=1 + else: + isOK=False + break + +if isOK: + print(""Yes"") +else: + print(""No"")" +p02953,s950422965,Accepted,"#!/usr/bin/env python +# coding: utf-8 + +# In[18]: + + +N = int(input()) +H = list(map(int, input().split())) + + +# In[19]: + + +flag = True +mylist = list(reversed(H)) +for i in range(1,N): + if mylist[i] > mylist [i-1] + 1: + flag = False + break + elif mylist[i] == mylist[i-1] + 1: + mylist[i] = mylist[i]-1 +if flag: + print(""Yes"") +else: + print(""No"") + + +# In[ ]: + + + + +" +p02953,s451031436,Accepted,"import numpy as np + +N = int(input()) +H = np.array(list(map(int, input().split()))) + +ans_1 = min(H[np.where(H==H.max())[0].min():]) > max(H)-2 +ans_2 = all((H[1:] - H[:-1]) > -2) + +print(""Yes"") if ans_1 & ans_2 else print(""No"")" +p02953,s293881010,Accepted,"def resolve(): + n = int(input()) + h = list(map(int, input().split())) + OK = True + for i in range(1, len(h)): + if h[i] == h[i-1]: + continue + elif h[i] > h[i-1]: + h[i] -= 1 + else: + OK = False + break + if OK: + print(""Yes"") + else: + print(""No"") +resolve()" +p02953,s303326034,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(1, N): + if H[-i-1] <= H[-i]: + pass + elif H[-i-1] == H[-i]+1: + H[-i-1] -= 1 + else: + print(""No"") + break +else: + print(""Yes"")" +p02953,s020711184,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +is_judge = True +for i in reversed(range(n-1)): + if h[i]>h[i+1]: + if h[i]-1 > h[i+1]: + is_judge = False + else: + h[i] = h[i]-1 + + + +if is_judge: + print('Yes') +else: + print('No') +" +p02953,s021016076,Accepted,"N=int(input()) +H=[int(s) for s in input().split("" "")] + +#左右差のリストを作成。(+1,-1),(-1,+1)の区間は直せる + +List=[] +for i in range(N-1): + List.append(H[i+1]-H[i]) + +count=0 +for i in range(len(List)): + count+=List[i] + + if count>=1: + count=0 + if count<=-2: + count=-2 + break + +print(""Yes"" if count>=-1 else ""No"")" +p02953,s988659889,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1,1,-1): + dif = h[i] - h[i-1] + if(dif == -1): + h[i-1] -= 1 + elif(dif < -1): + print('No') + exit() + +print('Yes') +" +p02953,s566264987,Accepted,"N = int(input()) +Hs = [int(i) for i in input().split()] + +is_Yes = True +for i in range(1, N): + if Hs[i-1] == Hs[i]: + continue + elif Hs[i] > Hs[i-1]: + Hs[i] -= 1 + else: + is_Yes = False + break + +if is_Yes: + print('Yes') +else: + print('No') +" +p02953,s344870567,Accepted,"N = int(input()) +H = list(map(int, input().split())) +m = H[0] +for h in H[1:]: + if m - h > 1: + print('No') + break + m = max(m, h) +else: + print('Yes') +" +p02953,s209840465,Accepted,"from sys import * + +n = int(stdin.readline()) +arr = list(map(int, stdin.readline().split())) +last = arr[n - 1] +for i in range(n - 1, -1, -1): + if arr[i] > last: + d = arr[i] - last + if d > 1: + print(""No"") + exit(0) + last = min(last, arr[i]) +print(""Yes"")" +p02953,s838509612,Accepted,"N = int(input()) +H = list(map(int, input().split())) +res = 'Yes' +for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + elif H[i+1] - H[i] == 0: + continue + else: + res = 'No' + break +print(res)" +p02953,s116127124,Accepted,"def ok(hs): + m = 0 + for h in hs: + if h < m - 1: + return False + m = max(m, h) + return True + +n = int(input()) +print('Yes' if ok(map(int, input().split())) else 'No')" +p02953,s506843468,Accepted,"# -*- coding: utf-8 -*- +"""""" +Created on Wed Mar 25 20:51:57 2020 + +@author: Kanaru Sato +"""""" + +n = int(input()) +h = list(map(int, input().split())) + +flag = 0 +mh = 10**10 + +for i in range(n-1): + if h[n-1-i]-mh <= 1: + mh = min(mh, h[n-1-i]) + else: + flag = 1 + break + +if flag == 1: + print(""No"") +else: + print(""Yes"")" +p02953,s640814064,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +check = 0 + +if n == 1: + print('Yes') + +else: + for i in range(n-2): + if h[i] < h[i+1]: + h[i+1] -= 1 + for i in range(n-1): + if h[i] > h[i+1]: + print('No') + break + if h[i] <= h[i+1]: + check += 1 + if check == n-1: + print('Yes')" +p02953,s036491116,Accepted,"n = int(input()) +squeres = list(map(int, input().split())) +flag = True +before_down = 0 +for i in range(n - 1): + if squeres[i] > squeres[i + 1] and squeres[i] - 1 <= squeres[i + 1] and before_down == 0: + before_down = 1 + + elif not squeres[i] <= squeres[i + 1]: + flag = False + + else: + if squeres[i] < squeres[i + 1]: + before_down = 0 +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s633360596,Accepted,"N = int(input()) +F = [int(x) for x in input().split()] + +flag = True +for i in range(N-1): + if F[i] < F[i+1]: + F[i+1] -= 1 + elif F[i] > F[i+1]: + flag = False + break + +if flag == True: + print(""Yes"") +else:print(""No"")" +p02953,s437131273,Accepted,"n = int(input()) +h = [int(x) for x in input().split()] +can = True +for i in range(n): + if i == 0: + h[i] -= 1 + else: + if h[i - 1] < h[i]: + h[i] -= 1 + elif h[i - 1] == h[i]: + continue + else: + can = False +print('Yes' if can else 'No') +" +p02953,s885425127,Accepted,"from sys import exit +N = int(input()) +H = list(map(int,input().split())) +high = H[0] - 1 +for i in range(1,N): + if H[i] < high: + print(""No"") + exit() + elif H[i] > high: high = H[i] - 1 +print(""Yes"") " +p02953,s141086893,Accepted,"def readinput(): + n=int(input()) + h=list(map(int,input().split())) + return n,h + +def main(n,h): + hr=list(reversed(h)) + for i in range(n-1): + if hr[i]1: + return 'No' + else: + hr[i+1]-=1 + return 'Yes' + +if __name__=='__main__': + n,h=readinput() + ans=main(n,h) + print(ans) +" +p02953,s270298153,Accepted,"# C +n = int(input()) +h = list(map(int, input().split())) +ans = True +pre = -1 +for num in h: + if num > pre: + pre = num-1 + elif num == pre: + pre = num + else: + ans = False + break +if ans: + print('Yes') +else: + print('No')" +p02953,s724744224,Accepted,"N = int(input()) +A = list(map(int,input().split())) +first = 0 +for i in range(N): + first = max(first,A[i]) + if A[i] < first-1: + print(""No"") + exit() + +print(""Yes"")" +p02953,s992601136,Accepted,"input() +tmp = 1 +for i in map(int, input().split()): + if tmp <= i: + tmp = i + elif tmp <= i + 1: + tmp = i + 1 + else: + print(""No"") + break +else: + print(""Yes"")" +p02953,s189388683,Accepted,"N = int(input()) +H = list(map(int,input().split())) +safe = True +for i in reversed(range(N-1)): + if H[i] > H[i+1]: + H[i] -=1 +for i in range(N-1): + if H[i] > H[i+1]: + safe = False + break +print('Yes' if safe else 'No')" +p02953,s378620732,Accepted,"n = int(input()) +h = list(map(int, input().split())) +for i in range(1, n): + c = h[-i] - h[-(i + 1)] + if c >= 0: + continue + if c == -1: + h[-(i + 1)] -= 1 + else: + print('No') + break +else: + print('Yes') +" +p02953,s021415984,Accepted,"n=int(input()) +h=list(map(int,input().split())) +h[0]-=1 +for i in range(1,n-1): + if h[i]>h[i+1] or h[i]>h[i-1]: + h[i]-=1 +for i in range(n-1): + if h[i]>h[i+1]: + print(""No"") + quit() +print(""Yes"")" +p02953,s218831589,Accepted,"n=int(input()) +arr=list(map(int,input().split())) +for i in range(n-2,0,-1): # 列を後ろからみる + if arr[i]>arr[i+1]: # 単調非減少になっていないとき、手前の要素の値を1減らす + arr[i]-=1 + if arr[i]>arr[i+1]: # 1減らしても単調非減少にならないとき、答えはNo + print('No') + break +else: + print('Yes')" +p02953,s166104712,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] +for i in range(1, n): + if h[i-1] < h[i]-1: + print(""No"") + exit() + elif h[i] <= h[i-1]: + pass + else: + h[i] -= 1 +print(""Yes"")" +p02953,s905569658,Accepted,"N = int(input()) +H = list(map(int,input().split())) +flg = 0 +ans = ""Yes"" + +for i in range(N-1): + if H[i]-H[i+1] > 1: + ans = ""No"" + break + elif H[i]-H[i+1] == 1 and flg == 0: + flg = 1 + elif H[i]-H[i+1] == 1 and flg == 1: + ans = ""No"" + break + elif H[i]-H[i+1] == 0: + continue + else: + flg = 0 + continue + +print(ans)" +p02953,s830299525,Accepted,"n = int(input()) +h = list( map(int,input().split()) ) + +ck = False +for i in range(n-2,-1,-1): + if h[i] > h[i+1]: + h[i] -= 1 + if h[i] > h[i+1]: + break +else : + ck = True + +print('Yes' if ck else 'No')" +p02953,s827191059,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[0] -= 1 +for i in range(1, N): + if H[i] < H[i-1]: + print('No') + exit() + elif H[i] > H[i-1]: + H[i] -= 1 +print('Yes') +" +p02953,s829788248,Accepted,"import sys +input = sys.stdin.readline +def main(): + N = int(input()) + H = list(map(int, input().split())) + for i in range(N): + if i == N-1: + print(""Yes"") + break + if H [i+1] > H[i]: + H[i+1] -= 1 + elif H[i+1] < H[i]: + print(""No"") + break + +if __name__ == '__main__': + main()" +p02953,s108640049,Accepted,"N = int(input()) +H = list(map(int,input().split())) +for i in range(N-1,0,-1): + if H[i] < H[i-1] : + H[i-1] -= 1 +if sorted(H) != H: + print('No') +else: + print('Yes') +" +p02953,s271609325,Accepted,"N = int(input()) +H = list(map(int, input().split())) +MAX = 0 +for i in range(N): + MAX = max(MAX, H[i]) + if (H[i] <= MAX - 2): + print('No') + exit(0) +print('Yes')" +p02953,s201004289,Accepted,"import os, sys, re, math + +N = int(input()) +H = [int(n) for n in input().split()] + +possible = True +for i in range(N - 1, 0, -1): + if H[i - 1] >= H[i] + 2: + possible = False + break + elif H[i - 1] == H[i] + 1: + H[i - 1] -= 1 + +print('Yes' if possible else 'No') +" +p02953,s501431677,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +before = h[0] +for i in range(1,n): + if before > h[i]: + print(""No"") + break + before = max(h[i]-1, before) +else: + print(""Yes"")" +p02953,s161361231,Accepted,"from sys import stdin + +n = int(stdin.readline().rstrip()) +h = [int(x) for x in stdin.readline().rstrip().split()] + +a = h[0] +for i in range(1, n-1): + a = max(h[i], a) + b = h[i+1] + if a-b >= 2: + print(""No"") + exit() +print(""Yes"") +" +p02953,s509217812,Accepted,"n = int(input()) +H = list(map(int, input().split())) + +for i in reversed(range(n-1)): + if H[i] <= H[i+1]: + continue + elif H[i]-1 == H[i+1]: + H[i] -= 1 + else: + break +else: + print('Yes') + exit(0) +print('No') +" +p02953,s599471987,Accepted,"''' +Created on 2020/08/23 + +@author: harurun +''' +def main(): + import sys + pin=sys.stdin.readline + pout=sys.stdout.write + perr=sys.stderr.write + + N=int(pin()) + H=list(map(int,pin().split())) + H.reverse() + for i in range(N-1): + if H[i]>=H[i+1]: + pass + elif H[i]==H[i+1]-1: + H[i+1]-=1 + else: + print(""No"") + break + else: + print(""Yes"") + return + +main()" +p02953,s566197662,Accepted,"n = int(input()) +a = list(map(int, input().split())) +b = a[::-1] +for i in range(1, n): + if b[i] - b[i-1] > 1: + print(""No"") + exit() + elif b[i] - b[i-1] == 1: + b[i] -= 1 +else: + print(""Yes"")" +p02953,s359572463,Accepted,"n=int(input()) +h=list(map(int,input().split())) +h[0]-=1 +yn=0 +for i in range(n-1): + if h[i]+1<=h[i+1]: + h[i+1]-=1 + if h[i]>h[i+1]: + yn=1 + break +if yn==1: + print(""No"") +else: + print(""Yes"") +" +p02953,s035826271,Accepted,"n,*l=map(int,open(0).read().split()) +t=s=0 +for i in l: + if it: t=i-1 +print('YNeos'[s::2])" +p02953,s779814030,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +prev = H[-1] +for i in range(N - 2, -1, -1): + #print(i) + if not H[i] <= prev: + if not H[i] - 1 <= prev: + print('No') + quit() + else: + H[i] -= 1 + prev = H[i] + else: + prev = H[i] +print('Yes')" +p02953,s423803531,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in reversed(range(1,n)): + if h[i] < h[i-1]: + h[i-1] -= 1 + if h[i] < h[i-1]: + print(""No"") + exit() +print(""Yes"") " +p02953,s220039635,Accepted,"N = int(input()) + +H = list(map(int,input().split())) + +for i in range(N-1,0,-1): + if 2 <= H[i-1] - H[i]: + print('No') + exit() + else: + if (H[i-1] - 1) == H[i]: + H[i-1] -= 1 +print('Yes')" +p02953,s554434689,Accepted,"n=int(input()) +b =list(map(int,input().split())) + +b.reverse() + +for i in range(1,n): + + if (b[i] > b[i-1]): b[i] += -1 + + if b[i] > b[i-1] : print('No');exit() + + +print('Yes')" +p02953,s482749199,Accepted,"n = int(input()) +h = list(map(int, input().split())) +if n==1: + print('Yes') + exit() +ht = h[-1] +for i in reversed(range(n-1)): + if ht == h[i]-1: + h[i]-=1 + elif ht < h[i]-1: + print('No') + exit() + ht = h[i] +print('Yes')" +p02953,s704022433,Accepted,"n = int(input()) +a = list(map(int,input().split())) + +for i in range(n-1): + if a[i]a[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s819455722,Accepted,"n = int(input()) +h = list(map(int, input().split())) +can_build = True +for i in range(n-1, 0, -1): + diff = h[i-1] - h[i] + if diff == 1: + h[i - 1] -= 1 + elif diff > 1: + can_build = False + break +print(""Yes"" if can_build else ""No"")" +p02953,s851158338,Accepted,"n = int(input()) +a = list(map(int, input().split())) + +judge = 0 +for i in range(n): + if a[i] < judge: + print(""No"") + break + judge = max(judge, a[i]-1) +else: + print(""Yes"")" +p02953,s388971695,Accepted,"import sys + +sys.setrecursionlimit(10 ** 7) +f_inf = float('inf') +mod = 10 ** 9 + 7 + + +def resolve(): + n = int(input()) + H = list(map(int, input().split())) + + for i in range(1, n): + if H[i - 1] < H[i]: + H[i] -= 1 + + for j in range(1, n): + if H[j - 1] > H[j]: + print(""No"") + break + else: + print(""Yes"") + + +if __name__ == '__main__': + resolve() +" +p02953,s674819186,Accepted,"n=int(input()) +h=list(map(int,input().split())) +count=0 +for i in h: + if count>i: + print(""No"") + break + count=max(count,i-1) +else: + print(""Yes"")" +p02953,s894187899,Accepted,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +for i in range(N-1): + if H[i+1] == H[i]: + None + elif H[i+1] > H[i]: + H[i+1] = H[i+1]-1 + else: + print('No') + sys.exit() +print('Yes')" +p02953,s362816251,Accepted,"N = int(input()) +H = list(map(int, input().split())) +H[0] += -1 + +ans = ""Yes"" + +for i in range(N-1): + if H[i] > H[i+1]: + ans = ""No"" + break + if H[i] < H[i+1]: + H[i+1] += -1 + +print(ans)" +p02953,s249845747,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h.reverse() +s = h[0] +z = 'Yes' +for i in range(n-1): + if h[i] <= s: + s = h[i] + elif h[i]-s == 1: + s = s + else: + z = 'No' + break +print(z)" +p02953,s155372867,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +a = 0 +for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + continue + elif H[i] == H[i+1]: + continue + else: + print(""No"") + exit() +print(""Yes"") + + +" +p02953,s276354963,Accepted,"n = int(input()) +a = list(map(int, input().split())) +p = 0 +for i in a: + if p > i: + print('No') + exit() + if p < i: + p = i - 1 +print('Yes') +" +p02953,s888093113,Accepted,"N=int(input()) +H=list(map(int,input().split())) +a=0 +for i in range(N-1): + if aH[i+1]: + print(""No"") + break +else: + print(""Yes"")" +p02953,s055113063,Accepted,"n = int(input()) +li = list(map(int,input().split())) +ans = ""Yes"" +max_n = 0 + + +for i in li: + if i < max_n - 1: + ans = ""No"" + break + max_n = max(i,max_n) +print(ans)" +p02953,s399546092,Accepted,"import sys +stdin = sys.stdin +from itertools import accumulate + +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) + +n = ni() +h = na() +hpre = h[-1] +for hi in h[:-1][::-1]: + if hi <= hpre: + hpre = hi + elif hi == hpre + 1: + hpre = hi - 1 + else: + print(""No"") + quit() +print(""Yes"")" +p02953,s316902368,Accepted,"import sys +N = int(input()) +L = list(map(int,input().split())) +for i in range(N-1,0,-1): + if L[i-1] > L[i]: + if L[i-1] - 1>L[i]: + print('No') + sys.exit(0) + L[i-1]-=1 +print('Yes')" +p02953,s072563285,Accepted,"N = int(input()) +H = list(map(int,input().split())) + +hardle = 0 +ans = ""Yes"" +for i in H: + if hardle>i: + ans = ""No"" + break + else: + if i>hardle: + hardle=i-1 +print(ans)" +p02953,s780134803,Accepted,"N=int(input()) +H=list(map(int,input().split())) +hlow=[H[i]-1 for i in range(N)] +a=[hlow[0]] +flag=True +for i in range(1,N): + if a[i-1]<=hlow[i]: + a.append(hlow[i]) + elif a[i-1]<=H[i]: + a.append(H[i]) + else: + print('No') + flag=False + break + +if flag: + print('Yes')" +p02953,s401677226,Accepted,"n = int(input()) +h = list(map(int,input().split())) +ch = h[0] +for i in range(n-1): + if ch > h[i+1] + 1: + print(""No"") + exit() + ch = max(ch,h[i+1]) +print(""Yes"")" +p02953,s677840637,Accepted,"N=int(input()) +H=list(map(int,input().split())) + +if N==1: + print('Yes') +else: + for i in range(N-1): + if H[N-i-2]>= H[N-i-1]+2: + print('No') + exit() + elif H[N-i-2]==H[N-i-1]+1: + H[N-i-2]-=1 + + for j in range(N-1): + if H[i]>H[i+1]: + print('No') + exit() + print('Yes') + " +p02953,s847690603,Accepted,"n=int(input()) +h=list(map(int,input().split())) +temp=0 +if n==1: + print(""Yes"") +else: + for i in range(0,n): + if h[i] h[i-1]: + h[i] -= 1 + elif h[i] < h[i-1]: + print('No') + exit() +print('Yes')" +p02953,s427648969,Accepted,"N = int(input()) +A = list(map(int, input().split())) + + + +for i in range(N-1): + #print(i, max, N, A[i], A[i+1]) + if A[i] - A[i+1] >=2: + print('No') + break + + if A[i] - A[i+1] ==1 and i >=2 and A[i-1] >= A[i]: + print(""No"") + break + + if i ==0 or A[i] > A[i-1]: + A[i] -=1 + +else: + print('Yes')" +p02953,s218526136,Accepted,"N = int(input()) +H = [int(i) for i in input().split()] + +ans=0 +H2 = H +for i in range(N-1) : + if H[i]= H[n+1]: + pass + elif H[n+1] - H[n] == 1: + H[n+1] -= 1 + else: + is_clear = False + break + + if is_clear: + print(""Yes"") + else: + print(""No"")" +p02953,s544259999,Accepted,"#python3 +n=int(input()) +h=[int(i) for i in input().split()] + +def solve(): + h[0]-=1 + for i in range(1,n): + if h[i] > h[i-1]: + h[i]-=1 + elif h[i] == h[i-1]: + pass + else : + print('No') + return 0 + return 1 + + +if solve(): + print('Yes') +" +p02953,s064267456,Accepted,"N = int(input()) +H = list(map(int, input().split())) +for i in range(N - 1, 0, -1): + if H[i] < H[i - 1] - 1: + print('No') + break + elif H[i] == H[i - 1] - 1: + H[i - 1] -= 1 +else: + print('Yes') +" +p02953,s815250837,Accepted,"import sys +def input(): return sys.stdin.readline().rstrip() +def main(): + n=int(input()) + H=[int(_) for _ in input().split()] + H[0]-=1 + for i in range(1,n): + if H[i-1]H[i]: + print(""No"") + break + else:print(""Yes"") +if __name__=='__main__': + main()" +p02953,s758303434,Accepted,"n = int(input()) +h = list(map(int, input().split())) +m = 0 +flag = True +for n in h: + if m < n: + m = n + elif n <= m - 2: + flag = False + break +if flag: + print(""Yes"") +else: + print(""No"")" +p02953,s655029085,Accepted,"n = int(input()) +H = list(map(int, input().split())) +for i in range(1, n): + if H[i - 1] < H[i]: + H[i] -= 1 + elif H[i - 1] > H[i]: + print('No') + exit() +print('Yes')" +p02953,s490212784,Accepted,"from sys import exit +n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1,0,-1): + if h[i-1] > h[i]: + h[i-1] -= 1 + if h[i-1] > h[i]: + print(""No"") + exit(0) +print(""Yes"")" +p02953,s403814619,Accepted,"n = int(input()) +h = list(map(int,input().split())) +flg = ""Yes"" +pre = -999 +for i in range(1,n): + #print(h[i]) + if pre <= h[i]-1 : + pre = h[i]-1 + elif pre <= h[i]: + pre = h[i] + else: + flg = ""No"" + break + +print(flg) + + + + +" +p02953,s311322987,Accepted,"N = int(input()) +H = list(map(int, input().split())) +# H[N-2],H[N-3],...,H[0]について +for i in range(N - 2, -1, -1): + if H[i] > H[i + 1] + 1: + print(""No"") + exit() + if H[i] == H[i + 1] + 1: + H[i] -= 1 +print(""Yes"") +" +p02953,s246886167,Accepted,"n=int(input()) +h=list(map(int,input().split())) + +h=h[::-1] +for i in range(1,n): + if h[i]-h[i-1]>1: + print(""No"") + exit(0) + elif h[i]-h[i-1]==1: + h[i]-=1 +print(""Yes"") +" +p02953,s865655445,Accepted,"N = int(input()) +H = list(map(int,input().split())) +for i in reversed(range(N-1)): + if(H[i] <= H[i+1]): + continue + elif(H[i]-1 == H[i+1]): + H[i] -= 1 + else: + print(""No"") + exit() +print(""Yes"")" +p02953,s732644797,Accepted,"N = int(input()) + +List = list(map(int,input().split())) + +H = 0 +ck = 0 + +for i in range(N): + a = List[i] + if a >= H: + if a-1 >= H: + H = a -1 + else: + H = a + else: + ck = 1 + +print(""Yes"" if ck == 0 else ""No"") +" +p02953,s273050603,Accepted,"n = int(input()) +a = list(map(int, input().split())) +flg = 0 +a[0] -= 1 +for i in range(1,n): + if a[i] >= a[i-1] + 1: + a[i] -= 1 + elif a[i] < a[i-1]: + flg = 1 +if flg == 1: + print('No') +else: + print('Yes')" +p02953,s053157636,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +h.reverse() + +for i in range(n-1): + if h[i] >= h[i+1]: + pass + + elif h[i] == h[i+1] - 1: + h[i+1] -= 1 + + else: + print('No') + exit() + +print('Yes') +" +p02953,s680440342,Accepted,"def solve(): + n = int(input()) + h = list(map(int, input().split())) + right = h[len(h)-1] + flag = True + for i in reversed(h): + if i <= right: + right = i + continue + elif i-1 == right: + continue + else: + flag = False + break + if flag: + print('Yes') + else: + print('No') + + +solve() +" +p02953,s017660526,Accepted,"n = int(input()) +al = list(map(int, input().split())) +cnt = len(al) +tmp = al[cnt-1] + +for i in range(cnt-1, 1, -1): + if al[i-1] - tmp >= 2: + print(""No"") + exit() + elif al[i-1] - tmp == 1: + tmp = al[i-1]-1 + else: + tmp = al[i-1] +print(""Yes"")" +p02953,s584756392,Accepted,"n = int(input()) +H = list(map(int,input().split())) +for i in range(n-1): + if H[i] > H[i+1]: + if H[i] <= H[i+1] + 1: + H[i+1] += 1 + else: + print('No') + break +else: + print('Yes') + " +p02953,s501637975,Accepted,"N = int(input()) +height = list(map(int,input().split())) +for i in range(N-1,0,-1): + n = height[i] - height[i-1] + if n <= -2: + print(""No"") + exit() + elif n == -1: + height[i-1] -= 1 +print(""Yes"")" +p02953,s146916706,Accepted,"N = int(input()) +H = list(map(int, input().split())) + +ans = ""Yes"" +for i in range(N-1): + dif = H[i+1] - H[i] + if dif <= -2: + ans = ""No"" + elif dif == -1: + H[i+1] += 1 +print(ans)" +p02953,s900597993,Accepted,"# https://atcoder.jp/contests/abc136/tasks/abc136_c + +n = int(input()) +nums = [int(i) for i in input().split()] + +for i in range(1, n): + if nums[i] == nums[i - 1] - 1: + nums[i] += 1 + if nums[i] < nums[i - 1]: + print('No') + break +else: + print('Yes')" +p02953,s305888354,Accepted,"n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] +f = True +for i in range(n-1): + if h[i] < h[i+1]: + h[i+1] -= 1 + if h[i] < h[i+1]: + f = False + break +if f: print('Yes') +else: print('No')" +p02953,s719753688,Accepted,"n = int(input()) +H = list(map(int, input().split())) +flag = True +highest = 0 +for i in range(n): + if H[i] > highest: + highest = H[i] + else: + if highest > H[i] + 1: + flag = False + +print('Yes' if flag == True else 'No')" +p02953,s788257814,Accepted,"N = int(input()) +Hlist = list(map(int,input().split())) +sign = 1 +Answer = 'Yes' +for i in range(len(Hlist)-1): + H1 = Hlist[i] + H2 = Hlist[i+1] + if H1 > H2: + if H1 - H2 == 1 and sign == 1: + Hlist[i] -= 1 + sign =0 + else: + Answer = 'No' + break + if H1 < H2: + sign = 1 +print(Answer)" +p02953,s873112594,Accepted,"import sys +N = int(input()) +H = list(map(int, input().split())) + +if N==1: + print(""Yes"") + sys.exit() +else: + for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] = (H[i+1] - 1) + if H[i] > H[i+1]: + print(""No"") + sys.exit() + + +print(""Yes"")" +p02953,s635958410,Accepted,"n=int(input()) +h=list(map(int,input().split())) +h[0]-=1 +for i in range(1,n): + if h[i]H[i]: + print('No') + break +else: + print('Yes')" +p02953,s331773060,Accepted,"N = int(input()) +H = list(map(int, input().split())) +t = 1 +for h in H: + if t < h: + t = h-1 + elif t == h: + pass + else: + print(""No"") + exit() +print(""Yes"") +" +p02953,s101721725,Accepted," +n = int(input()) +data = list(map(int, input().split())) + +for i in range(n - 1): + if data[i] < data[i + 1]: + data[i + 1] -= 1 + +for i in range(n - 1): + if data[i] > data[i + 1]: + #print(""i:{0}"".format(i))# + print(""No"") + exit() + +print(""Yes"")" +p02953,s879929980,Accepted,"N = int(input()) +H = [int(i) for i in input().split()] +m = H[0] +for h in H: + if m - h > 1: + print(""No"") + break + m = max(m, h) +else: + print(""Yes"")" +p02953,s846352457,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +ans = ""Yes"" +t = h[0] +for i in range(1,n): + t = max(h[i-1],t) + if h[i] - t <= -2: + ans = ""No"" + break + +print(ans) +" +p02953,s467866352,Accepted,"N=int(input()) +Hi=list(map(int,input().split())) + +for i in range(N-1): + if Hi[i] < Hi[i+1]: + Hi[i+1]-=1 + + if Hi[i] == Hi[i+1]: + pass + + if Hi[i] > Hi[i+1] : + print('No') + exit() + +print('Yes')" +p02953,s949138994,Accepted,"n=int(input()) +h=list(map(int,input().split())) +a=h[0] +for i in range(1,n-1): + a=max(h[i],a) + b=h[i+1] + if a-b>=2: + print('No') + exit(0) +print('Yes')" +p02953,s295248146,Accepted,"n=int(input()) +h=list(map(int,input().split())) + +check=0 +for i in h: + if check-1>i: + print(""No"") + exit() + check=max(check,i) +print(""Yes"")" +p02953,s431478539,Accepted,"n = int(input()) +H = list(map(int, input().split())) + +i = -1 +for _ in range(n - 1): + if H[i - 1] - H[i] > 1: + ans = ""No"" + print(ans) + exit() + elif H[i - 1] - H[i] == 1: + H[i - 1] -= 1 + i -= 1 + +ans = ""Yes"" +print(ans) +" +p02953,s056761095,Accepted,"# https://atcoder.jp/contests/abc136/tasks/abc136_c + +N = int(input()) +H_list = list(map(int, input().split())) + +past_H = 0 +can_substract = False + +for i in range(1, N - 1): + + if H_list[i] - H_list[i + 1] > 1: + print('No') + exit() + + if (H_list[i] - H_list[i + 1] == 1) and (H_list[i] - H_list[i - 1] < 1): + print('No') + exit() + + if H_list[i] - H_list[i - 1] >= 1: + H_list[i] -= 1 + continue + +print('Yes') + + +" +p02953,s531971572,Accepted,"N=int(input()) +H=list(map(int,input().split())) +flag=True +for i in range(1,N): + if H[i]>H[i-1]: + H[i]-=1 + elif H[i]==H[i-1]: + pass + elif H[i] H[i-1]: + H[i] -= 1 + +if H == sorted(H): + print(""Yes"") +else: + print(""No"")" +p02953,s838672503,Accepted,"import sys +n = int(input()) +h = list(map(int,input().split())) +for i in range(n-1,0,-1): + if h[i]-h[i-1]>=0: + pass + elif h[i]-h[i-1]==-1: + h[i-1] -= 1 + else: + break +else: + print(""Yes"") + sys.exit() +print(""No"")" +p02953,s108488264,Accepted,"N = int(input()) +A = list(map(int, input().split())) +A.reverse() +ans = ""Yes"" +for i in range(N-1): + if A[i] >= A[i+1]: + continue + elif A[i] == A[i+1] - 1: + A[i+1] = A[i] + else: + ans = ""No"" +print(ans)" +p02953,s427567663,Accepted,"n = int(input()) +h_ls = list(map(int, input().split())) + +target = [] +for i in range(1,n): + d = h_ls[i] - h_ls[i-1] + if d > 0: + target = [] + elif d == 0: + target.append(i-1) + else: + target.append(i-1) + for j in target: + h_ls[j] -= 1 + target = [] +res = 'Yes' +for i in range(1,n): + d = h_ls[i] - h_ls[i-1] + if d < 0: + res = 'No' +print(res) +" +p02953,s721429798,Accepted,"N = int(input()) +H = list(map(int,input().split())) +H.reverse() + +check = True + +for i in range(N-1): + if H[i] >= H[i+1]: + continue + else: + if H[i+1] - H[i] > 1: + check = False + break + else: + H[i+1] -= 1 + +if check: + print(""Yes"") +else: + print(""No"")" +p02953,s313594706,Accepted,"n = int(input()) +a = list(map(int, input().split())) +tmp = a[0] - 1 +ans = ""Yes"" +for i in range(1, n): + if a[i] < tmp: + ans = ""No"" + break + elif a[i] == tmp: + tmp = a[i] + else: + tmp = a[i] - 1 +print(ans)" +p02953,s558913260,Accepted,"N = int(input()) +H = list(map(int,input().split())) +tmp = -999999 +for i in range(N): + if tmp <= H[i]-1: + tmp = H[i] -1 + elif tmp <= H[i]: + tmp = H[i] + else: + print('No') + break +else: + print('Yes')" +p02953,s911597759,Accepted,"N = int(input()) +Hs = list(map(int,input().split())) + +ans = 'Yes' +for i in range(N-1, 0, -1): + if Hs[i-1] > Hs[i]: + if Hs[i-1] - Hs[i] == 1: + Hs[i-1] -= 1 + continue + else: + ans = 'No' + break +print(ans)" +p02953,s671304058,Accepted,"N=int(input()) +H=list(map(int,input().split())) +if N==1: + print('Yes') + exit(0) +if H[0]-H[1]>1: + print('No') + exit(0) +else: + H[0]-=1 +for i in range(1,N-1): + if H[i+1]>=H[i]: + if H[i]-H[i-1]>=1: + H[i]-=1 + continue + else: + if H[i]-H[i+1]==1 and H[i]-1-H[i-1]>=0: + H[i]-=1 + continue + else: + print('No') + exit(0) +print('Yes')" +p02953,s309978897,Accepted,"import sys +N=int(input()) +H=list(map(int,input().split())) +H.insert(0,0) +for i in range(N): + if(H[i+1]H[i]): + H[i+1]-=1 +print(""Yes"")" +p02953,s543391136,Accepted,"def main(): + n = int(input()) + h = list(map(int,input().split())) + + for i in range(1,n)[::-1]: + if h[i-1] <= h[i]: + continue + h[i-1] = h[i-1]-1 + if h[i-1] > h[i]: + print('No') + return 0 + print('Yes') + +if __name__ == '__main__': + main() + +" +p02953,s053808819,Accepted,"n = int(input()) +h = list(map(int,input().split())) +lowest = h[0]-1 +for i in range(1,n): + if h[i] < lowest: + print(""No"") + quit() + else: + lowest = max(lowest,h[i]-1) +print(""Yes"")" +p02953,s484294040,Accepted,"import sys +N = int(input()) +boxes = list(map(int,input().split())) +prev = 10**9+1 +for box in boxes[::-1]: + if prev - box > -1: + prev = box + elif prev - box == -1: + prev = box -1 + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s867986428,Accepted,"n = int(input()) +h = list(map(int,input().split())) +h[0] -= 1 +for i in range(1,n): + if h[i] > h[i - 1]: + h[i] -= 1 + elif h[i] < h[i - 1]: + print(""No"") + break +else: + print(""Yes"")" +p02953,s501423258,Accepted,"n = int(input()) +h = list(map(int,input().split())) + +ans = 1 +m = h[0] +for i in range (n): + if (h[i] > m): + m = h[i] + elif (m-h[i] >= 2): + ans = 0 + break + +if (ans == 1): + print(""Yes"") +else : + print(""No"")" +p02953,s779457074,Accepted,"import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +sys.setrecursionlimit(10 ** 7) + +n, *h = map(int, read().split()) +h = h[::-1] +for i, (bf, af) in enumerate(zip(h, h[1:])): + if bf + 1 < af: + print('No') + exit() + if bf < af: + h[i + 1] -= 1 +print('Yes') +" +p02953,s992443908,Accepted,"n = int(input()) +listH = list(map(int, input().split())) + +for i in range(0, n-1): + if(listH[i+1] - listH[i] == -1): + listH[i+1] += 1 + if(listH[i+1] - listH[i] < -1): + print(""No"") + quit() + + +print(""Yes"")" +p02953,s155559433,Accepted,"N = int(input()) +H = list(map(int,input().split())) +m = 0 +flg = True +for i in range(N-1): + if m < H[i]: + m = H[i]-1 + if m > H[i+1]: + flg = False + break +if flg: + print(""Yes"") +else: + print(""No"")" +p02953,s400825024,Accepted,"n=int(input()) +h=list(map(int,input().split())) + + +for i in range(n-1): + if h[n-1-i]i: + print('No') + exit() + ans=max(ans,i-1) +else: + print('Yes')" +p02953,s838689471,Accepted,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(1,n): + if h[i] >= h[i-1]: continue + if h[i] <= h[i-1] - 2: print('No'); break + h[i] += 1 +else: print('Yes')" +p02953,s187858528,Accepted,"n = int(input()) +h = list(map(int,input().split())) +t1, t2 = h[0]-1, h[0] +for i in range(1, n): + if h[i] < t1: + print(""No"") + exit() + else: + t1, t2 = max(h[i]-1, t1), max(h[i], t2) +print(""Yes"")" +p02953,s385187198,Accepted,"#https://atcoder.jp/contests/abc136/tasks/abc136_c + +n = int(input()) +h = [int(i) for i in input().split()] + +flag = 'Yes' +for i in reversed(range(n - 1)): + if h[i+1] - h[i] < 0 and h[i+1] - h[i] > -2: + h[i] -= 1 + elif h[i+1] - h[i] <= -2: + flag = 'No' + break +print(flag)" +p02953,s421894157,Accepted,"n,*h=map(int,open(0).read().split()) +h.reverse() +base=h[0] +flg=True +for i in h: + if i > base: + if i-1 > base: + flg=False + break + elif i < base: + base = i +print(""Yes"" if flg else ""No"")" +p02953,s323222576,Accepted,"from sys import stdin +def main(): + input=stdin.readline + n=int(input()) + H=[int(_) for _ in input().split()] + H[0]-=1 + for i in range(1,n): + if H[i-1]H[i]: + print(""No"") + break + else:print(""Yes"") +if __name__=='__main__': + main()" +p02953,s935237642,Accepted,"n=int(input()) +a=list(map(int,input().split())) +b=0 +for i in a: + if b>i:print(""No"");exit() + b=max(b,i-1) +print(""Yes"")" +p02953,s635660691,Accepted,"N=int(input()) +H=list(map(int,input().split())) + +C=[H[0]] +for i in range(1,N): + if H[i-1]!=H[i]: + C.append(H[i]) + +for i in range(len(C)-1): + if C[i]>C[i+1]: + C[i]-=1 + +F=True +for i in range(len(C)-1): + F&=(C[i]<=C[i+1]) + +if F: + print(""Yes"") +else: + print(""No"") +" +p02953,s347401227,Accepted,"import sys +n=int(input()) +A = [int(i) for i in input().split()] +#A =list(map(int,input().split())) +mi = 0 +for i in range(n): + if mi < A[i]: + mi = A[i]-1 + elif mi == A[i]: + mi = A[i] + elif A[i]-mi < 0 : + print('No') + sys.exit() +print('Yes')" +p02953,s811983404,Accepted,"n = int(input()) +h = list(map(int, input().split())) +mn = 0 +ans = ""Yes"" +for i in h: + if i <= mn - 2: + ans = ""No"" + else: + mn = max(mn, i) +print(ans) +" +p02953,s406447569,Accepted,"def main(): + N = int(input()) + H = [int(i) for i in input().split()] + pre = H[-1] + for i, h in enumerate(H[::-1], start=1): + if i == 1: + continue + if h - pre > 1: + return print(""No"") + elif h - pre == 1: + pre = h - 1 + else: + pre = h + print(""Yes"") + + +if __name__ == '__main__': + main() +" +p02953,s244679947,Accepted,"n=int(input()) +h=list(map(int,input().split())) +for i in reversed(range(n-1)): + if h[i]>h[i+1]: + h[i]-=1 + +for i in range(n-1): + if h[i]>h[i+1]: + print('No') + break +else: + print('Yes') +" +p02953,s808202924,Accepted,"N = int(input()) +H = [int(i) for i in input().split()] + + +for i in range(1, N-1): + if H[i-1] <= H[i] - 1 <= H[i+1]: + H[i] -= 1 + continue + + if H[i-1] <= H[i]<= H[i+1]: + continue + + print(""No"") + break + +else: + print(""Yes"")" +p02953,s067577940,Accepted,"n = int(input()) +h = [int(x) for x in input().split()] + +lmax = h[0] +for i in range(1, n-1): + lmax = max(lmax, h[i]) + if lmax - h[i+1] >= 2: + print('No') + exit() + +print('Yes') +" +p02953,s867680120,Accepted,"N = int(input()) +H = list(map(int,input().split())) +flag = 0 +hmax = H[0] +for i in range(1,N): + h = H[i] + if hmax-h>=2: + flag = 1 + break + hmax = max(hmax,h) +if flag==0: + print(""Yes"") +else: + print(""No"")" +p02953,s127044732,Accepted,"def main(): + N = int(input()) + H = list(map(int, input().split())) + for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] -= 1 + if H[i] > H[i+1]: + print('No') + return + print('Yes') + +if __name__ == ""__main__"": + main() +" +p02953,s325299808,Accepted,"n = int(input()) +a = list(map(int,input().split())) +a.reverse() +for i in range(n-1): + if a[i] < a[i+1]: + a[i+1] -=1 +count = 0 +for i in range(n-1): + if a[i] < a[i+1]: + count+=1 +if count == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s712959286,Accepted,"import numpy as np + +N = int(input()) +H = np.array(list(map(int, input().split()))) + +ans_1 = min(H[np.where(H==H.max())[0].min():]) > max(H)-2 +tmp = H[1:] - H[:-1] +ans_2 = all(tmp > -2) + +print(""Yes"") if ans_1 & ans_2 else print(""No"")" +p02953,s743960076,Accepted,"N = int(input()) +H = list(map(int,input().split())) +ans = 'Yes' +for i in range(N-1): + if H[i+1] -H[i] >= 1: + H[i+1] -= 1 + if H[i]-H[i+1] >= 1: + ans = 'No' + break +print(ans)" +p02953,s077311474,Accepted,"n = int(input()) +l = list(map(int, input().split())) + +tmp = 0 +for h in l: + if h > tmp: + tmp = h-1 + if h < tmp: + print('No') + break +else: + print('Yes')" +p02953,s726540424,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +max_ = h[0] + +for i in range(1, n - 1): + max_ = max(max_, h[i]) + if max_ - h[i] >= 2: + print(""No"") + exit() +print(""Yes"")" +p02953,s936262391,Wrong Answer,"from functools import reduce +n = int(input()) +H = list(map(int, input().split())) + +H[0] -= 1 +for i in range(1, n): + if H[i] < H[i-1]: + H[i] -= 1 +print('Yes' if reduce(lambda x, y: x <= y, H) else 'No')" +p02953,s171592516,Wrong Answer,"def main(): + n = int(input()) + arr = list(map(int,input().split())) + for i in range(len(arr)-1): + if arr[i]>arr[i+1]: + arr[i]-=1 + for i in range(len(arr)-1): + if arr[i]>arr[i+1]: + print(""No"") + return + print(""Yes"") + return + + +main() + + +# 1 2 3 4 5 +# 1 3 3 4 5 +# 1 4 3 4 5 +" +p02953,s054128687,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) + +for i in range(N-1): + if H[i]>H[i+1]: + H[i]-=1 + +F=True +for i in range(N-1): + F&=(H[i]<=H[i+1]) + +if F: + print(""Yes"") +else: + print(""No"") +" +p02953,s562598651,Wrong Answer,"import sys +n=int(input()) +h=list(map(int,input().split())) +h[0]-=1 +for i in range(1,n-1): + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + h[i]-=1 + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + print(""No"") + sys.exit() +print(""Yes"") +" +p02953,s302051764,Wrong Answer,"def main(): + N = int(input()) + H = list(map(int, input().split("" ""))) + flag = True + for i in range(N - 1): + if H[i] - H[i + 1] <= 0: + H[i + 1] -= 1 + for j in range(N - 1): + if H[j + 1] - H[j] < 0: + flag = False + break + if flag: + print(""Yes"") + else: + print(""No"") + + +if __name__ == '__main__': + main()" +p02953,s373626370,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n-1): + if h[i+1]-h[i] > 1: + print('No') + exit() +print('Yes') +" +p02953,s573163349,Wrong Answer,"n = int(input()) +h =list(map(int, input().split())) + +for i in range(n-1): + if h[i] > h[i+1] and h[i]-1 <= h[i+1]: + h[i] -= 1 + elif h[i]-1 > h[i+1]: + print(""No"") + exit() + +for i in range(n-1): + if h[i] > h[i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s598975874,Wrong Answer,"import sys + +n = int(sys.stdin.readline()) +h = list(map(int, sys.stdin.readline().split())) + +ans = 'Yes' +for i in range(n - 1): + if h[i + 1] - h[i] < 0: + ans = 'No' + break + elif h[i + 1] - h[i] <= 1: + h[i + 1] -= 1 +print(ans) +" +p02953,s003143533,Wrong Answer,"n=(int)(input()) +a=list(map(int, input().split("" ""))) +for i in range(len(a) - 1): + if a[i] > a[i + 1] + 1: + print(""No"") + break +else: + print(""Yes"")" +p02953,s902851899,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +hlow=[H[i]-1 for i in range(N)] +a=[hlow[0]] +flag=True +for i in range(N): + if a[i-1]<=hlow[i]: + a.append(hlow[i]) + elif a[i-1]<=H[i]: + a.append(H[i]) + else: + print('No') + flag=False + break + +if flag: + print('Yes')" +p02953,s243032249,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +mx=max(h) +for i in range(n): + if mx-h[i]>=2: + print('No') + exit() +print('Yes')" +p02953,s590165989,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) + +hardle = 0 +ans = ""Yes"" +for i in H: + if hardle>i: + ans = ""No"" + break + else: + if i>hardle: + hardle-=1 +print(ans)" +p02953,s076008015,Wrong Answer,"N = int(input()) +A = list(map(int, input().split())) +if N == 1: + print(""Yes"") +else: + k = 0 + for i in range(N -1): + if A[i + 1] < A[i]: + k += (A[i] - A[i +1]) + if k <= 1: + print(""Yes"") + else: + print(""No"")" +p02953,s116973395,Wrong Answer,"from collections import deque + +N = int(input()) +H = deque(map(float, input().split())) + +prev = H.popleft() + +if N == 1: + print('Yes') + exit() + +for i in range(N-1): + cor = H.popleft() + if prev - cor < -1: + print('No') + exit() + + prev = cor + + +print('Yes') +" +p02953,s301129505,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +cnt = 0 +for i in range(N-1): + if(H[i] > H[i+1]): + tmp = H[i] - 1 + if(tmp != H[i+1] or cnt > 0): + print('No') + sys.exit() + cnt += 1 +print('Yes')" +p02953,s437121190,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +check = 0 + +for i in range(0,N-1): + if(H[i+1] < H[i]): + H[i+1] = H[i] + elif(H[i]-H[i+1] >= 2): + check = 1 + +if(check == 1): + print(""No"") +else: + print(""Yes"")" +p02953,s363059007,Wrong Answer,"def myAnswer(N:int,H:list) -> str: + pre = H.pop(0) + for h in H: + if(pre > h): + if((pre - h) == 1): + pre = pre - 1 + else: + return ""No"" + else: + pre = h + return ""Yes"" + + +def modelAnswer(): + tmp=1 +def main(): + N = int(input()) + H = list(map(int,input().split())) + print(myAnswer(N,H[:])) +if __name__ == '__main__': + main()" +p02953,s444693265,Wrong Answer,"from sys import exit + +N = int(input()) +h = list(map(int,input().split())) + +pre = 0 +for i in range(N-1): + if h[i] <= h[i+1]: + pre = h[i] + else: + if h[i]-1 <= h[i+1]: + if pre > h[i]-1: + print(""No"") + exit(0) + else: + pre = h[i]-1 + else: + print(""No"") + exit(0) + +print(""Yes"")" +p02953,s800290252,Wrong Answer,"# -*- coding: utf-8 -*- +n = int(input()) +h = [int(i) for i in input().split()] + +for i in range(n-1): + if h[i] > h[i + 1]: + h[i] -= 1 +#print(h) +#print(sorted(h)) +if h != sorted(h): + print(""No"") +else: + print(""Yes"") +" +p02953,s057435505,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) + +cnt=0 + +for i in range(1,n): + if h[i-1]>h[i]: + cnt+=1 + +if cnt==0: + print('Yes') +if cnt>1: + print('No') +if cnt==1: + for j in range(1,n): + if h[j-1]>h[j]: + if h[j-1]-h[j]==1: + print('Yes') + else: + print('No')" +p02953,s806671248,Wrong Answer,"N=int(input()) +H=list(map(int, input().split())) +no = False +for i in range(N-1): +# print(H[i],H[i+1]) + if H[i]>H[i+1]+1: + no = True + break + elif H[i]==H[i+1]+1: + H[i] -= 1 +#print(H) +if H != H.sort(): + no = True +print(['Yes','No'][no])" +p02953,s219075214,Wrong Answer,"def main(): + n = int(input()) + h = list(map(int, input().split())) + + pre = 0 + for i in range(n): + if h[i] >= pre + 1: + h[i] -= -1 + if h[i] < pre: + print('No') + break + pre = h[i] + + print('Yes') + + +if __name__ == '__main__': + main()" +p02953,s379663460,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +flg = 1 +for i in range(N-1): + if H[i] - H[i+1] >= 2: + flg = 0 + break + if H[i] - H[i+1] == 1: + if i == 0: + continue + if H[i-1] == H[i]: + flg = 0 + break + H[i] -= 1 +if flg == 1: + print('Yes') +else: + print('No')" +p02953,s695091140,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + exit() + +for i in range(len(H)-2): + if H[i+1] - H[i] >= 2: + print(""No"") + exit() +print(""Yes"") " +p02953,s176729468,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 +print('Yes' if h==sorted(h) else 'No')" +p02953,s236154806,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +i = 1 + +while i < n: + if h[i] < h[i-1]: + h[i-1] -= 1 + elif h[i] > h[i-1]: + h[i] -= 1 + else: + pass + + i += 2 + +l = list(h) +l.sort() +if h == l: + print('Yes') +else: + print('No')" +p02953,s467063178,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = ""Yes"" +if N == 2: + if H[0] > H[1]: + ans = ""No"" +else: + for i in range(N-2): + if H[i] - H[i+2] >= 2: + ans = ""No"" +print(ans)" +p02953,s707998429,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 + if h[i]>h[i+1]: + print(""No"") + quit() +print(""Yes"")" +p02953,s268352709,Wrong Answer,"n = int(input()) +arr = list(map(int, input().split())) +for i in range(n-1, 0, -1): + if arr[i]>arr[i-1]: + arr[i-1]-=1 + if arr[i]>arr[i-1]: + print('No') + break +else: + print('Yes')" +p02953,s928081421,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +flag = True +reach = False + +for n in range(N - 1): + if H[n] > H[n + 1]: + if n >= 1 and H[n] - 1== H[n + 1] and H[n] - 1 >= H[n - 1]and reach == False: + reach = True + H[n] -= 1 + elif n == 0 and H[n] - 1== H[n + 1] and reach == False: + reach = True + H[n] -= 1 + else: + flag = False +if flag: + print(""Yes"") +else: + print(""No"")" +p02953,s483816585,Wrong Answer,"import sys +stdin = sys.stdin +from itertools import accumulate + +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) + +n = ni() +h = na() +f = h[0] +b = False +for hi in h[1:]: + if hi > f: + f = hi + b = False + elif hi == f - 1 and not b: + f = hi + b = True + elif hi == f: + b = True + else: + print(""No"") + quit() +print(""Yes"")" +p02953,s868600645,Wrong Answer,"import sys +N = int(input()) +H = list(map(int, input().split())) +for i in range(N-1): + if H[i]-1 >= H[i+1]: + print(""No"") + sys.exit() + +print(""Yes"")" +p02953,s170622255,Wrong Answer,"def ok(hs): + m = 0 + for h in hs: + if h > m + 1: + return False + m = max(m, h) + return True + +n = int(input()) +print('Yes' if ok(map(int, input().split())) else 'No')" +p02953,s461285636,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(1,n): + if h[i-1]-h[i]>0: + print('No') + exit() + elif h[i-1]-h[i] == -1: + h[i] -= 1 +print('Yes') +" +p02953,s352295933,Wrong Answer,"n = int(input()) +s = list(map(int, input().split())) +mx, cnt = 0, 0 +for i in s[::-1]: + if i >= mx: + mx = i + cnt += 1 + else: + pass + if cnt >= 2: + break + +print(""Yes"") if cnt < 2 else print(""No"") + +" +p02953,s558368160,Wrong Answer,"N = int(input()) +H = [int(i) for i in input().split()] +# N = 5 +# H = [1, 2, 1, 1, 3] +# N = 4 +# H = [1, 3, 2, 1] +# N = 5 +# H = [1, 2, 3, 4, 5] +# N = 1 +# H = [1000000000] +ret = True +prev = H[0] +peek = 0 +for i in range(1, N - 1): + peek = H[i + 1] + h = H[i] + if h - peek == 1: + h -= 1 + # print(prev, H[i], h, peek) + if h < prev: + ret = False + break + prev = h +print(""Yes"" if ret else ""No"") +" +p02953,s793079174,Wrong Answer,"import sys +n=int(input()) +h=list(map(int,input().split())) + +for i in range(1,n-1): + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + h[i]-=1 + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s634817402,Wrong Answer,"n = int(input()) +hs = [int(elem) for elem in input().split()] + +res = [] +flag = 0 +for i, h in enumerate(hs): + if i == 0 : + res.append(0) + else: + if res[-1] < 0 and (h - hs[i-1]) < 0: + flag = 1 + break + else: + res.append(h - hs[i-1]) + +if flag == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s151652818,Wrong Answer,"N = int(input()) +S = list(map(int, input().split())) +for a in range(N-1): + if S[a] > S[a+1]: + if S[a] - S[a+1] <= 1: + continue + else: + print(""No"") + exit() +for a in range(N-2): + if S[a] > S[a+2]: + if S[a] - S[a+2] <= 1: + continue + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s631627213,Wrong Answer,"n=int(input()) +a=list(map(int,input().split())) +frag=1 +frag2=1 +for i in range(n-1): + if a[i]-a[i+1]==1: + if frag2==1 and frag==1: + frag2=0 + elif frag2==0: + frag=0 + break + elif frag==2: + frag=0 + break + elif a[i]-a[i+1]>1: + frag=0 + break + elif a[i]==a[i+1]: + frag=2 + elif frag==2: + frag=1 +if frag!=0: + print('Yes') +else: + print('No')" +p02953,s987528832,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +f=1 +for i in range(n-2): + if h[i+1]-h[i]<-1 or h[i+2]-h[i+1]<-1: + f=0 + break + if h[i+1]-h[i]<=0 and h[i+2]-h[i+1]<0: + f=0 + break + +if f: + print(""Yes"") +else: + print(""No"")" +p02953,s443666084,Wrong Answer,"#import math +#import bisect +#import numpy as np +#import itertools +#import copy +import sys + +ipti = sys.stdin.readline +MOD = 10 ** 9 + 7 +INF = float('INF') +sys.setrecursionlimit(10 ** 5) + +def main(): + n = int(input()) + h = list(map(int,ipti().split())) + + for i in range(1, n): + if h[i] - h[i-1] <= 0: + h[i-1] -= 1 + + for i in range(1, n): + if h[i] - h[i-1] < 0: + print('No') + sys.exit() + + print('Yes') + +if __name__ == '__main__': + main()" +p02953,s343142703,Wrong Answer,"n = int(input()) +hlis = list(map(int, input().split())) +d = 0 +for i in range(n-1): + d = max(d, hlis[i] - hlis[i+1]) +if d > 2: + print('No') +else: + print('Yes')" +p02953,s446676570,Wrong Answer,"import sys +import heapq +from decimal import Decimal + +input = sys.stdin.readline + +n = int(input()) +h_list = list(map(int, input().split())) + +tmp = 0 +flag = False + +for h in h_list: + + if tmp == 0: + tmp = h + continue + + if tmp > h: + tmp = h + if flag: + print(""No"") + exit(0) + else: + flag = True + else: + tmp = h + flag = False + +print(""Yes"") +" +p02953,s520387331,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n - 2): + if h[i] < h[i + 1] and h[i + 1] > h[i + 2]: + if h[i] <= h[i + 1] - 1 and h[i + 1] - 1 == h[i + 2]: + h[i + 1] -= 1 +for i in range(n - 1): + if h[i] > h[i + 1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s413778806,Wrong Answer,"import sys +stdin = sys.stdin +from itertools import accumulate + +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) + +n = ni() +h = na() +f = h[0] +b = False +for hi in h[1:]: + if hi >= f: + f = hi + continue + elif hi == f - 1 and not b: + f = hi + else: + print(""No"") + quit() + if hi == f: + b = True +print(""Yes"")" +p02953,s614643339,Wrong Answer,"input() +H = [int(i) for i in input().rstrip().split(' ')] +N = len(H) + +for i in range(0,N): + a = H[i] + b = H[i - 1] if i > 0 else 0 + n = H[i + 1] if i < N -1 else 10**9 + print(i,""#"",b,a,n) + if n == a - 1: + if b == a: + print(""No"") + break + else: + H[i] -= 1 + elif n < a - 1: + print(""No"") + break +else: + print(""Yes"") +print(H)" +p02953,s121673133,Wrong Answer,"n=int(input()) + +h=list(map(int,input().split())) + +for i in range(n-2): + if h[i+1]-h[i]>=2: + print(""No"") + break +else: + print(""Yes"") +" +p02953,s123073163,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +m = h[0] +for i in range(1,n-1): + m = max(m,h[i]) + if h[i] >= m-1: + continue + print('No') + exit() + + +print('Yes')" +p02953,s960292623,Wrong Answer,"n = int(input()) +lst = [int(i) for i in input().split()] +last_value = lst[-1] +if sum([1 if i > last_value + 1 else 0 for i in lst]) > 0: + print ('No') +else: + print ('Yes')" +p02953,s689158818,Wrong Answer,"n = int(input()) +H = list(map(int,input().split())) +print (""Yes"") if H[0] < H[-1] or n == 1 else print (""No"") +" +p02953,s981280849,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +sv = h[n-1] +ok = True +for i in range(n-1): + if h[i] - sv >= 2: + ok = False + +if ok: + print('Yes') +else: + print('No')" +p02953,s427956218,Wrong Answer,"import sys +n=int(input()) +h=list(map(int,input().split())) +h[0]-=1 +for i in range(1,n-1): + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + h[i]-=1 + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s759089777,Wrong Answer,"n = int(input()) +h = list(map(int, input().split()))[::-1] +INF = float('inf') +last = INF +for i in h: + if last >= i: + last = i + elif i - last == 1: + last -= 1 + else: + print(""No"") + exit(0) +print(""Yes"")" +p02953,s631648574,Wrong Answer,"import sys +N=int(input()) +L=list(map(int,input().split())) +for i in range(N): + if i==0: + L[i]-=1 + elif i==N-1: + if L[i-1]>L[i]: + print(""No"") + sys.exit() + else: + if L[i]>L[i+1]: + L[i]-=1 + if L[i-1]>L[i]: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s974491964,Wrong Answer,"from collections import deque + +N = int(input()) +H = deque(map(float, input().split())) + +j = [] +count = 0 +prev = H.popleft() + +for i in range(N-1): + cor = H.popleft() + if cor - prev < -1: + print('No') + exit() + elif cor - prev == -1: + j.append(cor - prev) + count += 1 + else: + j.append(cor - prev) + + if count >= 2: + print('No') + exit() + + prev = cor + +print('Yes') +" +p02953,s881682981,Wrong Answer,"n = int(input()) +l = list(map(int, input().split())) +m = max(l) +num = l.index(m) +for i in range(num, len(l)): + if l[i] + 2 <= m: + print(""No"") + exit() +print(""Yes"")" +p02953,s341198463,Wrong Answer,"def main(): + N = int(input()) + H = [int(i) for i in input().split()] + for i in range(N-1)[::-1]: + if H[i] > H[i+1]: + H[i] -= 1 + if H[i] > H[i+1]: + return print(""NO"") + print(""YES"") + + +if __name__ == '__main__': + main() +" +p02953,s687158000,Wrong Answer,"# C - Build Stairs + +n = int(input()) +h = list(int(x) for x in input().split()) + +ans = 'Yes' +for i in range(1, n): + if h[i-1]-h[i]>1: + ans = 'No' + break + if i>1 and h[i-2]>h[i-1] and h[i-1]>h[i]: + ans = 'No' + break + +print(ans)" +p02953,s463510156,Wrong Answer,"N=int(input()) +h=list(map(int, input().split())) + +ans = 'Yes' + +for i in range(N-1): + if h[i] <= h[i+1]: + ans = 'Yes' + continue + print(i) + if h[i] == (h[i+1]-1): + ans = 'Yes' + continue + else: + ans = 'No' + +print(ans) +" +p02953,s999445192,Wrong Answer,"n = int(input()) +h = [int(e) for e in input().split()] +flg = ""Yes"" +equal = 0 +for i in range(n-1): + if equal: + if h[i] > h[i+1]: + flg = ""No"" + break + else: + h[i] -= 1 + + if h[i+1] < h[i]: + flg = ""No"" + break + elif h[i+1] == h[i]: + equal = 1 + + else: + equal = 0 +print(flg) + + + + +" +p02953,s682502221,Wrong Answer,"N = int(input()) +A = list(map(int,input().split())) +first = 0 +for i in range(N): + m = max(first,A[i]) + if A[i] < first-1: + print(""No"") + exit() + +print(""Yes"")" +p02953,s254918187,Wrong Answer,"N = int(input()) +H = [int(x) for x in input().split()] + +for i in range(N-1): + if H[i] - H[i+1] == 1: + H[i] -= 1 +flg=True +for i in range(N-1): + if H[i] - H[i+1] == 1: + flg=False + break +ans = 'Yes' if flg else 'No' +print(ans)" +p02953,s821778891,Wrong Answer,"N = int(input()) +H = list(map(int, input().split()))[::-1] +high = H[0] +for i in range(1, N): + if high - H[i] < -1: + print(""No"") + exit() + else: + high = H[i] +print(""Yes"")" +p02953,s707721797,Wrong Answer,"import sys +input = sys.stdin.readline +N = int(input()) +a = list(map(int, input().split())) +if max(a) - min(a) <= 1: + print(""Yes"") + exit(0) +for i in range(N - 1): + if a[i + 1] - a[i] < 0: + a[i] -= 1 + if a[i] - a[i + 1] < 0: + a[i + 1] -= 1 +for i in range(N - 1): + if a[i + 1] < a[i]: + print(""No"") + exit(0) +print(""Yes"")" +p02953,s476380294,Wrong Answer,"n = int(input()) +stair = input().split(' ') +flag = 0 + +for i in range(0, n - 1): + if (int(stair[i]) < int(stair[i+1])): + stair[i+1] = int(stair[i+1]) - 1 + if (int(stair[i]) > int(stair[i+1])): + print(""No"") + exit; + + +print(""Yes"") +" +p02953,s765123310,Wrong Answer,"from sys import exit +n = int(input()) +hh = list(map(int, input().split())) + +ans = True +down = False +for i in range(n-1): + if hh[i] <= hh[i+1]: + continue + elif not down and hh[i] - 1 == hh[i+1]: + down = True + continue + else: + print('No') + exit() + break +print('Yes')" +p02953,s809448288,Wrong Answer," +def solve(): + ans = ""Yes"" + for i in range(N-1): + if H[i+1] >= H[i]: + continue + elif H[i] - H[i+1] == 1: + H[i] -= 1 + else: + ans = ""No"" + break + print(ans) + +if __name__ == ""__main__"": + N = int(input()) + H = list(map(int, input().split())) + solve() +" +p02953,s710726816,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 +if max(h)-min(h)==1: + print(""Yes"") + quit() +for i in range(n-1): + if h[i]>h[i+1]: + print(""No"") + quit() +print(""Yes"")" +p02953,s922608932,Wrong Answer,"N=int(input()) +W=list(map(int,input().split())) +for i in range(N-1,0,-1): + if W[i-1]-1>W[i]: + print(""No"") + exit() + if W[i-1]+1==W[i]: + W[i]-=1 +print(""Yes"")" +p02953,s248312211,Wrong Answer,"from collections import deque + +N = int(input()) +H = deque(map(float, input().split())) + +prev = H.popleft() + +if N == 1: + print('Yes') + exit() + +for i in range(N-2): + cor = H.popleft() + if prev - cor < -1: + print('No') + exit() + prev = cor + +cor = H.popleft() + +if cor - prev < 0: + print('No') + exit() + +print('Yes') +" +p02953,s475953030,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +temp=0 +if n==1: + print(""Yes"") +else: + for i in range(0,n-1): + if h[i]-1 h[i]: + h[i-1] -= 1 +print(""Yes"") if h == sorted(h) else print(""No"")" +p02953,s274995191,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +if N>1: + for i in range(N-1,0,-1): + if H[i] < H[i-1] : + H[i-1] -= 1 +if sorted(H) != H: + print('NO') +else: + print('YES')" +p02953,s333335347,Wrong Answer,"N = int(input()) +H = list( map(int,input().split()) ) + + +for i in range(N-1): + if H[i] - H[i+1] >= 2: + print('No') + exit(0) + elif H[i] - H[i+1] == 1: + H[i] -= 1 + +for j in range(N-1): + if H[j] > H[j+1]: + print('No') + exit(0) + +print('Yes')" +p02953,s827550478,Wrong Answer,"n = int(input()) +hs = list(map(int, input().split())) + +result = 'Yes' + +for i in range(1, n - 1): + cur, prev, nex = hs[i], hs[i - 1], hs[i + 1] + if cur < prev or cur > nex: + cur -= 1 + hs[i] = cur + + if not prev <= cur <= nex: + result = 'No' + break + + +print(result) + +" +p02953,s727028725,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +base=0 +for h in H: + if base>h: + print(""No"") + break + base=h-1 +else: + print(""Yes"")" +p02953,s532353796,Wrong Answer,"n=int(input()) +list=list(map(int,input().split())) +for i in range(1,n): + if list[i-1]>list[i]: + list[i-1]-=1 + if list[i]==max(list[0:i]): + continue + else: + print(""No"") + break +else:print(""Yes"")" +p02953,s649399612,Wrong Answer,"import numpy as np +N = int(input()) +l = np.array(list(map(int,input().split()))) +ans = 'Yes' +M = l[0] + +for i in range(1,N): + if l[i] > l[i-1]: + M = l[i] + print(M,l[i]) + + if l[i]< M-1: + ans ='No' + break +print(ans)" +p02953,s970736807,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n): + ans=""Yes"" + if i>0 and h[i-1]-h[i]>1: + ans=""No"" +print(ans)" +p02953,s248161972,Wrong Answer,"import sys +input = sys.stdin.readline + +def main(): + N=int(input()) + H=list(map(int,input().split())) + s=0 + if N==1: + print('Yes') + else: + for i in range(0,N-1): + if H[i]>H[i+1]: + s+=H[i]-H[i+1] + if s<2: + print('Yes') + else: + print('No') + +if __name__ == '__main__': + main() +" +p02953,s522624627,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +for i in range(1,N-1): + if not(H[i-1] <= H[i] <= H[i+1]): + tmp = H[i] - 1 + if not(H[i-1] <= tmp <= H[i+1]): + print('No') + sys.exit() + H[i] = tmp + H[i] -= 1 +print('Yes')" +p02953,s989115568,Wrong Answer,"from sys import exit + +N = int(input()) +h = list(map(int,input().split())) + +pre = 0 +for i in range(N-1): + if h[i] <= h[i+1]: + pre = h[i] + else: + if h[i] - h[i+1] == 1: + if pre > h[i]-1: + print(""No"") + exit(0) + else: + pre = h[i]-1 + else: + print(""No"") + exit(0) + +print(""Yes"")" +p02953,s323852726,Wrong Answer,"import sys +N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1,0,-1): + if H[i-1] - H[i] > 1: + print('No') + sys.exit() + elif H[i-1] > H[i]: + H[i-1] += 1 +print('Yes')" +p02953,s116867068,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +ans = ""Yes"" +for i in range(n-1): + if h[i]>h[i+1]: + h[i] -= 1 + if h[i]>h[i+1] or h[i-1]>h[i]: + ans = ""No"" + break +print(ans)" +p02953,s174256738,Wrong Answer,"n=int(input()) +h =list(map(int,input().split())) +if n ==1: + print('Yes') + exit() +for i in range(n-1): + if h[i] >= h[i+1]: + h[i] -=1 +if h == sorted(h): + print('Yes') + +else: + print('No')" +p02953,s642289346,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +ans = 'Yes' +is_e = False +i = 0 +while i < n-1: + if h[i+1] == h[i]: + is_e = True + elif h[i+1] > h[i]: + is_e = False + elif h[i+1] == h[i]-1 and is_e is False: + is_e = True + else: + ans = 'No' + break + i += 1 +print(ans)" +p02953,s782709383,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +for i in range(N-1): + if H[i] > H[i+1]: + H[i] -= 1 + if H[i] > H[i+1]: + break + +for i in range(N-1): + if H[i] > H[i+1]: + print('No') + break +else: + print('Yes')" +p02953,s673979092,Wrong Answer,"n = int(input()) +l = [int(x) for x in input().split()] +#print(l) + +for i in range(1,n)[::-1]: + if l[i-1] - 1 == l[i]: + l[i] = l[i] + 1 + else: + continue + +print(l) + +a = 0 +for j in range(1, n): + if l[j-1] <= l[j]: + continue + else: + print('No') + break +else: + print('Yes') +" +p02953,s684039657,Wrong Answer,"N = int(input()) +Height = list(map(int, input().split())) +judge = 'Yes' + +if (N == 1): + print(judge) + exit() + +for i in range(N-2): + # if (Height[i] > Height[i+1]+1 or Height[i]+1 < Height[i+1]): + if (abs(Height[i]-Height[i+1]) >= 2): + judge = 'No' + +if (Height[-2] > Height[-1]+1): + judge = 'No' + +print(judge)" +p02953,s422563369,Wrong Answer,"N = int(input()) +H = [int(i) for i in input().split()] +for i in range(N-1): + if(H[i] > H[i+1]): + if(H[i] == H[i+1] + 1): + H[i] -= 1 + else: + print(""No"") + exit() +for i in range(N-1): + if(H[i] > H[i+1]): + print(""No"") + exit() +print(""Yes"")" +p02953,s634253418,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +zenkai_gen = False +no_flag = False + +for i in range(n-1): + sa = h[i+1] - h[i] + + if (zenkai_gen == True) and (sa < 0): + no_flag = True + elif sa <= -2: + no_flag = True + else: + pass + + if sa <= 0: + zenkai_gen = True + else: + zenkai_gen = False + +if no_flag == True: + print(""No"") +else: + print(""Yes"")" +p02953,s521121840,Wrong Answer,"def main(n: int, h: list): + m = h[0] + + for i in h: + if i - 1 > m: + print('No') + return + elif i + 1 > m: + m = i + + print('Yes') + + +if __name__ == ""__main__"": + n = int(input()) + m = list(map(int, input().split())) + + main(n, m) +" +p02953,s532936944,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n - 1): + if h[i] - h[i + 1] > 1: + print('No') + break + + elif h[i] - h[i + 1] == 1: + if x == 1: + print('No') + break + else: + x = 1 + + + elif h[i] - h[i + 1] < 1: + x = 0 + +else: + print('Yes') +" +p02953,s623041164,Wrong Answer,"N = int(input()) +a = list(map(int,input().split())) + +s = 0 +for i in range(1,len(a)): + if a[i-1]>a[i]: + s+=1 + if a[i-1]-a[i]>1: + s+=2 + +if s>=2: + print(""No"") +else: + print(""Yes"")" +p02953,s228724841,Wrong Answer,"n = int(input()) +l_list = list(map(int, input().split())) +d = [l_list[i+1]-l_list[i] for i in range(n-1)] + +flag = False + +for i in d: + if i < -1: + print(""No"") + break + if i == -1 and flag == True: + print(""No"") + break + elif i == -1 and flag == False: + flag = True +else: + print(""Yes"") +" +p02953,s857651145,Wrong Answer,"n=int(input()) + +h=list(map(int,input().split())) +if h[-1]!=1: + print(""Yes"") +else: + print(""No"") +" +p02953,s505851471,Wrong Answer,"A = int(input()) +B = list(map(int,input().split())) +now = B[0] +for i in range(A-1): + if now < B[i+1]-1: + print(""No"") + exit() + if now < B[i+1]: + now = B[i+1] +print(""Yes"")" +p02953,s739326408,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + exit() + +flag = True +for i in range(N-1, -1, -1): + + if H[i] >= H[i-1]: + pass + elif H[i] + 1 == H[i-1]: + H[i-1] -= 1 + else: + flag = False + +print(H) +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s139587320,Wrong Answer,"from collections import Counter +a = int(input()) +num_list = list(map(int,input().split())) +flag = ""ok"" +num_o = 0 +for i in range(a-1): + if num_list[i] > num_o: + num_list[i] = num_list[i]-1 + num_o = num_list[i] + if num_list[i]-num_list[i+1] > 0: + flag = ""ng"" + break + +num_counter = Counter(num_list) +num_most = num_counter.most_common() +#if a == num_most[0][1] and a != 0: +# flag = ""No"" +if flag == ""ok"": + print(""Yes"") +" +p02953,s225966175,Wrong Answer,"N = int(input()) +H = [i for i in map(int,input().split())] +ok=1 +for i in range(N-1): + if H[i+1] < H[i]: + H[i] -= 1 + if H[i+1] < H[i] or H[i] < H[i-1]: + ok=0 + break + +if ok: + print('Yes') +else: + print('No')" +p02953,s077839826,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +m = h[0] +ans = 1 +r = 0 +for i in range(n): + if m>h[i]: + if m-h[i]==1: + if r==0: + r+=2 + else: + ans=0 + else: + ans=0 + if r>0: + r-=1 + m = h[i] +if ans==1: + print(""Yes"") +else: + print(""No"")" +p02953,s807261807,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +H_copy=H.copy() +for i in range(N-1): + if H[i]==H[i+1]+1: + if H_copy[i-1]==H_copy[i]+1: + print('No') + exit() + H[i]-=1 + elif H[i]-H[i+1]>=2: + print('No') + exit() +print(H) +print('Yes')" +p02953,s767130893,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +f = 0 +for i in range(len(li)-1): + if li[i] > li[i+1]: + li[i] = li[i] - 1 + if li[i] > li[i+1]: + f = 1 + break + +if f: + print('No') +else: + print('Yes')" +p02953,s399339974,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 +for i in range(n-1): + if h[i]>h[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s617572888,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +cngh=0 +bkh=0 +for i in range(n): + if bkh>h[i]: + if cngh!=h[i] and bkh==h[i]-1: + cngh=h[i]-1 + elif (cngh!=h[i] and bkh!=h[i]-1) or (cngh==h[i] and cngh!=h[i]): + ans=""No"" + break + bkh=h[i] +print(ans)" +p02953,s853603340,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + exit() + +flag = True +for i in range(N-1, -1, -1): + + if H[i] >= H[i-1]: + pass + elif H[i] + 1 == H[i-1]: + H[i-1] -= 1 + else: + flag = False + +# print(H) +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s259447606,Wrong Answer,"N=int(input()) +S=list(map(int,input().split())) +Z=[0]*N + +for i in range(1,N): + Z[i]=S[i]-S[i-1] + + +flug=False +for i in range(N): + + if Z[i]<=-1 and flug==False: + flug=True + elif Z[i]<=-1 and flug==True: + print(""No"") + exit() +print(""Yes"")" +p02953,s165740421,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +h.append(1001001001) +can = True +for i in range(n): + if h[i] > h[i + 1]: + h[i] -= 1 +for i in range(n): + if h[i] > h[i + 1]: + can = False + break +if can: + print('Yes') +else: + print('No')" +p02953,s069405007,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +lis = list() +for i in range(len(H)-1): + if H[i] - H[i+1] < -1: + H[i+1] = H[i+1] - 1 + lis.append(1) + else: + lis.append(0) + +if all(lis): + print(""Yes"") +else: + print(""No"")" +p02953,s734648480,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +flg = 1 +for i in range(N-1): + if H[i] - 1 > H[i+1]: + flg = 0 + break + elif H[i] - 1 == H[i+1]: + if i == 0: + H[i] -= 1 + continue + if H[i-1] > H[i] - 1: + flg = 0 + break + H[i] -= 1 +if flg == 1: + print('Yes') +elif flg == 0: + print('No')" +p02953,s129472910,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +ans = 'Yes' +for i in range(1, N): + if H[i-1] <= H[i]: continue + elif H[i-1] == H[i] + 1: H[i-1] -= 1 + else: + ans = 'No' + break + +for i in range(N): + if H[i-1] > H[i]: + ans = 'No' + break + +print(ans)" +p02953,s593844072,Wrong Answer,"# Problem C - Build Stairs + +# input +N = int(input()) +h_list = list(map(int, input().split())) + +# initialization +is_ok = True + +if N>1: + tmp_max = h_list[-1] + for i in range(N-2, -1, -1): + if h_list[i]>tmp_max: + h_list[i] -= 1 + if not h_list[i]<=tmp_max: + is_ok = False + break + +# output +if is_ok: + print(""Yes"") +else: + print(""No"") +" +p02953,s545384032,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +if N>1: + for i in range(N-1): + if H[i]<=H[i+1]-1: + H[i+1]-=1 + if H[i]>H[i+1]: + print('NO') + exit() + print('YES') +else: + print('YES')" +p02953,s811088472,Wrong Answer,"import sys +N = int(input()) +h = list(map(int, input().split())) +count = 0 + +for i in range(1, N-1): + diff = h[i+1] - h[i] + if diff == -1: + count += 1 + if h[i] == h[i-1]: + print('No') + sys.exit() + elif diff < -1: + print('No') + sys.exit() + if count > 1: + print('No') + sys.exit() +print('Yes') + + +" +p02953,s303258988,Wrong Answer,"n = int(input()) +l = list(map(int, input().split())) +if n>2: + for i in reversed(range(1,n)): + if l[i] 1: + print(""No"") + break +print(""Yes"")" +p02953,s535218272,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +for i in range(n-1): + if h[i]-h[i+1]>1: + ans=""No"" + break +print(ans)" +p02953,s428317913,Wrong Answer,"import numpy as np +import sys +n = int(input()) +h = np.array(list(map(int, input().split()))) +ans = ""No"" +for i in range(n-1): + dif = h[i] - h[i+1] + if dif > 1: + print(ans) + sys.exit() + elif dif == 1: + h[i] -= 1 + +max_h = 0 +for i in range(1, n): + max_h = max(max_h, h[i-1]) + dif = h[i] - max_h + if dif >= 0: + print(ans) + sys.exit() +ans = ""Yes"" +print(ans)" +p02953,s281517681,Wrong Answer,"n = int(input()) + +l = list(map(int,input().split())) + +diff_list = [] + +for i in range(n-1): + diff_list.append(l[i+1]-l[i]) + +for i in range(1,n-2): + if diff_list[i] < 0: + diff_list[i] += 1 + diff_list[i-1] -= 1 + +if len(diff_list) == 0: + print(""Yes"") + +for i in range(n-2): + if diff_list[i] < 0: + print(""No"") + break + print(""Yes"")" +p02953,s335422575,Wrong Answer,"import numpy as np +n = int(input()) +h = np.array([int(i) for i in input().split()]) +diff = np.diff(h) +flag = True +for i in diff: + if i < -1: + flag = False + break + elif i > 0: + flag = True + elif i == -1: + if not flag: + break + flag = False +print('Yes') if flag else print('No')" +p02953,s679951833,Wrong Answer,"a = int(input()) +b = list(map(int,input().split())) +c = b[0] +d = 0 +for i in range(a-1): + if c - 1 <= b[i+1]: + c = b[i+1] + d += 1 +if d == a-1: + print(""Yes"") +else: + print(""No"") + +" +p02953,s807610258,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +ans = 1 +for i in range (n-1): + if (h[i]-h[n-1] >= 2): + ans = 0 + break + +if (ans == 1): + print(""Yes"") + +else : + print(""No"")" +p02953,s333800226,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +if n==1: + print('Yes') + exit() +for i in range(n-2): + if h[i+1]-h[i]<=1: + continue + else: + print('No') + exit() +print('Yes')" +p02953,s964833894,Wrong Answer,"n = int(input()) +H = list(map(int, input().split())) + +h0 = H[0] +for i in range(1, n): + h = H[i] + if h <= h0: + H[i-1] = h0-1 + h0 = h + +flg = True +h0 = H[0] +for h in H[1:]: + flg &= h0 <= h + h0 = h +if flg: + print('Yes') +else: + print('No')" +p02953,s487484932,Wrong Answer,"n = int(input()) +H = [0] + list(map(int, input().split())) +pre_d = 1 +for i in range(n-1): + d = H[i+1] - H[i] + if d >= 1: + continue + if d == 0: + continue + if d == -1: + if pre_d >= 1: + H[i] -= 1 + else: + print(""No"") + break + if d <= -2: + print(""No"") + break +else: + print(""Yes"")" +p02953,s169030422,Wrong Answer,"def do(): + k=0 + a=int(input()) + l=list(map(int,input().split())) + for i in range (a-1): + if l[i]-l[i+1]>=2: + return ""No"" + if l[i]-l[i+1]==1: + k+=1 + else: + k=0 + if k>=2: + return ""No"" + else: + return ""Yes"" + +print(do())" +p02953,s870968853,Wrong Answer,"N = int(input()) +A = list(map(int, input().split())) +if N == 1: + print(""Yes"") +else: + k = 0 + for i in range(N -1): + if (A[i] - A[i+1]) >= 2: + k += 1 + if k < 1 and (A[N-1] - A[i]) >1: + print(""Yes"") + else: + print(""No"")" +p02953,s839996070,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +num = 0 +for i in range(N-1): + if H[i] > H[i+1]: + H[i] -= 1 + +#print(H) + +for i in range(N-1): + if H[i] > H[i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s744830133,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +H[0]-=1 +for i in range(1,N-1): + if H[i]>H[i+1]: + H[i]-=1 + if H[i]>H[i+1]: + print('No') + exit() + elif H[i-1]>H[i]: + print('No') + exit() +print('Yes')" +p02953,s742272407,Wrong Answer,"n = int(input()) +H1 = list(map(int,input().split())) +H2 = list(map(lambda x: x - 1, H1)) + + +ans = ""Yes"" +prev = H2[0] +for i in range(1,n-1): + if H2[i] == prev+1: + prev += 1 + elif H2[i] > prev+1: + ans = ""No"" + break + +print(ans)" +p02953,s453131634,Wrong Answer,"import sys +N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1): + if H[i] - H[i+1] >= 2: + print(""No"") + sys.exit() + elif H[i] - H[i+1] == 1: + H[i] -= 1 + +for i in range(N-1): + if H[i] -H[i+1] >= 1: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s952307167,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +h = [x-1 if x != 1 else 1 for x in h] + +for i in range(n-1): + if h[i+1] < h[i]: + print('No') + quit() + +print('Yes')" +p02953,s754008800,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +ans = ""Yes"" +num_max = 0 +for i in range(1,N): + if H[i] < num_max: + ans = ""No"" + break + if H[i] >= H[i-1]: + ans = ""Yes"" + elif H[i] >= H[i-1] -1: + ans = ""Yes"" + H[i-1] -= 1 + else: + ans = ""No"" + break + num_max = max(num_max,H[i - 1]) +print(ans)" +p02953,s884178238,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +FL=False +Fx=-1 +for i in range(n-1): + if n==1: + break + if h[i]-h[i+1]==1: + if FL: + ans=""No"" + break + else: + FL=True + Fx=h[i] + elif h[i]-h[i+1]>1: + ans=""No"" + break + else: + if h[i]>=Fx: + FL=False +print(ans)" +p02953,s885259432,Wrong Answer,"N = int(input()) +H = [int(x) for x in input().split()][::-1] +b = int(10e9) + 1 +for h in H: + if h >= b + 2: + print('No') + exit() + b = min(h, b - 1) +print('Yes') +" +p02953,s394118129,Wrong Answer,"import sys +n=int(input()) +h=list(map(int,input().split())) +if n==1: + print(""Yes"") + sys.exit() +h[0]-=1 +for i in range(1,n-1): + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + h[i]-=1 + if h[i-1]<=h[i]<=h[i+1]: + pass + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s569661518,Wrong Answer,"n=int(input()) +H=list(map(int,input().split())) +ans='Yes' +for i in range(1,n-1): + if H[i]H[i+1]: + ans='No' + break + +print(ans)" +p02953,s255139827,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n - 1): + if h[i] > h[i + 1]: + h[i] -= 1 + if h[i] > h[i + 1]: + print(""No"") + exit() + +for i in range(n - 1): + if h[i] > h[i + 1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s546446944,Wrong Answer,"n=int(input()) + +h=[int(x) for x in input().split()] +m=h[0] +for i in range(n): + #print(c,-i) + if h[i]>=m-1: + print(""No"") + exit() + m=max(m,h[i]) +print(""Yes"") +" +p02953,s698811190,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +check = 0 +mx = H[0] +m = max(H) +for i in range(0,N-1): + mx = max(mx,H[i]) + if(H[i]-H[i+1] > 2): + check = 1 + +if(m - H[N-1] >= 2): + check = 1 + +if(check == 1): + print(""No"") +else: + print(""Yes"")" +p02953,s063765792,Wrong Answer,"N=int(input()) +H=list(map(int, input().split())) + +for i in range(N-1): + #print(i,H[i],H[i+1]) + if H[i]+1==H[i+1]: + H[i+1]-=1 + elif H[i]<=H[i+1]: + continue + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s697077464,Wrong Answer,"import sys +#import numpy as np +import math +from fractions import Fraction +import itertools + +input=sys.stdin.readline + +n=int(input()) +a=list(map(int,input().split())) +s=set() +for i in range(n-1): + if a[i]>1+a[i+1]: + print(""No"") + exit() + elif a[i]==a[i+1]+1: + a[i]-=1 + s.add(i) +for i in range(n-1): + if a[i]>a[i+1] and i in s: + print(""No"") + exit() +print(""Yes"") +" +p02953,s326241589,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +safe = True +for i in reversed(range(1,N)): + if H[i] <= H[i-1]: + H[i] +=1 +for i in range(N-1): + if H[i] > H[i+1]: + safe = False + break +print('Yes' if safe else 'No')" +p02953,s733206889,Wrong Answer,"n = int(input()) +stair = list(map(int, input().split())) +top = max(stair) +if stair.index(top) == n-1: + print(""Yes"") + exit() +low = min(stair[stair.index(top):]) +print(low) +if top - low > 1: + print(""No"") +else: + print(""Yes"")" +p02953,s337639790,Wrong Answer,"N = int(input()) + +h = [int(x) for x in input().split()] +x = h[0] +i = 1 +k = 0 +for _ in [0]*(N-1): + y = h[i] + i += 1 + if (y - x == -1) and k == 1 : + print('No') + exit() + elif y - x == -1: + x = y + k = 1 + elif y - x >= 0: + x = y + k = 0 + else: + print('No') + exit() + +print('Yes') + +" +p02953,s257463900,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +count=0 +for i in range(n-1): + if h[i+1]-h[i]>=2: + print(""No"") + count+=1 + break + elif h[i]-h[i+1]==1: + h[i]-=1 + elif h[i+1]-h[i]==0: + continue +if count==0: + print(""Yes"")" +p02953,s717115660,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +# sv = h[n-1] +ok = True +for i in range(1, n): + # if h[i] - sv + 1 >= 2: + # ok = False + if h[i] - h[i-1] < 0: + ok = False +if ok: + print('Yes') +else: + print('No')" +p02953,s740898138,Wrong Answer,"import sys +N=int(input()) + +H=[int(x) for x in input().rstrip().split()] +flag=0 +mi=-1 +for i in range(N-1): + mi=max(H[i],mi) + if H[i]<=H[i+1] and mi<=H[i]: + + continue + elif H[i+1] H[i]: + print('NO') + exit() + + H[i] = max(H[i-1], H[i] - 1) + +print('YES') +" +p02953,s694793338,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +# H[N-2],H[N-3],...,H[0]について +for i in range(N - 2, -1, -1): + if H[i] > H[-1] + 1: + print(""No"") + exit() +print(""Yes"") +" +p02953,s341402690,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(1,n): + if h[i-1] > h[i] + 1: + print(""No"") + exit() +print(""Yes"")" +p02953,s348106955,Wrong Answer,"N = int(input()) +H = [int(x) for x in input().split()] + +ans = ""Yes"" +for i in range(N - 1): + if H[i] <= H[i+1]: + continue + elif H[i] - 1 <= H[i + 1] and H[i] - 1 >= H[i - 1]: + H[i] -= 1 + else: + ans = ""No"" + break +print(ans)" +p02953,s255608359,Wrong Answer,"N = int(input()) + +h = [int(x) for x in input().split()] +x = h[0] +i = 1 +k = 0 +for _ in [0]*(N-1): + y = h[i] + i += 1 + if (y - x == -1) and k == 1 : + print('No') + exit() + elif y - x == -1: + x = y + k = 1 + elif y - x >= 0: + x = y + k = 0 + else: + print('No') + exit() + +print('Yes') + +" +p02953,s464505246,Wrong Answer,"input() +H = [int(i) for i in input().rstrip().split(' ')] +N = len(H) + +for i in range(0,N): + a = H[i] + b = H[i - 1] if i > 0 else 0 + n = H[i + 1] if i < N -1 else 10**9 + #print(i,""#"",b,a,n) + if n == a - 1: + if b >= a: + print(""No"") + break + else: + H[i] -= 1 + elif n < a - 1: + print(""No"") + break +else: + print(""Yes"") +#print(H)" +p02953,s848534705,Wrong Answer,"def resolve(): + N = int(input()) + H = list(map(int, input().split())) + + for i in range(N-1): + if H[i] <= H[i+1]: + pass + elif H[i] - 1 <= H[i+1]: + H[i] = H[i]-1 + else: + pass + + if H != sorted(H): + print('No') + else: + print('Yes') + + return +resolve()" +p02953,s502427097,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +flag = True +for i in range(n-1): + if h[i] - h[i+1] == 1: + h[i] -= 1 + if h[i-1] > h[i]: + print('No') + flag = False + break + elif h[i] - h[i+1] >= 2: + print('No') + flag = False + break +if flag: + print('Yes')" +p02953,s520343261,Wrong Answer,"N=int(input()) +*H,=map(int,input().split()) + +i=0 +sm=[0]*(N-1) +while i+1<=N-1: + sm[i]=min(H[i+1]-H[i],0) + i+=1 + +print('YNeos'[sum(sm)<=-2::2])" +p02953,s758001963,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +f = True +for i in range(n-2): + if h[i] > h[i+1] > h[i+2]: + f = False + break + if h[i] > h[i+1]: + h[i]-=1 + if h[i] > h[i+1]: + f = False + break +if f: print('Yes') +else: print('No')" +p02953,s204482663,Wrong Answer,"n = int(input()) +hs = [int(elem) for elem in input().split()] + +res = [] +flag = 0 +for i, h in enumerate(hs): + if i == 0 : + res.append(0) + else: + if res[-1] < 0: + if (h - hs[i-1]) < 0: + flag = 1 + break + else: + if (h - hs[i-1]) < -1: + flag = 1 + break + else: + res.append(h - hs[i-1]) + +if flag == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s286797581,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +for i in range(1,n): + if h[i-1]-h[i]==1: + h[i-1]=h[i-1]-1 + if h[i-1]-h[i]>1: + ans=""No"" + break +print(ans)" +p02953,s620271533,Wrong Answer,"N = int(input()) +H = [int(h) for h in input().split()] + +is_clear = True +for n in range(1, N): + if n != N-1: + if H[n] - H[n+1] == 1: + H[n] -= 1 + elif H[n] - H[n+1] > 1: + is_clear = False + break + if H[n] < H[n-1]: + is_clear = False + break + +if is_clear: + print(""Yes"") +else: + print(""No"")" +p02953,s619766045,Wrong Answer,"import numpy as np +N = int(input()) +H = np.array(list(map(int,input().split()))) +D = np.diff(H,n=1) +if len(D[D == -1]) <= 1 and len(D[D < -1]) == 0: + print('Yes') +else: + print('No')" +p02953,s268288945,Wrong Answer,"import sys + +n=int(input()) +h=list(map(int,input().split())) +be=h[0] + +for i in range(n): + if h[i]-be==1 or h[i]-be==2: + be=h[i]-1 + continue + + if h[i]=2: + print(""No"") + exit() +print(""Yes"")" +p02953,s136658032,Wrong Answer,"n=int(input()) +h =list(map(int,input().split())) +if n ==1: + print('Yes') + exit() +for i in range(n-1): + if h[i]-1 >= h[i+1]: + h[i] -=1 +if h == sorted(h): + print('Yes') + +else: + print('No')" +p02953,s248405930,Wrong Answer,"a=int(input()) +b=list(map(int,input().split())) +for i in range(a-1): + if b[i]-1>b[i+1]: + print('No') + exit() +print('Yes')" +p02953,s547003177,Wrong Answer,"n = int(input()) +h = list( map(int,input().split()) ) + +ck = True +for i in range(n-1): + if h[i] > h[i+1]: + h[i] -= 1 + if h[i] > h[i+1]: + ck = False + break + +print('Yes' if ck else 'No')" +p02953,s682525534,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +flg = 0 +ans = ""Yes"" + +for i in range(N-1): + if H[i] >= H[i+1]: + H[i] -= 1 + +for j in range(N-1): + if H[j] > H[j+1]: + ans = ""No"" + +print(ans)" +p02953,s058401649,Wrong Answer,"N = int(input()) +Hlist = list(map(int,input().split())) +sign = 1 +Answer = 'Yes' +for i in range(len(Hlist)-1): + H1 = Hlist[i] + H2 = Hlist[i+1] + if H1 > H2: + if H1 - H2 == 1 and sign == 1: + Hlist[i] -= 1 + sign =0 + else: + Answer = 'No' + break + else: + sign = 1 +print(Answer)" +p02953,s578114657,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + + +for i in range(n-1): + if h[i+1] < h[i]: + h[i] -= 1 + +ans = sorted(h) +if ans == h: + print('Yes') +else: + print('No') +" +p02953,s049983938,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = True +lis = {} +for i in H: + if i in lis: + lis[i] += 1 + else: + lis[i] = 1 +mine = min(H) +times = lis[mine] +for i in range(N): + if mine < H[i]-1: + ans = False + break + else: + if H[i] == mine: + times -= 1 + if times == 0 and i != N-1: + del lis[mine] + mine = next(iter(lis)) + times = lis[next(iter(lis))] +if ans: + print(""Yes"") +else: + print(""No"")" +p02953,s633373768,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +if len(h) == 1: + print(""Yes"") +elif h[0] >= h[1] + 2 or h[-2] >= h[-1] + 2: + print(""No"") +else: + for i in range(n-2): + if h[i] >= h[i+2] + 2: + print(""No"") + break + else: + print(""Yes"")" +p02953,s138292976,Wrong Answer,"import sys +n=int(input()) +h=list(map(int,input().split())) +h[0]-=1 +for i in range(n-1): + if h[i]<=h[i+1]: + pass + else: + h[i]-=1 + if h[i]<=h[i+1]: + pass + else: + print(""No"") + sys.exit() +print(""Yes"")" +p02953,s852314871,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +flag = True +reach = False + +for n in range(N - 1): + if H[n] > H[n + 1]: + if H[n] - 1== H[n + 1] and reach == False: + reach = True + else: + flag = False +if flag: + print(""Yes"") +else: + print(""No"")" +p02953,s406852997,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +ans = 'Yes' + +for i in range(n-1): + if n == 1: + break + elif i == n-2: + if -1 <= h[i+1] - h[i]: + continue + else: + ans = 'No' + else: + if -1 <= h[i+1] - h[i] <= 1: + continue + else: + ans = 'No' + break + +print(ans)" +p02953,s541412947,Wrong Answer,"n = int(input()) +H = list(map(int, input().split())) + +for i in range(n - 1, 0, -1): + if H[i] - H[i - 1] == 2: + H[i] -= 1 + elif H[i - 1] - H[i] == 1: + H[i - 1] -= 1 + +ans = ""Yes"" +for i in range(1, n): + if not(0 <= H[i] - H[i - 1] <=1): + ans = ""No"" + +print(ans)" +p02953,s921301563,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +if len(h) == 1: + print(""Yes"") +elif h[0] >= h[1] + 2: + print(""No"") +else: + for i in range(n-2): + if h[i] >= h[i+2] + 2: + print(""No"") + break + else: + print(""Yes"")" +p02953,s144976118,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +ans = '' +for i in range(1, n -1): + if i + 1 != n - 1: + if -1 <= h[i] - h[i - 1] and -1 <= h[i + 1] - h[i]: + next + else: + ans = 'No' + break + else: + if h[i + 1] >= h[i] and -1 <= h[i] - h[i - 1]: + next + else: + ans = 'No' + break +if ans == '': + ans = 'Yes' +print(ans)" +p02953,s241738560,Wrong Answer,"N = int(input()) +h = list(map(int,input().split())) + +if N == 1: + pass +elif N==2: + if h[0] <= h[1]: + pass + else: + print('No') + exit() +elif N >= 3: + for i in range(N-2): + if (h[i+1] > h[i+2]) and (h[i]-1 >= h[i+1]) : + print('No') + exit() + elif h[i] >= h[i+1]+2: + print('No') + exit() +print('Yes')" +p02953,s765431071,Wrong Answer,"n = int(input()) +h = list( map(int,input().split()) ) + +m = -1 +ck = False +for i in range(1,n): + if h[i] < h[i-1]: + h[i-1] -= 1 + + if m == -1: + m = h[i-1] + else: + if h[i-1] < m: + break + + if h[i] < h[i-1]: + break +else: + ck = True + +print('Yes' if ck else 'No')" +p02953,s972296487,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans='Yes' +h_max=h[0] +for i in range(1,n): + if h_max+1>h[i]: + break +# print(h_max,h[i],ans) + elif h_max+1==h[i]: + h_max=h[i] +# print(h_max,h[i],ans) + else: + ans='No' +# print(ans) +print(ans)" +p02953,s762961324,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +if N == 1: + print('Yes') + exit() +if N == 2: + if H[0] - H[1] > 1: + print('No') + exit() + else: + print('Yes') + exit() +for i in range(1,N-1): + if H[i-1] < H[i] and H[i] > H[i+1]: + H[i] -= 1 +for i in range(1,N): + if H[i-1] > H[i]: + print('No') + exit() +print('Yes')" +p02953,s209192842,Wrong Answer,"def main(n: int, h: list): + _max = h[0] + + for h in h: + if _max == h: + continue + + if (h - _max) == 1: + _max = h + elif (h - _max) >= 2: + print(""No"") + return + + print(""Yes"") + + +if __name__ == ""__main__"": + n = int(input()) + h = list(map(int, input().split())) + + main(n, h) +" +p02953,s997909501,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +can = True + +for i in range(1, n): + if h[i] - h[i - 1] > 1: + can = False + +print(""Yes"" if can else ""No"") +" +p02953,s656475408,Wrong Answer,"# C - Build Stairs + +n = int(input()) +h = list(int(x) for x in input().split()) + +ans = 'Yes' +for i in range(1, n): + if h[i-1]-h[i]>1: + ans = 'No' + break + if i>2 and h[i-2]>h[i-1] and h[i-1]>h[i]: + ans = 'No' + break + +print(ans)" +p02953,s514241402,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +ht=[h[0],h[0]] + +ans=""Yes"" +for i in h: + if i in ht: + pass + elif i - ht[0] == 1: + ht[1] = ht[0] + ht[0] = i + elif i - ht[0] == 2: + ht[0] = ht[1] = i + else: + ans=""No"" + break + +print(ans)" +p02953,s348427278,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +h_new = [] +h_new.append(h[0]-1) + +for i in range(1, n-1): + if h[i+1] < h[i]: + h_new.append(h[i]-1) + else: + h_new.append(h[i]) +h_new.append(h[-1]) + +print(h_new) +cnt = 0 +for i in range(n-1): + if h_new[i] > h_new[i+1]: + print('No') + exit() + else: + cnt += 1 + +if cnt == len(h_new)-1: + print('Yes')" +p02953,s644990994,Wrong Answer,"n = input() + +num = list(map(int, input().split())) +jadge = ""true"" + +for i in range(len(num) - 1): + if num[i] > num[i + 1]: + num[i] = num[i] - 1 + if num[i] < num[i - 1]: + jadge = ""false"" + break + elif num[i] > num[i + 1]: + jadge = ""false"" + break + else: + jadge = ""true"" + else: + continue + +if jadge == ""true"": + print(""Yes"") +else: + print(""No"")" +p02953,s109673519,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +mx = 0 +for i in range(n): + if h[i] - mx > 1: + print('No') + exit() + mx = max(mx, h[i]) +print('Yes')" +p02953,s976883451,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +for i in range(N-1): + if H[i]==H[i+1]+1: + H[i]-=1 + if H[i]=2: + print('No') + exit() +print('Yes')" +p02953,s019866620,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +c=0 +for i in range(1,n): + if h[i-1]-h[i]==1: + if c==0: + h[i-1]=h[i-1]-1 + c=1 + continue + elif c==1: + ans=""No"" + break + if h[i-1]-h[i]>1: + ans=""No"" + break +print(ans)" +p02953,s848849403,Wrong Answer,"N = int(input()) +H = [int(x) for x in input().split()] + +for i in range(N-1): + if H[i] >= H[i+1]: + H[i+1] += 1 + +flg=True +for i in range(N-1): + if H[i] > H[i+1]: + flg=False + break + +ans = 'Yes' if flg else 'No' +print(ans)" +p02953,s003755378,Wrong Answer,"n = int(input()) +h = [1] +h += list(map(int, input().split())) +hm = list(map(lambda x: x - 1, h)) +x = [] +for i in range(1, n + 1): + if h[i] > h[i - 1]: + x.append(hm[i]) + else: + x.append(h[i]) + +print(""Yes"") if max(x) == x[-1] else print(""No"") +" +p02953,s436241961,Wrong Answer,"n = int(input()) +a = list(map(int, input().split())) + +flag = True +for i in range(n-1): + if a[i] > a[i+1]: + a[i]-=1 + +for i in range(n-1): + if a[i] > a[i+1]: + flag = False + break + +print(""Yes"") if flag else print(""No"") +" +p02953,s920301411,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(n-1): + if h[n-1-i] < h[n-1-i-1]: + h[n-1-i-1] -= 1 +print(h) +for i in range(1,n): + if h[i] < h[i-1]: + print('No') + exit() + +print('Yes') + " +p02953,s681488652,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 +h[n-1]-=1 +for i in range(n-1): + if h[i]>h[i+1]: + print(""No"") + quit() +print(""Yes"")" +p02953,s324051833,Wrong Answer,"N = int(input()) +H = [int(i) for i in input().rstrip().split(' ')] + +for i in range(0,N): + a = H[i] + b = H[i - 1] if i > 0 else 0 + n = H[i + 1] if i < N -1 else 10**9 + #print(b,a,n) + if n == a - 1: + if b == a: + print(""No"") + break + else: + H[i] -= 1 + elif n < a - 1: + print(""No"") + break +else: + print(""Yes"")" +p02953,s657978051,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +last = h[-1] +p = 'Yes' +t = h[0] +for i in h: + if i > last + 1 or t > i: + p = 'No' + t = i +print(p) +" +p02953,s738078438,Wrong Answer,"n=int(input()) +hlis=list(map(int,input().split())) +ans=1 +for i in range(n-1): + if hlis[i]>hlis[i+1]: + if hlis[i]-hlis[i+1]>1: + ans=0 + elif i>0 and hlis[i-1]>hlis[i]: + ans=0 + print(i,ans) +print(""Yes"" if ans==1 else ""No"")" +p02953,s669272278,Wrong Answer,"N = int(input()) +H = [int(i) for i in input().split()] +# N = 5 +# H = [1, 2, 1, 1, 3] +# N = 4 +# H = [1, 3, 2, 1] +# N = 5 +# H = [1, 2, 3, 4, 5] +# N = 1 +# H = [1000000000] +ret = True +prev = H[0] +peek = 0 +for i in range(1, N - 1): + peek = H[i + 1] + h = H[i] + if h > peek: + h -= 1 + # print(prev, H[i], h, peek) + if h < prev: + ret = False + break + prev = h +print(""Yes"" if ret else ""No"") +" +p02953,s656905115,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +flag = 0 +for i in range(N - 1): + if H[i] > H[i+1] + 1 or H[i]+2 <= H[i+1]: + flag += 1 +if flag == 0: + print('Yes') +else: + print('No')" +p02953,s509870052,Wrong Answer,"N = int(input()) +A = list(map(int, input().split())) +if N == 1: + print(""Yes"") +else: + k = 0 + for i in range(N -1): + if (A[i] - A[i+1]) >= 2: + k += 1 + if k < 1 and (A[i] - A[N-1]) <=1: + print(""Yes"") + else: + print(""No"")" +p02953,s095661952,Wrong Answer,"N = int(input()) + +List = list(map(int,input().split())) + +H = 0 +ck = 0 + +for i in range(N): + a = List[i] + if a-1 >= H: + H = a-1 + else: + ck = 1 + +print(""Yes"" if ck == 0 else ""No"")" +p02953,s827383026,Wrong Answer,"n=int(input()) +H=list(map(int,input().split())) +ans='No' + +for i in range(n-1): + if H[i]H[i+1]+1: + ans='No' + break + +print(ans)" +p02953,s057562131,Wrong Answer,"n = int(input()) +a = list(map(int, input().split())) +for i in range(1, n): + if a[i] - a[i-1] > 1: + print('No') + break +else: + print('Yes') +" +p02953,s723535868,Wrong Answer,"n=int(input()) +s=list(map(int,input().split())) +ans=0 +for i in range(n-1): + if not s[i]-1<=s[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s868176017,Wrong Answer,"n = int(input()) +h = [int(e) for e in input().split()] +flg = ""Yes"" +for i in range(n-1): + h[i] -= 1 + if h[i+1] <= h[i]: + flg = ""No"" + break +print(flg) + + + + +" +p02953,s691753151,Wrong Answer,"N = int(input()) +boxes = list(map(int,input().split())) +max_num = 0 +prev = 0 +for box in boxes: + if not (box - prev >= 0): + if not (box - prev == -1 and prev-1 >= max_num): + print(""No"") + exit() + if prev - max_num > 0: + max_num = prev + prev = box +print(""Yes"")" +p02953,s075400467,Wrong Answer,"n=int(input()) +list=list(map(int,input().split())) +if list[0]==min(list) and (list[0]= 2: + flg = 0 + break + if H[i] - H[i+1] == 1: + H[i] -= 1 + if i == 0: + continue + if H[i-1] > H[i]: + flg = 0 + break +if flg == 1: + print('Yes') +else: + print('No')" +p02953,s539497462,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +h = h[::-1] +for i in range(n-1): + if h[i] == h[i+1]: + pass + elif h[i] == h[i+1] +1: + pass + elif h[i] == h[i+1] +2: + h[i+1] += 1 + elif h[i] == h[i+1] -1: + h[i + 1] -= 1 + else: + print(""No"") + exit() +print(""Yes"") +" +p02953,s907307290,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +a=0 +for i in range(N-1): + a=max(H[:i+1]) + if H[i] h[i + 2]: + if h[i] <= h[i + 1] - 1 and h[i + 1] - 1 <= h[i + 2]: + h[i + 1] -= 1 +for i in range(n - 1): + if h[i] > h[i + 1]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s100734521,Wrong Answer,"import sys +stdin = sys.stdin +from itertools import accumulate + +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(ns()) +na = lambda: list(map(int, stdin.readline().split())) + +n = ni() +h = na() +hpre = h[-1] +print(h[:-1][::-1]) +for hi in h[:-1][::-1]: + if hi <= hpre: + hpre = hi + elif hi == hpre + 1: + hpre = hi - 1 + else: + print(""No"") + quit() +print(""Yes"")" +p02953,s383639736,Wrong Answer,"n = int(input()) +A = list(map(int,input().split())) +for i in range(n-1): + if A[i+1]-A[i] >= -1: + if A[i+1] >= A[i]: + A[i+1] -=1 + else: + print('No') + exit() +print('Yes')" +p02953,s275970737,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +h = h[::-1] +for i in range(n-1): + if h[i] == h[i+1]: + pass + elif h[i] == h[i+1] +1: + pass + elif h[i] == h[i+1] +2: + h[i+1] += 1 + else: + print(""No"") + exit() +print(""Yes"") +" +p02953,s695323897,Wrong Answer,"n=int(input()) +a=list(map(int,input().split())) +frag=1 +frag2=1 +for i in range(n-1): + if a[i]-a[i+1]==1: + if frag2==1 and frag==1: + frag2=0 + elif frag2==0: + frag=0 + break + elif frag==2: + frag=0 + break + elif a[i]-a[i+1]>1: + frag=0 + break + elif a[i]==a[i+1]: + frag=2 + elif frag==2: + frag=1 +if frag!=0: + print('Yes') +else: + print('No')" +p02953,s326225249,Wrong Answer,"import numpy as np +n = int(input()) +h = np.array([int(i) for i in input().split()]) +diff = np.diff(h) +flag = True +current = -1 +for i, j in enumerate(diff): + if j < -1: + flag = False + break + elif j > 0: + flag = True + current = -1 + elif j == -1: + if not flag: + break + flag = False + current = i + else: + flag = True + current = i + if current == len(diff) - 1 and not flag: + flag = True +print('Yes') if flag else print('No')" +p02953,s529769805,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +f=1 +for i in range(n-2): + if h[i+1]-h[i]>1 and h[i+2]-h[i+1]<-1: + f=0 + break + if h[i+1]-h[i]<-1 or h[i+2]-h[i+1]<-1: + f=0 + break + if h[i+1]-h[i]==-1 and h[i+2]-h[i+1]==-1: + f=0 + break + +if f: + print(""Yes"") +else: + print(""No"")" +p02953,s695879814,Wrong Answer,"n=int(input()) +l=list(map(int,input().split())) +if n!=1: + m=l[0] + cnt=0 + for i in range(n): + if l[i]H[i+1]+1: + ans='No' + break + +print(ans)" +p02953,s908160145,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +yesno = 'Yes' +p=0 +for i in range(N-1): + if H[i] <= H[i+1]: + p=0 + elif H[i] - 1 == H[i+1]: + p += 1 + if p == 2 : + yesno = 'No' + break + else: + yesno = 'No' + break +print(yesno)" +p02953,s970232226,Wrong Answer,"n = int(input()) +h = [int(i) for i in input().split()] +for i in range(n - 1): + if h[i] > h[i+1]: + if h[i] == h[i+1] + 1: + h[i] -= 1 + else: + print(""No"") + exit() + +for i in range(n - 1): + if h[i] > h[i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s904960603,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 +for i in range(n-1): + if h[i]>h[i+1]: + print('No') + break +else: + print('Yes')" +p02953,s049945860,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +if H == 1: + print('Yes') + exit() + +if H == 2 and H[0] <= H[1]: + print('Yes') + exit() +elif H == 2 and H[0] > H[1]: + print('No') + exit() + +for i in range(1, N-1): + # print(H[i-1],H[i],H[i+1]) + if H[i-1] <= H[i] <= H[i+1] or H[i-1] <= H[i] - 1 <= H[i+1] or H[i-1] - 1 <= H[i] <= H[i+1] or H[i-1] - 1 <= H[i] - 1 <= H[i+1]: + pass + else: + print('No') + exit() + +print('Yes')" +p02953,s680917260,Wrong Answer,"import numpy as np +import sys +n = int(input()) +h = np.array(list(map(int, input().split()))) +ans = ""No"" +h[0] -= 1 +for i in range(n-1): + dif = h[i] - h[i+1] + if dif > 1: + print(ans) + sys.exit() + elif dif == 1: + h[i] -= 1 + +max_h = 0 +for i in range(1, n): + max_h = max(max_h, h[i-1]) + dif = h[i] - max_h + if dif < 0: + print(ans) + sys.exit() +ans = ""Yes"" +print(ans)" +p02953,s995113181,Wrong Answer,"n = int(input()) +H = list(map(int,input().split())) + +ans = ""Yes"" +c=0 +for i in range(n-1): + if H[i]-1>H[i+1] : + ans = ""No"" + break + elif H[i]>H[i+1] : + c+=1 + if c>=2 : + ans = ""No"" + break +print(ans)" +p02953,s812923385,Wrong Answer,"n=int(input()) +s=list(map(int,input().split())) +ans=0 +for i in range(n-1): + if s[i]-1>s[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s467349887,Wrong Answer,"#python3 +n=int(input()) +h=[int(i) for i in input().split()] + +ok = True +for i in range(n-1): + if not (h[i] <= h[i+1]): + ok = False + +if ok: + print('Yes') +else: + print('No')" +p02953,s909464892,Wrong Answer,"n=int(input()) +a=list(map(int,input().split())) +frag=1 +frag2=1 +for i in range(n-1): + if a[i]-a[i+1]==1: + if frag2==1: + frag2=0 + elif frag2==0: + frag=0 + break + elif frag==2: + frag=0 + break + elif a[i]-a[i+1]>1: + frag=0 + break + elif a[i]==a[i+1]: + frag=2 + elif frag==2: + frag=1 +if frag!=0: + print('Yes') +else: + print('No')" +p02953,s870182195,Wrong Answer,"from sys import stdin + +n = int(stdin.readline().rstrip()) +h = [int(x) for x in stdin.readline().rstrip().split()] + +for i in range(n): + if i == n-1: + if (h[i] < h[i-1]) and (h[i] != 1): + h[i] -= 1 + else: + if (h[i] > h[i+1]) and (h[i] != 1): + h[i] -= 1 + +print(""Yes"" if h == sorted(h, key=int) else ""No"")" +p02953,s947685452,Wrong Answer,"N = int(input()) +H = map(int,input().split()) +min = 0 +m = 0 +ans = 'Yes' +for i in H: + if m == 0: + m = i + continue + if m <= i + 1: + m = max(m,i - 1) + else: + ans = ""No"" + break +print(ans) +" +p02953,s928139369,Wrong Answer,"N = int(input()) +H = [int(x) for x in input().split()] + +for i in range(N-1): + if H[i] > H[i+1]: + H[i] -= 1 + +flg=True +for i in range(N-1): + if H[i] > H[i+1]: + flg=False + break + +ans = 'Yes' if flg else 'No' +print(ans)" +p02953,s183055299,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +maxm=h[0] +for i in range(1,n): + if maxm 1 or H[i] - H[i+1] > 1: + ans = ""No"" + break + print(ans) + +if __name__ == ""__main__"": + N = int(input()) + H = list(map(int, input().split())) + solve() +" +p02953,s860240301,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +# if max(h) - h[n - 1] > 1: +# print('No') +# exit(0) +if n == 1: + print('Yes') + exit(0) +else: + for i in range(n - 1 , 0): + if max(h[i - 1] - 1, 1) > h[i]: + print('No') + exit(0) + else: + h[i - 1] = max(h[i - 1] - 1, 1) + +print('Yes')" +p02953,s762889139,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int, input().split())) +tmp = 0 +cnt = 0 + +while tmp <= N-2: + if H[tmp] > H[tmp+1]: + cnt += 1 + if cnt >= 2: + print(""No"") + sys.exit() + tmp += 1 +print(""Yes"")" +p02953,s976755690,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +cnt = 0 +for i in range(N-1): + if(H[i] >= H[i+1]): + tmp = H[i] - 1 + if(tmp != H[i+1] or cnt > 0): + print('No') + sys.exit() + cnt += 1 +print('Yes') +" +p02953,s087722016,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +h[0]=h[0]-1 +for i in range(1,n): + try: + if h[i]-1>=h[i+1]: + h[i]=h[i]-1 + except IndexError: + pass +for i in range(n): + try: + if h[i]>h[i+1]: + print(""No"") + exit() + except IndexError: + pass +print(""Yes"")" +p02953,s746615139,Wrong Answer,"#!/usr/bin/env python3 + +n = int(input()) +h = list(map(int, input().split())) + +h.reverse() + + +ans = 0 +for i in range(1, len(h)): + if h[i-1]-h[i] >= 0: + continue + elif h[i-1]-h[i] == 0: + h[i] -= 1 + else: + print(""No"") + exit() + +print(""Yes"") +" +p02953,s614201282,Wrong Answer,"x=int(input()) +s=list(map(int,input().split())) +s[0]=max(0,s[0]-1) +for n in range(1,x): + if s[n]H[i+1]+1: + no = True + break + elif H[i]==H[i+1]+1: + H[i] -= 1 +#print(H) +print(['Yes','No'][no])" +p02953,s516623055,Wrong Answer,"n = int(input()) +x = list(map(int,input().split())) +y = [] +for i in range(n-1): + y.append(x[i]-x[i+1]) +count = 0 +for i in y: + if i >=1: + count+=1 +if count<=1: + print(""Yes"") +else: + print(""No"")" +p02953,s855660845,Wrong Answer,"n = int(input()) +high = list(map(int,input().split())) + +for x in range(n-1): + if high[x] - high[x+1] >= 2: + print(""No"") + break + elif high[x] - high[x+1] == 1: + high[x] = high[x] - 1 + +else: + new_high = list(sorted(high)) + if new_high == high: + print(""Yes"") + + else: + print(""No"") + " +p02953,s499288293,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +ht = h[0] +ans=""Yes"" +for i in h[:-1]: + if i - ht == 0: + ht = i + elif i - ht == 1: + ht = i-1 + else: + ans=""No"" + break + +print(ans)" +p02953,s753559022,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + + +h[0] -= 1 +for i in range(0, n-1): + if h[i] > h[i+1]: + print('No') + break + h[i+1] -= 1 +else: + print('Yes')" +p02953,s730651467,Wrong Answer,"n=int(input()) +arr=list(map(int,input().split())) +for i in range(n-1,0,-1): #列を後ろからみる + if arr[i]>arr[i-1]: #単調非減少になっていないとき、手前の要素の値を1減らす + arr[i-1]-=1 + if arr[i]>arr[i-1]: #1減らしても単調非減少にならないとき、答えはNo + print('No') + break +else: + print('Yes')" +p02953,s298612986,Wrong Answer,"import sys +input = sys.stdin.readline +N = int(input()) +a = list(map(int, input().split())) +for i in range(N - 1): + f = 1 + if a[i + 1] - a[i] < 0: + a[i] -= 1 + f = 0 + if a[i] - a[i + 1] < 0: + a[i + 1] -= 1 + f = 0 + if f: a[i] -= 1 +for i in range(N - 1): + if a[i + 1] < a[i]: + print(""No"") + exit(0) +print(""Yes"")" +p02953,s813991805,Wrong Answer,"n = int(input()) +s = list(map(int, input().strip().split("" ""))) + +flg = 0 + +for i in range(n-1): + if s[i] - s[i+1] >= 2 or (s[i-1] == s[i] and s[i] - s[i+1] >= 1): + print(""No"") + flg = 1 + break + elif s[i] - s[i+1] == 1: + s[i] = s[i] - 1 + +if flg == 0: + print(""Yes"") + + + " +p02953,s981217505,Wrong Answer,"n = int(input()) +h = [int(x) for x in input().split()] +ans = 'Yes' +for i in range(1, n): + if h[i-1] == h[i]: + pass + elif h[i-1] > h[i]-1: + ans = 'No' + break + elif h[i-1] == h[i]-1: + h[i] -= 1 +print(ans)" +p02953,s507709773,Wrong Answer,"N=int(input()) +H=list(map(int, input().split())) +ans = ""Yes"" +for i in range(N-1)[::-1]: + if H[i+1]=2: + return ""No"" + elif l[i]-l[i+1]==1: + k+=1 + else: + k=0 + if k>=2: + return ""No"" + else: + return ""Yes"" + +print(do())" +p02953,s191052396,Wrong Answer,"a = int(input()) +b = list(map(int,input().split())) +c = b[0] +d = 0 +e = 0 +for i in range(a-1): + if c - 1 <= b[i+1]: + c = b[i+1] + d += 1 +for i in range(a-2): + if b[i+2] - b[i] >= 2: + e += 1 +if d == a-1 and e == a-2: + print(""Yes"") +else: + print(""No"") + +" +p02953,s321251494,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +bl = True + +for i in range(N-1): + if H[i] - H[i+1] == 1: + if i < N-2 and H[i+1] - H[i+2] > 0: + bl = False + elif H[i] - H[i+1] > 1: + bl = False + +print('Yes' if bl else 'No')" +p02953,s447886718,Wrong Answer,"def main(): + n = int(input()) + h = list(map(int, input().split())) + for i in range(n-1): + if h[i] - h[i+1] > 1: + print('No') + return 0 + print('Yes') + +if __name__ == '__main__': + main()" +p02953,s894291177,Wrong Answer,"N = int(input()) +H = list(input().split()) + +F = ['T']*N +suc = True +for i in range(0,N-1): + if int(H[i]) > int(H[i+1]): + if int(H[i]) - int(H[i+1]) <= 1: + if F[i] == 'T': + F[i+1] = 'S' + else: + suc = False + break + else: + suc = False + break + +if suc: + print(""Yes"") +else: + print(""No"") +" +p02953,s963976368,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n-1): + if h[i+1]-h[i] < 0: + h[i] -= 1 +for i in range(n-1): + if h[i+1]-h[i] < 0: + print (""No"") + exit() +print (""Yes"")" +p02953,s618617960,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +FL=False +Fx=-1 +for i in range(n-1): + if n==1: + break + if h[i]-h[i+1]==1: + if FL: + ans=""No"" + break + else: + FL=True + Fx=h[i] + else: + if h[i]>=Fx: + FL=False +print(ans)" +p02953,s297868926,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i] + 1 >= h[i+1]: + pass + else: + exit(print('No')) + +print('Yes')" +p02953,s875446204,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +flag = False +min = 0 +for i in range(n-2): + min = h[i] + if h[i+1] < min -1: + flag = True + break + elif h[i+1] == min -1 and h[i+2] <= min-2: + flag = True + break + else: + pass + +if n ==2 : + if h[0] > h[1] +1: + flag = True + +if flag: + print('No') +else: + print('Yes')" +p02953,s020104078,Wrong Answer,"N = int(input()) +H = [int(x) for x in input().split()] +H2 = H.copy() +flg=True + +for i in range(N-1): + if H[i] - H[i+1] == 1: + H[i] -= 1 + H2[i+1] -= 1 + break + +for i in range(N-1): + if (H[i] - H[i+1] == 1) or (H2[i] - H2[i+1] == 1): + flg=False + break + +ans='Yes' if flg else 'No' +print(ans)" +p02953,s893132772,Wrong Answer,"n = int(input()) +H = list(map(int, input().split())) +flag = True +for i in range(n - 1): + if i <= n - 3: + if H[i] - H[i + 1] >= 2 or H[i] > H[i + 1] > H[i + 2]: + flag = False + else: + if H[i] - H[i + 1] >= 2: + flag = False + +print('Yes' if flag == True else 'No')" +p02953,s493705051,Wrong Answer,"a = int(input()) +num_list = list(map(int,input().split())) +flag = """" +for i in range(a-1): + if num_list[i]-1 <= num_list[i+1]: + flag = ""ok"" + else: + flag = ""ng"" +if flag == ""ok"": + print(""Yes"") +else: + print(""No"") +" +p02953,s036312105,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +if n == 1: + print('Yes') +for i in range(n-1): + if h[i]>h[i+1]+1: + print('No') + break + if i > 0: + if (h[i]-1==h[i-1]) or (h[i]==h[i-1]-1): + if h[i]==h[i+1]+1: + print('No') + break + if i == n-2: + print('Yes')" +p02953,s696219159,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +num=0 +for i in range(0,N-1): + if H[i]==H[i+1]+1: + H[i]=H[i]-1 + else: + H[i]=H[i] +for n in range(0,N-1): + if H[n]<=H[n+1]: + num=num+1 +if num==N-1: + print(""Yes"") +else: + print(""No"")" +p02953,s023086524,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +num = h[0] +for i in range(n-1): + if h[i+1] < h[i]: + h[i] -= 1 +for i in range(n-1): + if h[i+1] < h[i]: + print(""No"") + break +else: + print(""Yes"")" +p02953,s246019267,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +#b = list(map(int, input().split())) +flag = [0]*n +for i in range(n-1): + if h[i]-h[i+1] >= 1: + h[i] -= 1 + flag[i] = 1 + + +for i in range(n-1): + if h[i] > h[i+1]: + if h[i]-h[i+1] == 1 and flag[i] == 0: + h[i] -= 1 + else: + print(""No"") + exit() + +print(""Yes"") + +" +p02953,s966558675,Wrong Answer,"n=int(input()) +i= list(map(int, input().split())) +flag=0 +if n==1: + pass +else: + for j in range(n-1): + if i[j+1]H[n+1] and H[n]-1==H[n+1]: + H[n]-=1 + elif H[n]>H[n+1]: + print(""No"") + exit() + +if H!=sorted(H): + print(""No"") +else: + print(""Yes"")" +p02953,s101868740,Wrong Answer,"n=int(input()) +l=list(map(int,input().split())) +if(n==1): + print(""Yes"") +else: + if(l[0] a[i + 1] + 1): + print(""No"") + break +else: + print(""Yes"")" +p02953,s495963863,Wrong Answer,"n = int(input().rstrip()) +H = list(map(int,input().rstrip().split())) +for i in range(1,n): + if H[i-1]==H[i]-1: + H[i]-=1 + elif H[i-1]>H[i]: + print('No') + break +else: + print('Yes')" +p02953,s199085032,Wrong Answer,"n = int(input()) +a = list(map(int, input().split())) + +flag = True +for i in range(n-1): + if a[i] > a[i+1]: + a[i]-=1 + if a[i] > a[i+1]: + frag = False +if flag: + for i in range(n-1): + if a[i] > a[i+1]: + flag = False + +print(""Yes"") if flag else print(""No"") +" +p02953,s703281844,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +for i in range(n): + try: + if h[i]-1>=h[i+1]: + h[i]=h[i]-1 + except IndexError: + pass +for i in range(n): + try: + if h[i]>h[i+1]: + print(""No"") + exit() + except IndexError: + pass +print(""Yes"")" +p02953,s392124136,Wrong Answer,"import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +n, *h = map(int, read().split()) + +if len(h) == 1: + print('Yes') + exit() +l = [max(h[0]-1,1)] +for i in range(1, n): + if 1 <= h[i] - l[i - 1] <= 2: + l.append(h[i] - 1) + elif h[i] - l[i - 1] == 0: + l.append(h[i]) + else: + print('No') + exit() + +print('Yes')" +p02953,s221545613,Wrong Answer,"n = int(input()) +x = list(map(int,input().split())) +y = [] +for i in range(n-2): + y.append(x[i]-x[i+1]) +count = 0 +for i in y: + if i >=1: + count+=1 +if count<=1: + print(""Yes"") +else: + print(""No"")" +p02953,s550855974,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(N-1): + next = H[i+1] + if H[i] - next > 1: + print(""No"") + exit() + if H[i] - next == 1: + H[i] -= 1 + +for i in range(N-1): + if H[i] > H[i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s906368199,Wrong Answer,"N=int(input()) +S=list(map(int,input().split())) +Z=[0]*N + +for i in range(1,N): + Z[i]=S[i]-S[i-1] + + +flug=False +for i in range(N): + + if Z[i]<=-2: + print(""No"") + exit() + + elif Z[i]==-1 and flug==False: + flug=True + elif Z[i]==-1 and flug==True: + print(""No"") + exit() + +print(""Yes"")" +p02953,s958769362,Wrong Answer,"N = int(input()) +M = list(map(int,input().split())) + +ans = ""Yes"" +limit = 0 + +for i in range(N-1) : + c = M[i+1]-M[i] + if 0 <= c : + limit = M[i] + continue + elif c == -1 and limit <= M[i]-1: + limit = M[i]-1 + continue + else : + ans = ""No"" + break + +print(ans) +" +p02953,s823087572,Wrong Answer,"n,*h=map(int,open(0).read().split()) +for i in range(n-1)[::-1]: + if h[i+1]h[i+1]: + h[i]=h[i]-1 + except IndexError: + pass +for i in range(n): + try: + if h[i]>h[i+1]: + if h[i]>h[i+1]: + print(""No"") + exit() + except IndexError: + pass +print(""Yes"")" +p02953,s511157613,Wrong Answer,"import sys +N = int(input()) +H = input().split() +for i in range(N): + H[i] = int(H[i]) +H.reverse() + +for i in range(N-1): + if H[i] < H[i+1]: + H[i+1] = H[i+1]-1 + if H[i] > H[i+1]: + print('No') + sys.exit() +print('Yes') +" +p02953,s314631986,Wrong Answer,"N=int(input()) +h=list(map(int, input().split())) + +ans = 'Yes' + +for i in range(N-1): + if h[i] <= h[i+1]: + ans = 'Yes' + continue + print(i) + if h[i] <= (h[i+1]-1): + ans = 'Yes' + continue + else: + ans = 'No' + +print(ans) +" +p02953,s199702016,Wrong Answer,"n = int(input()) +num = list(map(int, input().split())) +left = num[0] +for i in num: + right = i + if 0 < abs(right-left) <= 1: + left = max(right, left) + elif right-left == 0: + left += 1 + else: + print(""No"") + exit() +print(""Yes"")" +p02953,s987930203,Wrong Answer,"# https://atcoder.jp/contests/abc136/tasks/abc136_c + +N = int(input()) +H_list = list(map(int, input().split())) + +past_H = 0 +can_substract = False +for i in range(N): + + if (past_H - H_list[i] > 1) or (past_H - H_list[i] == 1 and can_substract == False): + print('No') + exit() + + if past_H <= H_list[i]: + + if past_H == H_list[i]: + can_substract = False + else: + can_substract = True + + else: + can_substract = False + + past_H = H_list[i] + +print('Yes')" +p02953,s256545931,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +x = h[-1] +ans = ""Yes"" +for i in reversed(range(n - 1)): + hi = h[i] + if hi <= x: + pass + else: + if abs(x - hi) >= 2: + ans = ""No"" + else: + h[i] -= 1 +print(ans) +" +p02953,s194629564,Wrong Answer,"N = int(input()) +height = list(map(int,input().split())) +for i in range(N-1,0,-1): + print(i) + n = height[i] - height[i-1] + if n <= -2: + print(""No"") + exit() + elif n == -1: + height[i-1] -= 1 + +print(""Yes"")" +p02953,s314764266,Wrong Answer,"n=int(input()) +l=list(map(int,input().split())) +if n!=1: + m=l[0] + cnt=0 + for i in range(n-1): + if l[i]>l[i+1]+1: + print('No') + exit() + if l[i+1]= H[i+1]: + continue + else: + if H[i+1] - H[i] > 1: + check = False + break + else: + H[i+1] -= 1 + +if check: + print(""Yes"") +else: + print(""No"")" +p02953,s891850052,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = 1 +for i in range(N-1): + if H[i] > H[i+1]: + if H[i]-1 <= H[i+1]: + ans = 0 + break +print('Yes' if ans==1 else 'No')" +p02953,s904069186,Wrong Answer,"from collections import deque + +N = int(input()) +H = deque(map(float, input().split())) + +prev = H.popleft() + +if N == 1: + print('Yes') + exit() + +for i in range(N-2): + cor = H.popleft() + if prev - cor < -1: + print('No') + exit() + elif prev - cor == -1: + prev = cor -1 + else: + prev = cor + +cor = H.popleft() + +if cor - prev< 0: + print('No') + exit() + +print('Yes') +" +p02953,s840289188,Wrong Answer,"def main(): + N=int(input()) + H=list(map(int,input().split())) + s=0 + for i in range(N-1): + if H[i]>H[i+1] and H[i]-H[i+1]<2: + s+=1 + if H[i]-H[i+1]>=2: + print(""No"") + break + if H[i]<=H[i]: + s=s + if s>=2: + print(""No"") + else: + print(""Yes"") +main()" +p02953,s500375778,Wrong Answer,"n = int(input()) +H = list(map(int, input().split())) + +H[0] -= 1 +for i in range(1, n): + if H[i] < H[i-1]: + H[i] -= 1 + +if all(H[i-1] <= H[i] for i in range(1, n)): + print('Yes') +else: + print('No')" +p02953,s489187607,Wrong Answer,"def main(): + n = int(input()) + h = list(map(int, input().split())) + + pre = 0 + for i in range(n): + if h[i] >= pre + 1: + h[i] -= -1 + if h[i] == pre: + pass + if h[i] < pre: + print('No') + break + pre = h[i] + + print('Yes') + + +if __name__ == '__main__': + main()" +p02953,s881451977,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +for i in range(n-1): + if h[i+1]== h[i]+1: + h[i+1] -= 1 + elif h[i+1] < h[i]: + print('No') + break +else: + print('Yes')" +p02953,s646509458,Wrong Answer,"n=int(input()) +lst=list(map(int, input().split())) +for i in range(n-1): + if lst[i]>lst[i+1]: + lst[i]-=1 +if lst==sorted(lst): + print('Yes') +else: + print('No')" +p02953,s914811263,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +li.append(10**9+1) +f = 0 +if li[0] > li[1] + 1: + print(""No"") + exit() +elif li[0] - 1 == li[1]: + li[0] = li[0] - 1 +for i in range(1,n-1): + if li[i-1] <= li[i] and li[i] <= li[i+1]: + continue + elif li[i-1] <= li[i] - 1 and li[i] - 1 <= li[i+1]: + li[i] = li[i] - 1 + else: + print(""No"") + f = 1 + break +if f == 0: + print(""Yes"")" +p02953,s865507460,Wrong Answer,"n = int(input()) + +lis = list(map(int, input().split())) + +tmp = lis[0] +for i in range(1, n): + if tmp == lis[i]: + tmp = lis[i] + elif tmp == lis[i]-1: + tmp = lis[i] -1 + elif tmp <= lis[i]: + tmp = lis[i] + elif tmp >= lis[i] -1: + tmp = lis[i] -1 + else: + print(""No"") + exit() + +print(""Yes"")" +p02953,s474360020,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +li.append(10**9+1) +f = 0 +if li[0] > li[1] + 1: + print(""No"") + exit() +elif li[0] - 1 == li[1]: + li[0] = li[0] - 1 +for i in range(1,n-1): + if li[i-1] <= li[i] and li[i] <= li[i+1]: + continue + elif li[i-1] <= li[i] - 1 and li[i] - 1 <= li[i+1]: + li[i] = li[i] - 1 + else: + print(""No"") + f = 1 + break +if f == 0: + print(""Yes"") +print(li)" +p02953,s845353674,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +tmp = h[-1] +ans = 'Yes' + +for i in range(2,n+1): + print(tmp, h[-i],i) + if tmp - h[-i] == -1: + tmp = h[-i]-1 + elif tmp - h[-i] < -1: + ans = 'No' + break + else: + tmp = h[-i] + +print(ans)" +p02953,s619253892,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +flag = ""Yes"" +for i in range(1,n): + #print(h[i]) + if h[i] >= h[i-1]: #単調増加またはイコール + pass + + else: #減少してる + h[i-1] -= 1 + if h[i-2] > h[i-1]: + flag = ""No"" + break + elif h[i] < h[i-1]: + flag = ""No"" + break + else: + pass +print(flag) + + + + +" +p02953,s446570662,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n-1): + diff = h[i] - h[i+1] + if i == n-2: + if diff > 1 : + print(""No"") + exit() + else: + if abs(diff) > 1 : + print(""No"") + exit() +print(""Yes"")" +p02953,s279932229,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n - 1): + if h[i + 1] - h[i] < 0: + print(""No"") + exit() + elif h[i + 1] - h[i] == 1: + h[i + 1] -= 1 +print(""Yes"")" +p02953,s114052162,Wrong Answer,"#!/usr/bin/env python3 + +N = int(input()) +lst = [int(h) for h in input().split()] + +def judge(): + cnt = 0 + for i in range(N-1): + if lst[i+1] < lst[i] - 1: + return False + if lst[i+1] == lst[i] - 1: + cnt += 1 + if cnt >= 2: + return False + return True + +if judge(): + print('Yes') +else: + print('No') + +" +p02953,s196970694,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(n-1,0,-1): + if h[i] - 1 == h[i-1]: + h[i] = h[i]-1 + +for j in range(n-1): + if h[j] > h[j+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s118200564,Wrong Answer,"n = input() + +num = list(map(int, input().split())) +jadge = ""true"" + +for i in range(len(num) - 1): + if num[i] > num[i + 1]: + num[i] = num[i] - 1 + if num[i] < num[i - 1]: + jadge = ""false"" + else: + jadge = ""true"" + else: + continue + +if jadge == ""true"": + print(""Yes"") +else: + print(""No"")" +p02953,s131170881,Wrong Answer,"n = int(input()) +s = list(map(int,input().split())) + +M = 0 +for i in range(n-1): + if s[i] > s[i+1]: + s[i] -= 1 + if M > s[i]: + print(""No"") + exit() + M = s[i] + +if M <= s[-1]: + print(""Yes"") +else: + print(""No"") +" +p02953,s818700559,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +can = True + +for i in range(1, N - 1): + if H[i] > H[i + 1]: + if H[i] - 1 > H[i + 1]: + can = False + break + else: + H[i] -= 1 + if H[i - 1] > H[i]: + can = False + break + +print(['No', 'Yes'][can])" +p02953,s871606565,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) + +flag=False + +for i in range(N-1): + if H[i] c[1] + 1: + print('No') + exit() +if n >= 3: + for i in range(n-2): + if c[i] > c[i+1] + 1: + print('No') + exit() + if c[i] <= c[i+1] + 1 and c[i] > c[i+2] + 1: + print('No') + exit() + +print('Yes')" +p02953,s283755822,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +if N==1: + print(""Yes"") + exit() +for i in range(N-1): + if H[i]-1<=H[i+1]: + H[i]-=1 + elif H[i]==H[i+1]: + continue + else: + print(""No"") + exit() +for i in range(N-1): + if H[i]>H[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s072827629,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +for n in range(1, N): + if H[n-1] > H[n]: + H[n-1] -= 1 + +H.reverse() +if H.index(max(H)) == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s930443570,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +num=0 +for i in range(0,N-1): + if H[i]==H[i+1]+1 and H[i-1] H[i+1]: + H[i] -= 1 + + if H[i] > H[i+1]: + ans = ""No"" + break + + if H_min <= H[i]: + H_min = H[i] + else: + ans = ""No"" + break + +if H_min > H[-1]: + ans = ""No"" + +print(ans)" +p02953,s967559836,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +highest = H[0] - 1 + +for i in range(N-1): + if (H[i+1] <= H[i] and H[i+1]<= H[i]-1 and H[i+1]<=highest): + print('No') + exit() + highest = max(highest, H[i]-1) + +print('Yes')" +p02953,s224843996,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(len(H)-1): + if H[i] > H[i+1]: + H[i] -=1 + if H[i] > H[i+1] or H[i] < ma: + print('No') + exit() + ma = H[i] + +print('Yes')" +p02953,s493124986,Wrong Answer,"n = int(input()) +apple = list(map(int, input().split())) +cat = [] +count = 0 +for i in range(n - 1): + if apple[i] <= apple[i + 1]: + cat.append(apple[i]) + else: + cat.append(apple[i] - 1) +cat.append(apple[-1] + 1) +for i in range(n - 1): + if cat[i] <= cat[i + 1]: + pass + else: + count = 1 + break +print(""Yes"" if count == 0 else ""No"")" +p02953,s891297767,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) + +F=True +G=False + +for i in range(N-1): + if H[i]<=H[i+1]: + G=False + else: + if G: + F=False + elif H[i]==H[i+1]+1: + G=True + else: + F=False + +if F: + print(""Yes"") +else: + print(""No"") +" +p02953,s790604153,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = ""Yes"" +for i in range(N-2): + if H[i] - H[i+2] >= 2: + ans = ""No"" +print(ans)" +p02953,s433504866,Wrong Answer,"import sys + +input = sys.stdin.readline + +def main(): + ans = 'Yes' + N = int(input()) + h = list(map(int, input().split())) + for i in range(N-1): + if abs(h[i] - h[i+1]) > 1 and i != N-2: + ans = 'No' + break + elif h[i] > h[i+1]: + h[i] -= 1 + print(ans) + +if __name__ == '__main__': + main()" +p02953,s659457397,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +for i in range(1,N-1): + if not(H[i-1] <= H[i] <= H[i+1]): + tmp = H[i] - 1 + if not(H[i-1] <= tmp <= H[i+1]): + print('No') + sys.exit() + H[i] = tmp + if (H[i-1] < H[i]): + H[i] -= 1 +print('Yes') +" +p02953,s040187583,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +ans = ""Yes"" + +if n == 1: + print(ans) +else: + for i in range(n): + if li[i] + 1 < max(li[:i+1]): + ans = ""No"" + break + +print(ans)" +p02953,s318212050,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +if (N == 1): print(""Yes""); exit(0) +if(H[0] > H[1]): H[0] -= 1 +for i in range(1, N - 1): + if (H[i + 1] < H[i] and H[i] - 1 >= H[i - 1]): + H[i] -= 1 +for i in range(N - 1): + if (H[i + 1] < H[i]): + print('No') + exit(0) +print('Yes') +" +p02953,s452743991,Wrong Answer,"import numpy as np +import sys +n = int(input()) +h = np.array(list(map(int, input().split()))) +ans = ""No"" +for i in range(n-1): + dif = h[i] - h[i+1] + if dif > 1: + print(ans) + sys.exit() + elif dif == 1: + h[i] -= 1 + +for i in range(n-1): + dif = h[i] - h[i + 1] + if dif > 0: + print(ans) + sys.exit() +ans = ""Yes"" +print(ans)" +p02953,s430232872,Wrong Answer,"N=int(input()) +L=list(map(int,input().split())) +M=[0]*N +count=0 +for i in range (N-1): + if L[i]>L[i+1]: + L[i]-=1 + M[i]=1 + else: + count+=1 +if count==(N-1): + print(""Yes"") + exit() +count=0 +for i in range (N-1): + if L[i]>L[i+1]: + if M[i]==1: + print(""No"") + exit() + else: + L[i]-=1 + M[i]=1 + else: + count+=1 +if count==(N-1): + print(""Yes"") + exit() +print(""Yes"")" +p02953,s139550364,Wrong Answer,"# -*- coding: utf-8 -*- +n = int(input()) +h = list(map(int, input().split())) + +cnt = 0 +for i in range(n-1): + if h[i] > h[i+1]: + cnt += 1 + +print('Yes' if cnt < 2 else 'No') +" +p02953,s640165861,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +zenkai_gen = False +no_flag = False + +for i in range(n-1): + sa = h[i+1] - h[i] + + if (zenkai_gen == True) and (sa < 0): + no_flag = True + elif sa < -1: + no_flag = True + + if sa <= 0: + zenkai_gen = True + else: + zenkai_gen = False + +if no_flag: + print(""No"") +else: + print(""Yes"")" +p02953,s204226914,Wrong Answer,"n = int(input()) +hlis = list(map(int, input().split())) +d = 0 +for i in range(n-1): + d = max(d, hlis[i] - hlis[i+1]) +if d > 1: + print('No') +else: + print('Yes')" +p02953,s132753851,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +if N == 1: + print(""Yes"") + exit(0) + +for i in range(N-1): + if H[i] <= H[i+1]: + continue + elif H[i] > H[i+1]: + if H[i] - H[i+1] == 1: + H[i] -= 1 + elif H[i] - H[i+1] >= 2: + print(""No"") + exit(0) + +for i in range(N-1): + if H[i] > H[i+1]: + print(""No"") + exit(0) + +print(""Yes"")" +p02953,s027222528,Wrong Answer,"N=int(input()) +*H,=map(int,input().split()) + +i=0 +sm=[0]*(N-1) +while i+1<=N-1: + sm[i]=min(H[i+1]-H[i],0) + i+=1 + +print('YNeos'[sum(sm)<-1::2])" +p02953,s510882916,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +h_new = [] + +for i in range(n-1): + if h[i] - h[i+1] >=1: + h_new.append(h[i]-1) + else: + h_new.append(h[i]) +h_new.append(h[-1]) + +cnt = 0 +for i in range(n-1): + if h_new[i] < h_new[i+1]: + print('No') + exit() + else: + cnt += 1 + +if cnt == len(h_new)-1: + print('Yes')" +p02953,s145357115,Wrong Answer,"n = int(input()) +s = list(map(int, input().strip().split("" ""))) + +flg = 0 + +for i in range(n-1): + if s[i] - s[i+1] >= 2 or (s[i-1] == s[i] and s[i+1] - s[i] < 0): + print(""No"") + flg = 1 + break + elif s[i] - s[i+1] == 1: + s[i] = s[i] - 1 + +if flg == 0: + print(""Yes"") + " +p02953,s697225435,Wrong Answer,"N=int(input()) +Hlist=list(map(int,input().split())) +flag=True +for i in range(N-1): + if Hlist[i]>Hlist[i+1]: + Hlist[i]-=1 +for i in range(N-1): + if Hlist[i]>Hlist[i+1]: + flag=False + break +print('Yes' if flag else 'No')" +p02953,s070401117,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i] > h[i+1]: + h[i] -= 1 + +if h == sorted(h): + print('Yes') +else: + print('No') +" +p02953,s081259209,Wrong Answer,"N = int(input()) +h = list(map(int, input().split())) +h.reverse() +f = [0] * N +ans = 'Yes' +for i in range(1, N): + if h[i] - h[i -1] > 0 and f[i -1] == 0: + h[i - 1] += 1 + f[i - 1] = 1 + +for i in range(1, N): + if h[i] - h[i -1] > 0 and f[i -1] == 0: + h[i - 1] += 1 + f[i - 1] = 11 + if h[i] - h[i -1] > 0: + ans = 'No' + +print(ans) +" +p02953,s838309019,Wrong Answer,"# C - Build Stairs + +N = int(input()) +H = [int(h) for h in input().split()] +ans = 'Yes' +for i in range(1, N - 1): + if H[i + 1] < H[i]: + H[i] -= 1 + if H[i + 1] < H[i]: + ans = 'No' + break + if H[i] < H[i - 1]: + ans = 'No' + break + +print(ans) +" +p02953,s540435083,Wrong Answer,"N=int(input()) +S=list(map(int,input().split())) +Z=[0]*N + +for i in range(1,N): + Z[i]=S[i]-S[i-1] + + +flug=False +for i in range(N): + + if Z[i]<=-2: + print(""No"") + exit() + + elif Z[i]==-1 and flug==False: + flug=True + elif Z[i]==-1 and flug==True: + print(""No"") + exit() + else: + flug=False +print(""Yes"")" +p02953,s546519757,Wrong Answer,"import numpy as np +N = int(input()) +H = np.array(list(map(int,input().split()))) +D = np.diff(H,n=1) +if len(D[D <= -1]) <= 1: + print('Yes') +else: + print('No')" +p02953,s783650221,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +temp=0 +if n==1: + print(""Yes"") +else: + for i in range(0,n-1): + if h[i]-1 last + 1: + p = 'No' +print(p)" +p02953,s099941253,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +flag = True +ugokasenaiflag = False +for i,l in enumerate(li): + if i == 0: + continue + if li[i-1] - l >1: + flag = False + break + if li[i-1] - l == 1: + if ugokasenaiflag: + flag = False + break + else: + ugokasenaiflag = True + else: + ugokasenaiflag = False + +if flag: + print('Yes') +else: + print('No')" +p02953,s499016884,Wrong Answer,"#!/usr/bin/env python3 +n = int(input()) +h = list(map(int, input().split())) +ans = 0 +for i in range(n-1): + if h[i] - 1 == h[i+1]: + ans = 1 + h[i] -= 1 + if h[i-1] > h[i]: + ans = 0 + break + elif h[i] <= h[i+1]: + ans = 1 + else: + ans = 0 + break +if n == 1: + print('Yes') +elif ans == 1: + print('Yes') +else: + print('No')" +p02953,s173426091,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = 1 +for i in range(N-1): + if H[i] > H[i+1]: + if H[i]-1 == H[i+1]: + ans = 0 + break +print('Yes' if ans==1 else 'No')" +p02953,s051420568,Wrong Answer,"import sys +N=int(input()) +A=list(map(int,input().split())) +mxA=A.index(max(A)) +#if A[mxA::] + +for i in range(mxA+1,N): + if max(A) >=A[i]+2: + print('No') + sys.exit() +print('Yes')" +p02953,s867430130,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +#b = list(map(int, input().split())) +flag = [0]*n +for i in range(n-1): + if h[i]-h[i+1] >= 1: + h[i] -= 1 + flag[i] = 1 + + +for i in range(n-1): + if h[i] > h[i+1]: + if h[i]-h[i+1] == 1 and flag[i] == 0: + h[i] -= 1 + else: + print(""No"") + exit() + +if h[0]-h[-1] == 0: + print(""No"") +else: + print(""Yes"") + +" +p02953,s942453537,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +cnt = 0 +for i in range(N-1): + if(H[i] > H[i+1]): + cnt += 1 +print(""Yes"" if cnt <= 1 else ""No"")" +p02953,s672472302,Wrong Answer,"import sys +N = int(input()) +H = list(map(int, input().split())) +if len(H) == 1: + print(""Yes"") + sys.exit() + +for i in range(N-1): + + + if H[i+1] - H[i] < -1: + print(""No"") + + sys.exit() +if H[-2]-H[-1] >= 1: + print(""No"") + sys.exit() + +print(""Yes"")" +p02953,s825196112,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +k=h[0] +for i in range(n-1): + if h[i]<=h[i+1]:k=h[i+1] + if k-1>h[i+1]: + print('No') + exit() +print('Yes')" +p02953,s831287588,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +for i in range(1,N-1): + if not(H[i-1] <= H[i] <= H[i+1]): + tmp = H[i] - 1 + if not(H[i-1] <= tmp <= H[i+1]): + print('No') + sys.exit() + H[i] = tmp + if (H[i] < H[i+1]): + H[i] -= 1 +print('Yes')" +p02953,s673679984,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) + +for i in range(h.index(max(h))+1,n): + if max(h)-h[i]>=2: + print('No') + exit() +print('Yes')" +p02953,s828215506,Wrong Answer,"n = int(input()) +H = list(map(int, input().split())) +dif = list(map(lambda x: H[x + 1] - H[x], range(n - 1))) +count = 0 +for d in dif: + if d < 0: + count += 1 + else: + count = 0 + + if count >= 2: + print('No') + exit() + + +print('Yes') +" +p02953,s202758185,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +ans = ""Yes"" + +if n == 1: + print(ans) +else: + for i in range(n): + if li[i] + 1 <= max(li[:i+1]): + ans = ""No"" + break + +print(ans)" +p02953,s233994386,Wrong Answer,"n = int(input()) +l = list(map(int, input().split())) +ld = [l[i+1] - l[i] for i in range(n-1)] + +ok = 1 +if n > 1: + ld[0] += 1 + for i in range(0,n-2): + if ld[i+1] < -1: + ok = 0 + break + if ld[i+1] == -1 and ld[i] <= 0: + ok = 0 + break + +print(['No','Yes'][ok])" +p02953,s539342119,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +ans = 'Yes' +dif = [] +for i in range(n-2): + if h[i+1]-h[i]>1: + ans = 'No' + elif h[i+1]-h[i]==1: + h[i+1]-=1 +print(ans)" +p02953,s533360549,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +f=True + +for i in range(1,n): + if h[i]>=h[i-1]: + pass + else: + h[i-1]-=1 + +for i in range(1,n): + if h[i]>=h[i-1]: + f=True + else: + f=False + break + +if f: + print('Yes') +else: + print('No')" +p02953,s985249451,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +for n in range(1, N): + if H[n-1] > H[n]: + H[n-1] -= 1 + +ans = sorted(H) +if ans == H: + print(""Yes"") +else: + print(""No"")" +p02953,s579379578,Wrong Answer,"n = int(input()) +squeres = list(map(int, input().split())) +flag = True +before_down = 0 +for i in range(n - 1): + if squeres[i] > squeres[i + 1] and squeres[i] - 1 <= squeres[i + 1] and before_down == 0: + before_down = 1 + + elif not squeres[i] <= squeres[i + 1] and before_down == 1: + flag = False + + else: + if squeres[i] < squeres[i + 1]: + before_down = 0 +if flag: + print(""Yes"") +else: + print(""No"") +" +p02953,s845628024,Wrong Answer,"import sys +N = int(input()) +h = list(map(int, input().split())) +count = 0 +for i in range(N-1): + diff = h[i+1] - h[i] + if diff == -1: + count += 1 + if i > 0: + if h[i] == h[i-1]: + print('No') + sys.exit() + elif diff < -1: + print('No') + sys.exit() + if count > 1: + print('No') + sys.exit() +print('Yes') +" +p02953,s178647947,Wrong Answer,"def main(): + input() + t = list(map(int, input().split())) + m = 0 + flg = True + for i in range(len(t)): + if 0 == i or i == len(t) - 1: + continue + if t[i-1] < t[i]: + t[i] -= 1 + if t[i - 1] <= t[i] <= t[i + 1]: + pass + else: + print('No', t[i]) + exit() + print('Yes') + +if __name__ == '__main__': + main()" +p02953,s877641034,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1): + if H[i]-1 > H[i+1]: + print(""No"") + exit() + +for i in range(N-1): + if H[i] > H[i+1]: + H[i] -= 1 + +#print(H) + +for i in range(N-1): + if H[i] > H[i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s567362546,Wrong Answer,"def main(): + n = int(input()) + arr = list(map(int,input().split())) + for i in range(len(arr)-1): + if arr[i]-1>arr[i-1]: + # print(i) + print(""No"") + return + print(""Yes"") + return + + +main()" +p02953,s696493723,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1,0,-1): + if H[i] - H[i-1] == -1: + H[i-1] -= 1 +print(H) + +for j in range(N-1): + if H[j] > H[j+1]: + print('No') + break +else: + print('Yes')" +p02953,s421432238,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = True +lis = {} +for i in H: + if i in lis: + lis[i] += 1 + else: + lis[i] = 1 +mine = min(H) +times = lis[mine] +for i in range(N): + if mine < H[i]-1: + ans = False + break + else: + if H[i] == mine: + times -= 1 + if times == 0 and i != N-1: + if type(lis) == dict: + lis = sorted(lis.items()) + del lis[0] + mine = lis[0][0] + times = lis[0][1] +if ans: + print(""Yes"") +else: + print(""No"")" +p02953,s176971463,Wrong Answer,"N = int(input()) +A = list(map(int, input().split())) +if N == 1: + print(""Yes"") +else: + k = 0 + for i in range(N -1): + if (A[i] - A[i+1]) >= 2: + k += 1 + q = 0 + for j in range(N-1): + if (A[0] - A[j+1]) >= 2: + q += 1 + if k < 1 and q == 0: + print(""Yes"") + else: + print(""No"")" +p02953,s212815528,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +ans = ""Yes"" +for i in range(n-1): + if h[i] - h[n-1] > 1: + ans = ""No"" + else: + if h[i] - h[i+1] > 1: + ans = ""No"" + else: + continue +print(ans)" +p02953,s642180858,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +for i in range(N-1): + if H[i] <= H[i+1]+1: + continue + else: + print(""No"") + break +print(""Yes"")" +p02953,s547810009,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +ans=""Yes"" +FL=False +Fx=-1 +for i in range(n-1): + if n==1: + break + if h[i]-h[i+1]==1: + if FL: + ans=""No"" + break + else: + FL=True + Fx=h[i] + if h[i]-h[i+1]>1: + ans=""No"" + break + else: + if h[i]>=Fx: + FL=False +print(ans)" +p02953,s084057719,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) +ans = ""Yes"" +for i in range(N-1): + if H[i] - 1 > H[i+1]: + ans = ""No"" + break +if max(H) != H[N-1]: + if max(H) > H[N-1] + 1: + ans = ""No"" +print(ans) +" +p02953,s932221862,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) + +ok = True +for i in range(1,N): + l = H[i-1] - 1 + r = H[i] + + if l <= r: + H[i-1] -= 1 + continue + else: + ok = False + break + +if ok: + print('Yes') +else: + print('No') +" +p02953,s213018685,Wrong Answer,"n = int(input()) +a = list(map(int, input().split())) +flg = 0 +a[0] -= 1 +for i in range(1,n): + if a[i] == a[i-1] + 1: + a[i] -= 1 + elif a[i] < a[i-1]: + flg = 1 +if flg == 1: + print('No') +else: + print('Yes')" +p02953,s956317188,Wrong Answer,"import sys +N = int(input()) +H = list(map(int, input().split())) + +if N==1: + print(""Yes"") + sys.exit() +else: + for i in range(N-1): + if H[i] > H[i+1]: + H[i] = (H[i] - 1) + +count = 0 +for i in range(N-1): + if H[i] > H[i+1]: + count = count + 1 + + +if count == 0: + print(""Yes"") +else: + print(""No"")" +p02953,s691246319,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i+1] - h[i] < -1: print('No'); quit() +print('Yes') +" +p02953,s505218417,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +for i in range(1,N-1): + if not(H[i-1] <= H[i] <= H[i+1]): + tmp = H[i] - 1 + if not(H[i-1] <= tmp <= H[i+1]): + print('No') + sys.exit() + H[i] = tmp + if H[i-1] < H[i] < H[i+1]: + H[i] -= 1 +print('Yes')" +p02953,s789277900,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(1,n): + if h[i] == h[i-1] +1: + h[i] -= 1 + +for j in range(n-1): + if h[j] > h[j+1]: + print('No') + break +else: + print('Yes')" +p02953,s708549393,Wrong Answer,"import sys +import math +import itertools +import collections +import heapq +import re +import numpy as np + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: map(str, sys.stdin.buffer.readline().split()) +ri = lambda: int(sys.stdin.buffer.readline()) +rm = lambda: map(int, sys.stdin.buffer.readline().split()) +rl = lambda: list(map(int, sys.stdin.buffer.readline().split())) + +n = ri() +h = rl() +temp = 0 +for i in h: + if temp > i: + print('No') + exit() + temp = i +else: + print('Yes') + + + + +" +p02953,s139856078,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +if min(h) == h[n-1] and set(h) != 1: print(""No"") +else: print(""Yes"")" +p02953,s821983811,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +f = True +maxh = None +for i in range(1, n): + if h[i - 1] <= h[i]: + continue + if h[i - 1] - h[i] > 1 or maxh is not None and maxh != h[i - 1]: + f = False + break + maxh = h[i - 1] + h[i - 1] -= 1 + +if f: + print(""Yes"") +else: + print(""No"")" +p02953,s107032874,Wrong Answer,"n = int(input()) +lst = [int(i) for i in input().split()] +min_value = min(lst) +lst = [i - 1 if i != min_value else i for i in lst] +lst_be = lst[:n-1] +lst_af = lst[1:] +lst = [1 if af < be else 0 for be, af in zip(lst_be, lst_af)] +if sum(lst) > 0: + print ('No') +else: + print ('Yes')" +p02953,s889061662,Wrong Answer,"#python3 +n=int(input()) +h=[int(i) for i in input().split()] + +for i in range(n-1): + if h[i] > h[i+1]: + h[i]-=1 + +flag = True +for i in range(n-1): + if not (h[i] <= h[i+1]): + flag = False + +if flag: + print('Yes') +else: + print('No')" +p02953,s560712574,Wrong Answer,"N = int(input()) +Hs = [int(i) for i in input().split()] + +is_Yes = True +for i in range(1, N-1): + if Hs[i-1] == Hs[i]: + continue + elif Hs[i] > Hs[i-1]: + Hs[i] -= 1 + else: + is_Yes = False + break + +if is_Yes: + print('Yes') +else: + print('No') +" +p02953,s508541491,Wrong Answer,"n = int(input()) +h =list(map(int, input().split())) + +for i in range(n-1): + if h[i] > h[i+1] and h[i]-1 <= h[i+1]: + h[i] -= 1 + # elif h[i]-1 > h[i+1]: + # print(""No"") + # exit() + +for i in range(n-1): + if h[i] > h[i+1]: + print(""No"") + exit() + +print(""Yes"")" +p02953,s436214275,Wrong Answer,"from sys import exit +n = int(input()) +hh = list(map(int, input().split())) + +ans = True +down = False +for i in range(1, n): + if hh[i-1] <= hh[i]: + continue + elif not down: + hh[i-1] -= 1 + if hh[i-1] <= hh[i] and (i==n-1 or hh[i-1] <= hh[i]): + down = True + continue + print('No') + exit() +print('Yes')" +p02953,s249665658,Wrong Answer,"N = int(input()) +H = list(map(lambda h: int(h), input().split("" ""))) + +impossible = False +for i in range(len(H) - 1): + if H[i] - H[i+1] >= 2: + impossible = True + +print(""No"") if impossible else print(""Yes"")" +p02953,s307922437,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +temp=0 +if n==1: + print(""Yes"") +else: + for i in range(0,n-1): + if h[i]H[i+1]+1: + no = True + break + elif H[i]==H[i+1]+1: + H[i] -= 1 +#print(sorted(H)) +if H != sorted(H): + no = True +print(['Yes','No'][no]) +" +p02953,s991284387,Wrong Answer,"n=int(input()) +A=list(map(int,input().split())) +for i in range(n-1): + if A[i+1]-A[i]<-2: + print(""No"") + exit() +print(""Yes"")" +p02953,s860140389,Wrong Answer,"n = int(input()) +l = [int(x) for x in input().split()] +#print(n, l) + +a = 0 +for i in range(n-1): + if l[i] <= l[i+1]: + continue + else: + if l[i] - 1 == l[i+1]: + a += 1 +#print(a) + +if a <= 1: + print('Yes') +else: + print('No') + + +" +p02953,s344512587,Wrong Answer,"#! python3 +# solve_136C.py + +N = int(input()) +H = list(map(int,input().split())) + +Frag = 1 + +for i in range(0,N-1): + if H[i] == H[i+1] + 1: + H[i] -= 1 + elif H[i] <= H[i+1]: + pass + else: + Frag = 0 + break + +if Frag == 0: + print(""No"") +else: + print(""Yes"")" +p02953,s443151869,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +ht=h[-1] +ans=""Yes"" +for i in reversed(h): + if 0 <= i <= ht+1: + ht = i + else: + ans=""No"" + break + +print(ans)" +p02953,s041253793,Wrong Answer,"N=int(input()) +arr=list(map(int,input().split())) +ans=1 +kari=1 +for i in range(N-1): + kari=max(kari,arr[i]-1) + print(i,kari,ans) + if kari>arr[i+1]: + ans=0 + print(i,kari,ans) + break + + + +if ans==0: + print(""No"") +else: + print(""Yes"") +" +p02953,s405040964,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +a=0 +for i in range(N-1): + if H[i]>H[i+1]: + H[i]-=1 + if H[i]>H[i+1]: + print(""No"") + break +else: + print(""Yes"")" +p02953,s061932515,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +f=1 +for i in range(n-2): + if h[i+1]-h[i]<-1 or h[i+2]-h[i+1]<-1: + f=0 + break + if h[i+1]-h[i]<0 and h[i+2]-h[i+1]<0: + f=0 + break + +if f: + print(""Yes"") +else: + print(""No"")" +p02953,s490397336,Wrong Answer,"N = int(input()) + +h = [int(x) for x in input().split()] +x = h[0] +i = 1 +k = 0 +for _ in [0]*(N-1): + y = h[i] + i += 1 + if (y - x == -1) and k == 1 : + print('No') + exit() + elif y - x == -1: + x = y + k = 1 + elif y - x >= 0: + x = y + k = 0 + else: + print(x, y) + print('No') + exit() + +print('Yes') + +" +p02953,s538649017,Wrong Answer,"N = int(input()) +List = list(map(int,input().split())) +flag = 0 +for i in range(N-1): + if List[i]>List[i+1]+1: + print('No') + exit() + elif List[i]==List[i+1]+1 and flag == 1: + print('No') + exit() + elif List[i]==List[i+1]+1: + flag = 1 +print('Yes')" +p02953,s171788526,Wrong Answer,"n=int(input()) +a=list(map(int,input().split())) +frag=1 +frag2=1 +for i in range(n-1): + print(i,frag,frag2) + if a[i]-a[i+1]==1: + if frag2==1 and frag==1: + frag2=0 + elif frag2==0: + frag=0 + break + elif frag==2: + frag=0 + break + elif a[i]-a[i+1]>1: + frag=0 + break + elif a[i]==a[i+1]: + frag=2 + elif frag==2: + frag=1 +if frag!=0: + print('Yes') +else: + print('No')" +p02953,s662511846,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +ans = ""Yes"" +for i in range(n-1): + if h[i] > h[i+1]: + h[i] -= 1 + +for j in range(n-1): + if h[j] > h[j+1]: + ans = ""No"" + break +print(ans)" +p02953,s182720610,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +ans = '' +for i in range(1, n -1): + if -1 <= h[i] - h[i - 1] and -1 <= h[i + 1] - h[i]: + next + else: + ans = 'No' + break +if ans == '': + ans = 'Yes' +print(ans)" +p02953,s039454885,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +ans = 1 +for i in range (n): + if (h[i]-h[n-1] >= 2 or h[0]-h[i] <= 2): + ans = 0 + break + +if (ans == 1): + print(""Yes"") + +else : + print(""No"")" +p02953,s822172396,Wrong Answer,"N = int(input()) +H = [int(i) for i in input().split()] + +flag = 1 +for i in range(N-1): + if H[i] > H[i+1]: + H[i] = H[i]-1 + +for i in range(N-1): + if H[i] > H[i+1]: + flag = 0 + +if flag == 0: + print(""No"") +else: + print(""Yes"")" +p02953,s524809955,Wrong Answer,"# ABC136 C;Build Srairs + +N = int(input()) +l = list(map(int,input().split())) +ans = 'Yes' + +for i in range(1,N-1): + if l[i+1] < l[i]: + l[i] = l[i] - 1 + + if l[i+1] < l[i] or l[i-1]> l[i]: + ans = 'No' + break +#print(l) +print(ans)" +p02953,s541688634,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +ans = 0 + +if n == 1: + print('Yes') + +else: + for i in range(n-2): + if h[i] + 1 == h[i + 1]: + print('Yes') + break + elif h[i] == h[i + 1]: + continue + else: + print('No') + break +" +p02953,s184289367,Wrong Answer,"N = int(input()) +H = list( map(int,input().split()) ) + + +for i in range(N-1): + if H[i] - H[i+1] >= 2: + print('No') + exit(0) + elif H[i] - H[i+1] == 1: + H[i] -= 1 + +L = sorted(H) +if H == L: + print('Yes') +else: + print('No')" +p02953,s406812917,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +ans = 0 + +if n == 1: + print('Yes') + +else: + for i in range(n-1): + if h[i] + 1 == h[i + 1]: + print('Yes') + break + elif h[i] == h[i + 1]: + continue + else: + print('No') + break" +p02953,s106125092,Wrong Answer,"import sys + +n = int(input()) +s = list(map(int, input().split())) +nums = [] +mx, cnt = 0, 0 +s = s[::-1] +if n == 1: + print(""Yes"") + sys.exit(0) +elif n == 2: + if s[1] - s[0] >= -1: + print(""Yes"") + sys.exit(0) + else: + print(""No"") + sys.exit(0) +else: + for i in range(n - 2): + if s[i] < s[i + 1] < s[i + 2]: + print(""No"") + sys.exit(0) +print(""Yes"") +" +p02953,s601886771,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +m=0 +for i in range(N-1): + if H[i] > m+1: print('No'); exit() + m=max(m,H[i]) +print('Yes')" +p02953,s181853534,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +import sys + +for i in range(n-1,1,-1): + if max(h[:i])>h[i]+1: + break + print(f""{i+1}:ok!"") +else: + print(""Yes"") + sys.exit() +print(""No"")" +p02953,s673578760,Wrong Answer,"n = int(input()) +high = list(map(int,input().split())) + +a = True + +for x in range(n-1): + if high[x] - high[x+1] >= 2: + a = False + break + +for x in range(n-2): + if high[x]>high[x+1]>high[x+2]: + a = False + break +if a: + print(""Yes"") + +else: + print(""No"") + " +p02953,s450416840,Wrong Answer,"n = int(input()) +h = [int(i) for i in input().split()] +min = h[- 1] +index = - 1 +for i in range(n): + if h[- 1 - i] < min: + min = h[- 1 - i] + index = - 1 - i +for i in h[:index]: + if i >= min + 2: + print(""No"") + break +else: + print(""Yes"")" +p02953,s572845516,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +i = 1 + +while i < n: + if h[i] < h[i-1]: + h[i-1] -= 1 + elif h[i] > h[i-1]: + h[i] -= 1 + else: + pass + + i += 2 + +l = list(h) +l.sort() +if h == l: + print('YES') +else: + print('NO')" +p02953,s935229489,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n - 2): + if (h[i] - h[i + 1] >= 2) or (h[i + 1] - h[i + 2] >= 2) or (h[i] - h[i + 2] >= 2): + print('No') + exit() +print('Yes')" +p02953,s266647622,Wrong Answer,"n = int(input()) +l = [int(x) for x in input().split()] +#print(l) + +for i in range(1,n)[::-1]: + if l[i-1] - 1 == l[i]: + l[i] = l[i] + 1 + else: + continue + +#print(l) + +a = 0 +for j in range(1, n): + if l[j-1] <= l[j]: + continue + else: + print('No') + break +else: + print('Yes') +" +p02953,s482210436,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +mh = h[0] +for i in range(1,n): + if h[i-1] > h[i]: + if h[i-1] - 1 == h[i] and h[i] >= mh: + h[i-1] -= 1 + else: + print(""No"") + exit() + mh = h[i-1] + +print(""Yes"")" +p02953,s780008728,Wrong Answer,"from sys import exit +n = int(input()) +hh = list(map(int, input().split())) + +if n == 1 or (n == 2 and hh[0] - 1 <= hh[1]): + print('Yes') + exit() + +for i in range(n-1,0,-1): + if hh[i] >= hh[i-1]: + continue + else: + hh[i-1] -= 1 + if hh[i] >= hh[i-1]: + continue + print(i) + print('No') + exit() +print('Yes')" +p02953,s809156345,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n - 2): + if h[i] < h[i + 1] and h[i + 1] > h[i + 2]: + if h[i] <= h[i + 1] - 1 and h[i + 1] - 1 <= h[i + 2]: + h[i + 1] -= 1 + else: + print(""No"") + exit() + elif h[i] > h[i + 1]: + print(""No"") + exit() +if h[n - 2] <= h[n - 1]: + print(""Yes"") +else: + print(""No"") +" +p02953,s662809913,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +flg = True +for i in range(N-1): + if H[i+1] - H[i] <= -2: + print(""No"") + flg = False + break + if i != 0: + if H[i+1] - H[i] == -1 and H[i] - H[i-1] >= 2: + print(""No"") + flg = False + break +if flg == True: + print(""Yes"") +" +p02953,s858431773,Wrong Answer,"from sys import exit +n = int(input()) +hh = list(map(int, input().split())) + +ans = True +down = False +for i in range(n-1): + if hh[i] <= hh[i+1]: + continue + elif not down: + hh[i] -= 1 + if hh[i] <= hh[i+1] and (i==0 or hh[i-1] <= hh[i]): + down = True + continue + print('No') + exit() +print('Yes')" +p02953,s990086169,Wrong Answer,"N=int(input()) +Hlist=list(map(int,input().split())) +flag=True +for i in range(N-1): + if Hlist[i]>Hlist[i+1]: + Hlist[i]-=1 +for i in range(N-1): + if Hlist[i]>Hlist[i+1]: + flag=False + break +print('Yes' if flag else 'No')" +p02953,s370703563,Wrong Answer," +n = int(input()) +h = list(map(int,input().split())) +flg = True + +for i in range(1,n): + if h[i-1] < h[i]: + h[i] -= 1 + if h[i-1] < h[i]: + flg = False + break +print(""Yes"" if flg else ""No"") +" +p02953,s327680175,Wrong Answer,"n = int(input()) +a = list(map(int, input().split())) +flg = 0 +for i in range(1,n): + if a[i] == a[i-1] + 1: + a[i] -= 1 + elif a[i] < a[i-1]: + flg = 1 +if flg == 1: + print('No') +else: + print('Yes')" +p02953,s562807170,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) +if n>=2 and h[0]==h[1]+1: + h[0]-=1 +if n>=2 and h[0]>h[1]+1: + print('No') + exit() +for i in range(1,n-1): + if h[i]==h[i+1]+1 and h[i-1]=h[i+1]+1: + print('No') + exit() +print('Yes')" +p02953,s475783067,Wrong Answer,"n=int(input()) +h=list(map(int,input().split())) + +v=0 +l=0 + +for i in range(n-2): + if h[i]>h[i+1] and h[i+1]>h[i+2]: + v=v+1 + if h[i]-h[i+1]<-1: + l=l+1 +if v==0 and l==0: + print(""Yes"") +else: + print(""No"")" +p02953,s585065643,Wrong Answer,"N = int(input()) +li = list(map(int, input().split())) + +ans = 'Yes' + +for index, i in enumerate(li): + if index + 1 > len(li) - 1: + break + + if i - li[index+1] >= 2: + ans = ""No"" + + if index + 2 > len(li) - 1: + continue + + if i > li[index+1] > li[index+2]: + ans = ""No"" + +print(ans)" +p02953,s060417702,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) +ans = 1 +for i in range(N-1): + if H[i] > H[i+1]: + if H[i]-1 == H[i+1]: + ans = 0 + break +print('Yes' if ans==1 else 'No') +print(H)" +p02953,s565962228,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) + +for i in range(len(H)-1): + if H[i] > H[i+1]: + H[i] -=1 + if H[i] > H[i+1] or H[i] < ma: + print('No') + exit() + if i == 0 or H[i] > H[i-1]: + H[i] -= 1 + ma = H[i] + +print('Yes') +" +p02953,s416561097,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i]>h[i+1]: + h[i]-=1 +for j in range(n-1): + if h[j]>h[j+1]: + print('No') + exit() +else: + print('Yes')" +p02953,s221605720,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +s=0 +t=0 +for i in range(N-1): + if H[i]-H[i+1]>=2: + break + if H[i]>H[i+1] and H[i]-H[i+1]<2: + s+=1 + t+=1 + else: + s=s + t+=1 +if s>=2 or tL[i+1]: + s=L[i]-L[i+1] + cnt+=1 + if L[i-1]>L[i]-1: + print('No') + exit() + if s>=2: + print('No') + exit() + +if cnt>=2: + print('No') +else: + print('Yes') " +p02953,s202019487,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +for i in range(n-1): + if h[i] >= h[i+1]: + pass + else: + if h[i] == h[i+1] -1: + h[i+1] -= 1 + else: + exit(print('No')) + +print('Yes') +" +p02953,s266457996,Wrong Answer," +def solve(): + ans = ""Yes"" + for i in range(N-1): + if H[i] - H[i+1] == 1: + H[i] -= 1 + elif H[i] - H[i+1] > 1: + continue + else: + ans = ""No"" + break + print(ans) + +if __name__ == ""__main__"": + N = int(input()) + H = list(map(int, input().split())) + solve() +" +p02953,s287853052,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-1): + if H[i+1] - (H[i]-1) > 1: + print(""Yes"") + exit() +print(""No"")" +p02953,s797225766,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +ans = ""Yes"" +for i in range(n-1): + if h[i] > h[i+1]: + h[i] -= 1 +H = sorted(h) +for j in range(n-1): + if H[j] > H[j+1]: + ans = ""No"" + break +print(ans) +" +p02953,s581739122,Wrong Answer,"N = int(input()) +H = [int(i) for i in input().split()] +# N = 5 +# H = [1, 2, 1, 1, 3] +# N = 4 +# H = [1, 3, 2, 1] +# N = 5 +# H = [1, 2, 3, 4, 5] +# N = 1 +# H = [1000000000] +ret = True +prev = H[0] +peek = 0 +for i in range(1, N - 1): + peek = H[i + 1] + h = H[i] + if h > peek: + h -= 1 + print(prev, H[i], h, peek) + if h < prev: + ret = False + break + prev = h +print(""Yes"" if ret else ""No"") +" +p02953,s525231627,Wrong Answer,"n=int(input()) +hlis=list(map(int,input().split())) +ans=1 +for i in range(n-1): + if hlis[i]>hlis[i+1]: + if hlis[i]-hlis[i+1]>1: + ans=0 + elif i>0 and hlis[i-1]>hlis[i]: + ans=0 +print(""Yes"" if ans==1 else ""No"")" +p02953,s450743950,Wrong Answer,"n = int(input()) +aaa = list(map(int, input().split(' '))) +before = 0 +ans = 'Yes' +for i in range(n-1): + if aaa[i] == aaa[i+1] + 1: + aaa[i] -= 1 +for i in range(n-1): + if aaa[i] > aaa[i+1]: + ans = 'No' +print(ans)" +p02953,s194342097,Wrong Answer,"n = int(input()) +h =list(map(int, input().split())) + +flg = True + +for i in range(n-1): + if h[i] < h[i+1]: + flg = True + + if h[i] > h[i+1] and h[i]-1 == h[i+1] and flg: + h[i] -= 1 + flg = False + +# print(h) + +for i in range(n-1): + if h[i] > h[i+1]: + print(""No"") + exit() +print(""Yes"")" +p02953,s925651115,Wrong Answer,"N = int(input()) +a = list(map(int,input().split())) + +s = 0 +for i in range(1,len(a)): + if a[i-1]-a[i]==1: + s+=1 + +if s>=2: + print(""No"") +else: + print(""Yes"")" +p02953,s103660114,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +ans = 'Yes' +for i in range(1, N): + if H[i-1] > H[i] + 1: + ans = 'No' + break + +print(ans)" +p02953,s984129615,Wrong Answer,"N = int(input()) +H = map(int,input().split()) +min = 0 +m = 0 +ans = 'Yes' +print(""m i"") +for i in H: + if m == 0: + m = i + continue + print(m,i) + if m <= i + 1: + m = max(m,i - 1) + else: + ans = ""No"" + break +print(ans) +" +p02953,s641756573,Wrong Answer,"N = int(input()) +H = list(map(int, input().split())) + +flg = 1 +for i in range(N-1): + if H[i] - H[i+1] >= 2: + flg = 0 + break + if H[i] - H[i+1] == 1: + if i == 0: + H[i] -= 1 + continue + if H[i-1] == H[i]: + flg = 0 + break + H[i] -= 1 +if flg == 1: + print('Yes') +elif flg == 0: + print('No')" +p02953,s687202632,Wrong Answer,"N = int(input()) +A = list(map(int, input().split())) +if N == 1: + print(""Yes"") +else: + k = 0 + for i in range(N -1): + if (A[i + 1]+1) < A[i]: + k += 1 + if k <= 1: + print(""Yes"") + else: + print(""No"")" +p02953,s522141806,Wrong Answer,"n=int(input()) +h =list(map(int,input().split())) +if n ==1: + print('Yes') + exit() +for i in range(n-1): + if h[i]-1 > h[i+1]: + print('No') + exit() + elif h[i]-1 == h[i+1]: + h[i] -=1 + if h[i-1] > h[i]: + print('No') + exit() +print('Yes')" +p02953,s958814994,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +h = h[::-1] +count = 0 +for i in range(1, n): + if h[i]-h[i-1]==1: + h[i]+=-1 + elif h[i]-h[i-1]>=2: + print('NO') + exit() +print('YES')" +p02953,s499128012,Wrong Answer,"# C - Build Stairs + +N = int(input()) +H = [int(h) for h in input().split()] +ans = 'Yes' +mx = 0 +for i in range(N - 1): + if H[i + 1] + 1 < H[i]: + ans = 'No' + break + if H[i + 1] < H[i]: + H[i] -= 1 + if H[i] < mx: + ans = 'No' + break + mx = max(mx, H[i]) + +print(ans) +" +p02953,s496311684,Wrong Answer,"n = int(input()) +h = [int(i) for i in input().split()] +min = h[- 1] +index = - 1 +for i in range(n): + if h[- 1 - i] < min: + min = h[- 1 - i] + index = - 1 - i +if min + 2 in h[:index]: + print(""No"") +else: + print(""Yes"") +" +p02953,s798252553,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) +ans = 'Yes' +dif = [] +for i in range(n-2): + if h[i+1]-h[i]>1: ans = 'No' +print(ans)" +p02953,s984632459,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +li.append(100000) +f = 0 +for i in range(1,n-1): + if li[i-1] <= li[i] <= li[i+1]: + f += 0 + elif li[i-1] <= li[i] - 1 <= li[i+1]: + li[i] = li[i] - 1 + f += 0 + else: + print(""No"") + f = 1 + break +if f == 0: + print(""Yes"")" +p02953,s155763055,Wrong Answer,"import sys +n=int(input()) +H=list(map(int,input().split())) + +for i in range(1,n): + if H[i-1]-H[i]>1 or H[i]-H[i-1]>1: + print('No') + exit() +print('Yes')" +p02953,s705172998,Wrong Answer,"def main(): + n = int(input()) + arr = list(map(int,input().split())) + for i in range(len(arr)-1): + if arr[i]-1>(arr[i-1]-1): + # print(i) + print(""No"") + return + print(""Yes"") + return + + +main()" +p02953,s002635024,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +cur_h = h[0] +for i in range(1,n-2): + if cur_h > h[i]+1: + print(""NO"") + exit() + if cur_h > h[i]: cur_h = h[i]-1 + else: cur_h = h[i] + +if h[n-1]+1 < cur_h: print(""No"") +else: print(""Yes"")" +p02953,s830390795,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +if n==1: + print('Yes') + exit() +for i in range(1,n): + if h[i] < h[i-1]: + h[i-1] -=1 +if sorted(h) == h: + print('Yes') +else: + print('No')" +p02953,s619394381,Wrong Answer,"N = int(input()) +H = list(map(int,input().split())) + +flag=0 +for i in range(N-1): + if H[i] > H[i+1]: + flag=1 + break + elif H[i]+1 == H[i+1]: + H[i+1]=H[i+1]-1 + else: + continue + +if flag==0: + print('Yes') +else: + print('No')" +p02953,s922384574,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +if max(h) - h[n - 1] > 1: + print('No') + exit(0) +elif n == 1: + print('Yes') + exit(0) +else: + for i in range(n - 1 , 0): + if max(h[i - 1] - 1, 1) > h[i]: + print('No') + exit(0) + else: + h[i - 1] = max(h[i - 1] - 1, 1) + +print('Yes')" +p02953,s178821888,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +num=0 +for i in range(0,N-1): + if H[i]==H[i+1]+1: + H[i]=H[i]-1 + elif H[i]==H[i+1] and H[i] at_least: + if A[i]-1 > at_least: + print(""No"") + exit() + +print(""Yes"")" +p02953,s425710220,Wrong Answer,"from sys import exit + +N = int(input()) +h = list(map(int,input().split())) + +pre = h[0]-1 +for i in range(N-1): + if h[i] <= h[i+1]: + pre = h[i] + else: + if h[i]-1 <= h[i+1]: + if pre > h[i]-1: + print(""No"") + exit(0) + else: + pre = h[i]-1 + else: + print(""No"") + exit(0) + +print(""Yes"")" +p02953,s954197616,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(n): + if h[i] == h[i-1] -1: + h[i-1] -= 1 + +for j in range(n-1): + if h[j] > h[j+1]: + print('No') + break +else: + print('Yes')" +p02953,s144297083,Wrong Answer,"from collections import deque + +N = int(input()) +H = deque(map(float, input().split())) + +prev = H.popleft() + +for i in range(N-1): + cor = H.popleft() + if cor - prev < -1: + print('No') + exit() + + prev = cor + +print('Yes') +" +p02953,s880260586,Wrong Answer,"n = int(input()) +stair = input().split(' ') +flag = 0 + +for i in range(0, n - 1): + if (int(stair[i]) < int(stair[i+1])): + stair[i+1] = int(stair[i+1]) - 1 + + if (int(stair[i]) > int(stair[i+1])): + print(""No"") + exit; + + +print(""Yes"") +" +p02953,s780204966,Wrong Answer,"N = int(input()) +H_list = list(map(int, input().split())) +ans = ""Yes"" +for i in range(1, N-1): + if H_list[i] H[i+1]: + H[i] -= 1 +if H == sorted(H): + print('Yes') +else: + print('No')" +p02953,s325343938,Wrong Answer,"import sys + +N = int(input()) +H = list(map(int,input().split())) + +for i in range(1,N-1): + if not(H[i-1] <= H[i] <= H[i+1]): + tmp = H[i] - 1 + if not(H[i-1] <= tmp <= H[i+1]): + print('No') + sys.exit() + H[i] = tmp + else: + H[i] -= 1 +print('Yes')" +p02953,s647482489,Wrong Answer,"import sys +N = int(input()) +H = list(map(int, input().split())) + +for i in range(N-2): + if H[i] >= H[i+1] > H[i+2]: + print('No') + sys.exit() +print('Yes')" +p02953,s024504034,Wrong Answer,"n=int(input()) + +h=[int(x) for x in input().split()] +m=h[0] +for i in range(n): + #print(c,-i) + if h[i]>m+1: + print(""No"") + exit() + m=max(m,h[i]) +print(""Yes"") +" +p02953,s131015015,Wrong Answer,"N=int(input()) +H=list(map(int, input().split())) +ans = ""Yes"" +for i in range(N-1)[::-1]: + if H[i] H[1]: + ans = ""No"" +else: + for i in range(N-2): + if H[i] - H[i+2] >= 2 or H[i] - H[i+1] >= 2: + ans = ""No"" +print(ans)" +p02953,s499905633,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n - 2): + if h[i] < h[i + 1] and h[i + 1] - h[i + 2] == 1: + h[i + 1] -= 1 +for i in range(n - 1): + if h[i] > h[i + 1]: + print(""No"") + exit() +print(""Yes"") +" +p02953,s646750732,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +#b = list(map(int, input().split())) +flag = [0]*n +for i in range(n-1): + if h[i]-h[i+1] >= 1: + h[i] -= 1 + flag[i] = 1 + + +if h[0]-h[-1] == 0: + print(""No"") + exit() +for i in range(n-1): + if h[i] > h[i+1]: + if h[i]-h[i+1] == 1 and flag[i] == 0: + h[i] -= 1 + else: + print(""No"") + exit() + +print(""Yes"") + + +" +p02953,s411911822,Wrong Answer,"n=int(input()) +list=list(map(int,input().split())) +for i in range(n-1): + if list[i]>list[i+1]: + list[i]-=1 + if list[i+1]==max(list[0:i+1]): + continue + else: + print(""No"") + break +else:print(""Yes"")" +p02953,s321303510,Wrong Answer,"N=int(input()) +A=list(map(int, input().split())) +tmpmax=A[0] +ikeru=True +ok=True +for i in range(1,N): + if tmpmax>A[i]: + if tmpmax-1==A[i] and ok: + tmpmax-=1 + ok=False + else: + ikeru=False + break + else: + ok=True + tmpmax=A[i] + +if ikeru: + print(""Yes"") +else: + print(""No"")" +p02953,s732457753,Wrong Answer,"N = int(input()) +M = list(map(int,input().split())) + +ans = ""Yes"" +limit = 0 + +for i in range(N-1) : + if M[i] > M[i+1] : + if M[i]-1 > M[i+1] or limit > M[i]-1 : + ans = ""No"" + break + limit = M[i] +print(ans)" +p02953,s114166666,Wrong Answer,"N=int(input()) +H=list(map(int,input().split())) +for i in range(N-1): + if H[i]==H[i+1]+1: + H[i]-=1 + if H[i]=2: + print('No') + exit() +print('Yes')" +p02953,s708568434,Wrong Answer,"import numpy as np +import bisect +N = int(input()) +H = list(map(int, input().split())) + +tmp = H[bisect.bisect_right(H, max(H))-1:] +ans_1 = min(tmp) > max(H)-2 + +H = np.array(H) +tmp = H[1:] - H[:-1] + +ans_2 = all(tmp > -2) + +print(""Yes"") if ans_1 & ans_2 else print(""No"")" +p02953,s767757411,Wrong Answer,"import sys + + +def main(): + + N = int(sys.stdin.readline()) + Hs = [int(x) for x in sys.stdin.readline().strip().split("" "")] + + current = 0 + + for i in range(N - 1): + h_before = Hs[i] + h_after = Hs[i + 1] + + if h_before <= h_after: + continue + + if h_after < current: + print(""No"") + return + + h_before -= 1 + Hs[i] = h_before + N = N - 1 + + current = h_before + + print(""Yes"") + + +main() +" +p02953,s245394267,Wrong Answer,"n=int(input()) +h=list(map(int, input().split())) +f=True + +for i in range(n-1): + j=i+1 + if h[i]h[j]: + f=False + break +if f: + print('Yes') +else: + print('No')" +p02953,s518747784,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) + +h_new = [] + +for i in range(n-1): + if h[i] - h[i+1] >=1: + h_new.append(h[i]-1) + else: + h_new.append(h[i]) +h_new.append(h[-1]) + +cnt = 0 +for i in range(n-1): + if h_new[i+1] < h_new[i]: + print('No') + exit() + else: + cnt += 1 + +if cnt == len(h_new)-1: + print('Yes')" +p02953,s724160950,Wrong Answer,"import sys +n = int(input()) +ls = list(map(int,input().split())) +mx = ls[0] +for i in range(n-1): + if (ls[i+1] - ls[i]) == -1: + ls[i] -= 1 + if ls[i] < mx: + print(""No"") + sys.exit() + else: + mx = ls[i] + elif ls[i+1] - ls[i] <-1: + print(""No"") + sys.exit() + else: + if ls[i] > mx: + mx = ls[i] +print(""Yes"")" +p02953,s099445524,Wrong Answer,"input() +H = [int(i) for i in input().rstrip().split(' ')] +N = len(H) + +for i in range(0,N): + a = H[i] + b = H[i - 1] if i > 0 else 0 + n = H[i + 1] if i < N -1 else 10**9 + #print(i,""#"",b,a,n) + if n == a - 1: + if b == a: + print(""No"") + break + else: + H[i] -= 1 + elif n < a - 1: + print(""No"") + break +else: + print(""Yes"")" +p02953,s002003149,Wrong Answer,"def main(): + n = int(input()) + h = list(map(int, input().split())) + + pre = 0 + flag = True + for i in range(n): + if h[i] >= pre + 1: + h[i] -= -1 + if h[i] < pre: + flag = False + break + pre = h[i] + + if flag: + print('Yes') + else: + print('No') + + +if __name__ == '__main__': + main()" +p02953,s646247818,Wrong Answer,"n = int(input()) +h = list(map(int,input().split())) + +for i in range(1,n-1): + if h[i-1] <= h[i] <= h[i+1]: + continue + else: + if h[i]>h[i+1]: + h[i] -= 1 + if h[i]< h[i-1]: + print('No') + exit() + + if h[i] < h[i-1]: + print('No') + exit() + + +print('Yes')" +p02953,s777613248,Wrong Answer,"import sys +import collections +import bisect +readline = sys.stdin.readline + + +def main(): + n = int(readline().rstrip()) + if n == 1: + print(""No"") + return + h = list(map(int, readline().rstrip().split())) + for i in range(n - 1): + right = h[n - i - 1] + left = h[n - i - 2] + if left == right + 1: + h[n - i - 2] -= 1 + if left > right + 1: + print('No') + return + + print('Yes') + + +if __name__ == '__main__': + main() +" +p02953,s384836977,Wrong Answer,"N=int(input()) +A=list(map(int, input().split())) +tmpmax=A[0] +ikeru=True +ok=True +for i in range(1,N): + if tmpmax>A[i]: + if tmpmax-1==A[i] and ok: + tmpmax-=1 + ok=False + else: + ikeru=False + break + elif tmpmax==A[i] and ok==False: + ikeru=False + break + else: + ok=True + tmpmax=A[i] + +if ikeru: + print(""Yes"") +else: + print(""No"")" +p02953,s274626426,Wrong Answer,"n = int(input()) +h = list(map(int, input().split())) +for i in range(n - 1): + if h[i + 1] - h[i] < -1: + print(""No"") + exit() +print(""Yes"")" +p02953,s247805801,Wrong Answer,"n = int(input()) +A = list(map(int,input().split())) +ans = 0 +for i in range(n-1): + if A[i+1]-A[i] >= -1: + if max(A[i],A[i+1]) >= ans: + ans = max(A[i]-1,A[i+1]-1,ans) + print(i) + else: + print('No') + exit() + else: + print('No') + exit() +print('Yes')" +p02953,s457605192,Wrong Answer,"n = int(input()) +li = list(map(int,input().split())) +ans = ""Yes"" +max_n = 0 + +if n == 1: + print(ans) +else: + for i in li: + if i < max_n - 1: + ans = ""No"" + break + else: + max_n = max(i-1,max_n) +print(ans)" +p02953,s641986864,Wrong Answer,"from collections import Counter +a = int(input()) +num_list = list(map(int,input().split())) +flag = ""ok"" +num_o = 0 +for i in range(a-1): + if num_list[i] > num_o: + num_o = num_list[i]-1 + if num_list[i]-num_list[i+1] > 1: + flag = ""ng"" + break + +num_counter = Counter(num_list) +num_most = num_counter.most_common() +#if a == num_most[0][1] and a != 0: +# flag = ""No"" +if flag == ""ok"": + print(""Yes"") +else: + print(""No"")" +p02953,s573581671,Wrong Answer,"n=int(input());a=0 +h=list(map(int,input().split())) +for i in reversed(range(n)): + if h[i] 12 or b == 0: + print(""MMYY"") +else: + if b > 12 or b == 0: + print(""NA"") + elif b <= 12: + print(""YYMM"") + " +p03042,s571192124,Accepted,"S = input() +S1 = int(S[:2]) +S2 = int(S[2:]) + +if 1<=S1<=12 and 1<=S2<=12: + print('AMBIGUOUS') +elif 1<=S1<=12: + print('MMYY') +elif 1<=S2<=12: + print('YYMM') +else: + print('NA')" +p03042,s063918884,Accepted,"S = input() +l, r = map(int, [S[:2], S[2:]]) + +if 1 <= l <= 12 and 1 <= r <= 12: + print(""AMBIGUOUS"") +elif 1 <= l <= 12 and (r == 0 or r > 12): + print(""MMYY"") +elif (l == 0 or l > 12) and 1 <= r <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s177383271,Accepted,"S = input() +s01 = int(S[0]+S[1]) +s23 = int(S[2]+S[3]) +if (0 < s01 and s01 <= 12) and (0 < s23 and s23 <= 12): + print('AMBIGUOUS') + +elif (0 < s01 and s01 <= 12) and (s23 > 12 or s23 == 0): + print('MMYY') + +elif (s01 > 12 or s01 == 0) and (0 < s23 and s23 <= 12): + print('YYMM') +else: + print('NA')" +p03042,s618446437,Accepted,"S = input() + +if int(S[:2]) == 0 and 0 < int(S[2:]) <= 12: + print(""YYMM"") +elif int(S[2:]) == 0 and 0 < int(S[:2]) <= 12: + print(""MMYY"") +elif int(S[:2]) == 0 or int(S[2:]) == 0 or (int(S[:2]) > 12 and int(S[2:]) > 12): + print(""NA"") +elif int(S[:2]) > 12 and int(S[2:]) <= 12: + print(""YYMM"") +elif int(S[:2]) <= 12 and int(S[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s335813633,Accepted,"s = input() + +a = int(s[:2]) +b = int(s[2:]) + +if 0 < a <= 12 and 0 < b <= 12: + print(""AMBIGUOUS"") +elif (a > 12 or a == 0) and 0 < b <= 12: + print(""YYMM"") +elif 0 < a <= 12 and (b > 12 or b == 0): + print(""MMYY"") +else: + print(""NA"")" +p03042,s604381889,Accepted,"S = input() +l = S[:2] +r = S[2:] + +lcnt = 0 +rcnt = 0 +if 0 < int(l) <= 12: + lcnt = 1 +if 0 < int(r) <= 12: + rcnt = 1 +if lcnt and rcnt: + print('AMBIGUOUS') + exit() +elif lcnt: + print('MMYY') + exit() +elif rcnt: + print('YYMM') + exit() +else: + print('NA')" +p03042,s566798387,Accepted,"s = input() +a = s[:2] +b = s[2:] +if int(a) == 0 or int(a) > 12: + if int(b) == 0 or int(b) > 12: + print(""NA"") + else: + print (""YYMM"") +else: + if int(b) == 0 or int(b) > 13: + print (""MMYY"") + else: + print (""AMBIGUOUS"")" +p03042,s593677247,Accepted,"s = list(map(int,list(input()))) +a = s[0]*10+s[1] +b = s[2]*10+s[3] +if a == 0 and b == 0: + print('NA') + exit() +if 0 < a<= 12 and (b>12 or b==0): + print('MMYY') +elif (a > 12 or a==0) and 0 < b <= 12: + print('YYMM') +elif a <= 12 and b <= 12: + print('AMBIGUOUS') +else:print('NA')" +p03042,s237166446,Accepted,"x = int(input()) +a = x // 100 +b = x % 100 + +a_is_month = 0 < a & a <= 12 +b_is_month = 0 < b & b <= 12 + +if a_is_month: + if b_is_month: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if b_is_month: + print(""YYMM"") + else: + print(""NA"") + +" +p03042,s380698975,Accepted,"S = input() + +A, B = int(S[:2]), int(S[2:]) + +x = 0 <= A <= 99 and 1 <= B <= 12 +y = 1 <= A <= 12 and 0 <= B <= 99 + +if x and y: + print('AMBIGUOUS') +elif x: + print('YYMM') +elif y: + print('MMYY') +else: + print('NA') +" +p03042,s801183140,Accepted,"S = input() +if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12: + print(""AMBIGUOUS"") +elif 1 <= int(S[2:]) <= 12: + print(""YYMM"") +elif 1 <= int(S[:2]) <= 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s887562389,Accepted,"s = input() + +forward = s[:2] +backward = s[2:] +def check(s): + if 01 or (int(N[0])==1 and int(N[1])>2) or N[0:2]==""00"": + MM=0 +else: + MM=1 +if int(int(N[2]))>1 or (int(N[2])==1 and int(N[3])>2 or N[2:4]==""00""): + mm=0 +else: + mm=1 + +if MM+mm==2: + print(""AMBIGUOUS"") +elif MM==1: + print(""MMYY"") +elif mm==1: + print(""YYMM"") +else: + print(""NA"") + " +p03042,s882042379,Accepted,"s=input() +cand=[""0""+str(i) for i in range(1,10)]+[""10"",""11"",""12""] +if s[:2] in cand and s[2:] in cand: + print(""AMBIGUOUS"") +elif s[:2] in cand: + print(""MMYY"") +elif s[2:] in cand: + print(""YYMM"") +else: + print(""NA"")" +p03042,s667993177,Accepted,"def YY(x): + if 1<=x and x<=12: + return True + else: + return False +S=input() +A=int(S[0:2]) +B=int(S[2:4]) +if YY(A) and YY(B): + print(""AMBIGUOUS"") +elif YY(A): + print(""MMYY"") +elif YY(B): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s049263116,Accepted,"s=input() +up=s[0:2] +bot=s[2:4] +bot_m=True +up_m=True +if bot == ""00"" or int(bot) > 12: + bot_m=False +if up == ""00"" or int(up) > 12: + up_m=False +if bot_m and up_m: + print(""AMBIGUOUS"") +elif bot_m and not up_m: + print(""YYMM"") +elif not bot_m and up_m: + print(""MMYY"") +else: + print(""NA"")" +p03042,s721671297,Accepted,"s=(input()) +s1=int(s[:2]) +s2=int(s[2:]) + +if 1<= s1 <=12 and 1<= s2 <= 12: + print(""AMBIGUOUS"") + +elif 0<= s1 <=99 and 1<= s2 <= 12: + print(""YYMM"") + +elif 1<= s1 <=12 and 0<= s2 <= 99: + print(""MMYY"") + +else: + print(""NA"")" +p03042,s013075072,Accepted,"s=int(input()) +a=s//100 +b=s%100 +if a>0 and a<=12: + if b>0 and b<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if b>0 and b<=12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s520442879,Accepted,"s = input() + +s1 = int(s[0])*10 + int(s[1]) +s2 = int(s[2])*10 + int(s[3]) +#print(s1, s2) +if (s1>12 or s1==0) and (s2>12 or s2==0): + print('NA') +elif (s1>12 or s1==0) and 1<=s2<=12: + print('YYMM') +elif (s2>12 or s2==0) and 1<=s1<=12: + print('MMYY') +elif 1<=s1<=12 and 1<=s2<=12: + print('AMBIGUOUS')" +p03042,s786213098,Accepted,"from sys import exit +S = input() + +if 0 < int(S[0:2]) < 13: + if 0 < int(S[2:]) < 13: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 0 < int(S[2:]) < 13: + print(""YYMM"") + else: + print(""NA"")" +p03042,s017999452,Accepted,"s=input() + +s1=s[0]+s[1] +s2=s[2]+s[3] + +if (s1[0]=='0' and s1!='00') or s1=='11' or s1=='12': + ans1='MM' +else: + ans1='YY' + +if (s2[0]=='0' and s2!='00') or s2=='11' or s2=='12': + ans2='MM' +else: + ans2='YY' + +if ans1==ans2=='MM': + print('AMBIGUOUS') +elif ans1==ans2=='YY': + print('NA') +else: + print(ans1+ans2)" +p03042,s359845479,Accepted,"s = input() +a,b = int(s[:2]),int(s[2:]) + +c = 0 +if 1 <= a <= 12: + c += 1 +if 1 <= b <= 12: + c += 2 + +print(['NA', 'MMYY', 'YYMM', 'AMBIGUOUS'][c]) +" +p03042,s431216264,Accepted,"S = input() +S_a = int(S[0] + S[1]) +S_b = int(S[2] + S[3]) +if((S_a >= 1 and S_a <= 12) and (S_b < 1 or S_b > 12)): + print('MMYY') +elif((S_a < 1 or S_a > 12) and (S_b >= 1 and S_b <= 12)): + print('YYMM') +elif((S_a >= 1 and S_a <= 12) and (S_b >= 1 and S_b <= 12)): + print('AMBIGUOUS') +else: + print('NA')" +p03042,s068681613,Accepted,"s=int(input()) +s1=s//100 +s2=s%100 +if 12>=s1>=1 and 12>=s2>=1: + ans=""AMBIGUOUS"" +elif 12>=s1>=1 and not 12>=s2>=1: + ans=""MMYY"" +elif 12>=s2>=1 and not 12>=s1>=1: + ans=""YYMM"" +else: + ans=""NA"" +print(ans)" +p03042,s497262630,Accepted,"n=input() +if 1<=int(n[:2])<=12 and 1<=int(n[2:])<=12: + print(""AMBIGUOUS"") +elif 1<=int(n[:2])<=12: + print(""MMYY"") +elif 1<=int(n[2:])<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s317136708,Accepted,"S=input() +a=int(S[:2]) +b=int(S[2:]) +if 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS"") +elif 1<=a<=12 and (b>=13 or b==0): + print(""MMYY"") +elif a>=13 and (b>=13 or b==0): + print(""NA"") +elif a>=13 and 1<=b<=12: + print(""YYMM"") +elif a==0 and (b>=13 or b==0): + print(""NA"") +elif a==0 and (1<=b<=12): + print(""YYMM"")" +p03042,s208552089,Accepted,"S = input() + +if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + print('AMBIGUOUS') + exit() +elif 0 < int(S[:2]) <= 12: + print('MMYY') + exit() +elif 0 < int(S[2:]) <= 12: + print('YYMM') + exit() +else: + print('NA') + exit() +" +p03042,s904300599,Accepted,"s=str(input()) +a=""Y"" +b=""Y"" +if 0= 13 or s[:2] == '00') and (int(s[2:4]) >= 13 or s[2:4] == '00'): + print('NA') +elif 0 < int(s[:2]) <= 12 and 0 < int(s[2:4]) <= 12: + print('AMBIGUOUS') +elif 0 < int(s[:2]) <= 12: + print('MMYY') +else: + print('YYMM') + +" +p03042,s999230230,Accepted,"def check_month(month): + return 1 <= int(month) <= 12 + +S = input() + +ls = S[:2] +rs = S[2:] + +if check_month(ls) and check_month(rs): + print('AMBIGUOUS') +elif check_month(ls) and not check_month(rs): + print('MMYY') +elif not check_month(ls) and check_month(rs): + print('YYMM') +else: + print('NA')" +p03042,s604552400,Accepted,"S = int(input()) + +A = S//100 +B = S%100 + +if A >= 13 or A == 0: + if B >= 13: + print('NA') + elif B <13: + if B != 0: + print('YYMM') + else: + print('NA') +elif A < 13: + if B >= 13: + print('MMYY') + elif B < 13: + if B != 0: + print('AMBIGUOUS') + else: + print('MMYY') +" +p03042,s712129192,Accepted,"S = input() +f = int(S[:2]) +b = int(S[2:]) +if (not 0 < f <= 12) and 0 < b <= 12: + print('YYMM') +elif (not 0 < b <= 12) and 0 < f <= 12: + print('MMYY') +elif 0 < f <= 12 and 0 < b <= 12: + print('AMBIGUOUS') +else: + print('NA') +" +p03042,s101103080,Accepted,"# B - YYMM or MMYY + +s = str(input()) # 長さ4の数字列 + +def check(n): + if n > 0 and n <= 12: + return True + else: + return False + +mae = check(int(s[0:2])) +ato = check(int(s[2:4])) + +if mae and ato: + print('AMBIGUOUS') +elif mae and not ato: + print('MMYY') +elif not mae and ato: + print('YYMM') +else: + print('NA')" +p03042,s501461267,Accepted,"s = input() +if (1 <= int(s[0:2]) and int(s[0:2]) <= 12) and (1 <= int(s[2:4]) and int(s[2:4]) <= 12): + ans = ""AMBIGUOUS"" +elif (1 <= int(s[0:2]) and int(s[0:2]) <= 12) and (1 > int(s[2:4]) or int(s[2:4]) > 12): + ans = ""MMYY"" +elif (1 > int(s[0:2]) or int(s[0:2]) > 12) and (1 <= int(s[2:4]) and int(s[2:4]) <= 12): + ans = ""YYMM"" +else: + ans = ""NA"" +print (ans) +" +p03042,s964401722,Accepted,"S = input() +p = int(S[0:2]) +s = int(S[2:4]) + +if 1 <= p and p <= 12:#? + if 1<= s and s<=12:#?? + print(""AMBIGUOUS"") + else:#?Y + print(""MMYY"") + +else: + if 1<= s and s<=12:#Y? + print(""YYMM"") + else:#YY + print(""NA"") +" +p03042,s896528426,Accepted,"s = input() + +xx = s[0] + s[1] +yy = s[2] + s[3] +xx = int(xx) +yy = int(yy) + +if 1 <= xx <= 12: + if yy >= 13 or yy == 0: + print(""MMYY"") + else: + print(""AMBIGUOUS"") + +if xx == 0 or 13 <= xx <= 99: + if 1 <= yy <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s281770079,Accepted,"s = input() +a = 0 +b = 0 + +if s[2] == '0': b = int(s[3]) +else: b = int(s[2:]) +if s[0] == '0': a = int(s[1]) +else: a = int(s[:2]) + +if (b>=1 and b<=12) and (a>=1 and a<=12): print(""AMBIGUOUS"") +elif b>=1 and b<=12: print(""YYMM"") +elif a>=1 and a<=12: print(""MMYY"") +else: print(""NA"") " +p03042,s442532692,Accepted,"a = input() +if int(a[:2]) < 13 and int(a[:2]) > 0: + if int(a[2:4]) < 13 and int(a[2:4]) > 0: print('AMBIGUOUS') + else: print('MMYY') +elif int(a[2:]) < 13 and int(a[2:]) > 0: print('YYMM') +else: print('NA')" +p03042,s173979440,Accepted,"S = input() +ahead = S[0:2] +post = S[2:] + +if (ahead == '00' or int(ahead) > 12): + a_judge = True +else: + a_judge = False + +if (post == '00' or int(post) > 12): + p_judge = True +else: + p_judge = False + +if (a_judge and p_judge): + ans = 'NA' +elif (a_judge): + ans = 'YYMM' +elif (p_judge): + ans = 'MMYY' +else: + ans = 'AMBIGUOUS' + +print(ans)" +p03042,s351412933,Accepted,"s = input() +F = 0 < int(s[:2]) < 13 +S = 0 < int(s[2:]) < 13 +print(""AMBIGUOUS"" if F*S else ""YYMM"" if S else ""MMYY"" if F else ""NA"")" +p03042,s353879649,Accepted,"S = int(input()) + +L = S // 100 # 前半2桁 +R = S % 100 # 後半2桁 + +if L > 12 or L == 0: + if R > 12 or R == 0: print('NA') + else: print('YYMM') +else: + if R > 12 or R == 0: print('MMYY') + else: print('AMBIGUOUS')" +p03042,s946394060,Accepted,"s = int(input()) +a, b = s // 100, s % 100 +x = ""YY"" if a == 0 or a > 12 else ""MM"" +y = ""YY"" if b == 0 or b > 12 else ""MM"" +if x != y: + print(x + y) +else: + print(""NA"" if x == ""YY"" else ""AMBIGUOUS"") +" +p03042,s290966487,Accepted,"# 初期入力 +import sys +input = sys.stdin.readline +S =input().strip() + +s12 =int(S[:2]) +s34 =int(S[2:]) +mm=[1,2,3,4,5,6,7,8,9,10,11,12] +yy=[i for i in range(100)] +if s12 in yy and s12 in mm and s34 in yy and s34 in mm: + print(""AMBIGUOUS"") +elif s12 in yy and s34 in mm: + print(""YYMM"") +elif s12 in mm and s34 in yy : + print(""MMYY"") +else: + print(""NA"") +" +p03042,s974824295,Accepted,"s = input() +firstHalf = s[:2] +secondHalf = s[2:] +val1 = 0 +val2 = 0 +if firstHalf[0] == '0': + val1 = int(firstHalf[1]) +else: + val1 = int(firstHalf) +if secondHalf[0] == '0': + val2 = int(secondHalf[1]) +else: + val2 = int(secondHalf) +first = False +second = False +if val1 <= 12 and val1 > 0: + first = True +if val2 <= 12 and val2 > 0: + second = True +if first and second: + print(""AMBIGUOUS"") +elif first: + print(""MMYY"") +elif second: + print(""YYMM"") +else: + print(""NA"")" +p03042,s262451943,Accepted,"s = input() +if 1 <= int(s[0:2]) <= 12: + if 1 <= int(s[2:4]) <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= int(s[2:4]) <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s489861810,Accepted,"s = input() +mmyy = (1 <= int(s[:2]) <= 12) +yymm = (1 <= int(s[2:]) <= 12) +if mmyy: + if yymm: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if yymm: + print('YYMM') + else: + print('NA')" +p03042,s567095734,Accepted,"s = input() + +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) + +if s1 <= 12 and s2 <= 12 and s1 >= 1 and s2 >= 1: + print('AMBIGUOUS') +elif s1 <= 12 and s1 >= 1: + print('MMYY') +elif s2 <= 12 and s2 >= 1: + print('YYMM') +else: + print('NA')" +p03042,s265065326,Accepted,"s = str(input()) +top = int(s[:2]) +bottom = int(s[2:]) + +if 1 <= top <= 12 and 1 <= bottom <= 12: + print('AMBIGUOUS') +elif top > 12 and bottom > 12: + print('NA') +elif 1 <= top <= 12: + print('MMYY') +elif 1 <= bottom <= 12: + print('YYMM') +else: + print('NA')" +p03042,s324795336,Accepted,"s=input() + +YYMM=False +MMYY=False + +month=[] +for i in range(1,13): + if len(str(i))==1: + month.append(""0""+str(i)) + else: + month.append(str(i)) + +if s[:2] in month: + MMYY=True + +if s[2:] in month: + YYMM=True + +if MMYY is True and YYMM is True: + print(""AMBIGUOUS"") +elif MMYY is True and YYMM is False: + print(""MMYY"") +elif MMYY is False and YYMM is True: + print(""YYMM"") +else: + print(""NA"")" +p03042,s908996412,Accepted,"s=input() +a=(int(s[0])-0)*10+int(s[1]) +b=(int(s[2])-0)*10+int(s[3]) +if 1<=b<=12 and (1212: + #Y!=MANTH + if M==0 or M>12: + print(""NA"") + else: + print(""YYMM"") +else: + if M==0 or M>12: + print(""MMYY"") + else: + print(""AMBIGUOUS"") +" +p03042,s527421335,Accepted,"def main(): + S = input() + first = S[:2] + second = S[2:] + YYMM = False + MMYY = False + + if ""00"" <= first <= ""99"" and ""01"" <= second <= ""12"": + YYMM = True + if ""01"" <= first <= ""12"" and ""00"" <= second <= ""99"": + MMYY = True + + if YYMM and MMYY: + ans = ""AMBIGUOUS"" + elif YYMM: + ans = ""YYMM"" + elif MMYY: + ans = ""MMYY"" + else: + ans = ""NA"" + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p03042,s062683027,Accepted,"S = input() +a = 0 +b = 0 +if (S[0] == '0' and S[1] != '0') or (S[0] == '1' and (S[1] == '0' or S[1] == '1' or S[1] == '2')): + a = 1 +if (S[2] == '0' and S[3] != '0') or (S[2] == '1' and (S[3] == '0' or S[3] == '1' or S[3] == '2')): + b = 1 +if a == 1 and b == 1: + print(""AMBIGUOUS"") +elif a == 1: + print(""MMYY"") +elif b == 1: + print(""YYMM"") +else: + print(""NA"")" +p03042,s994623244,Accepted,"s = list(input()) + +a = int(s[0]+s[1]) +b = int(s[2]+s[3]) + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif (a>12 or a==0) and 1<=b<=12: + print('YYMM') +elif (b>12 or b==0) and 1<=a<=12: + print('MMYY') +elif (a>12 or a==0) and (b>12 or b==0): + print('NA')" +p03042,s122406254,Accepted,"S=input() +a=int(S[0]+S[1]) +b=int(S[2]+S[3]) +if 0 12 and 1 <= SE <= 12: + print(""YYMM"") +elif 1 <= F <= 12 and SE > 12: + print(""MMYY"") +elif 1 <= F <= 12 and 1 <= SE <= 12: + print(""AMBIGUOUS"") +elif F == 0 and 1 <= SE <= 12: + print(""YYMM"") +elif 1 <= F <= 12 and SE == 0: + print(""MMYY"") +else: + print(""NA"") + + + + + + +" +p03042,s224507052,Accepted,"s = list(input()) +head = int(s[0] + s[1]) +tail = int(s[2] + s[3]) + +if (0 < head < 13) and (0 < tail < 13): + print('AMBIGUOUS') +elif 0 < tail < 13: + print('YYMM') +elif 0 < head < 13: + print('MMYY') +else: + print('NA')" +p03042,s178225445,Accepted,"s = input() +bit_pre = 0 +bit_post = 0 +if 1 <= int(s[:2]) and int(s[:2]) <= 12: + bit_pre = 1 +if 1 <= int(s[2:]) and int(s[2:]) <= 12: + bit_post = 1 +if bit_pre and bit_post: + print(""AMBIGUOUS"") +elif bit_pre: + print(""MMYY"") +elif bit_post: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s529521987,Accepted,"dList = list(str(input())) + +former = int(''.join([dList[0],dList[1]])) +latter = int(''.join([dList[2],dList[3]])) + +if 1 <= former <= 12: + if 1<= latter<= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif former > 12: + if 1<= latter<= 12: + print(""YYMM"") + else: + print(""NA"") +else: + if latter == 0 or latter > 13: + print(""NA"") + else: + print(""YYMM"") + " +p03042,s925671206,Accepted,"S=input() +a=int(S[:2]) +b=int(S[2:]) +if 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS"") +elif 1<=a<=12: + print(""MMYY"") +elif 1<=b<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s852248042,Accepted,"import sys + +s = sys.stdin.readline().rstrip() + +def main(): + a, b = int(s[:2]), int(s[2:]) + if 1 <= a <= 12: + if 1 <= b <= 12: + return 'AMBIGUOUS' + else: + return 'MMYY' + else: + if 1 <= b <= 12: + return 'YYMM' + else: + return 'NA' + +if __name__ == '__main__': + ans = main() + print(ans)" +p03042,s562113803,Accepted,"S = input() + +s1 = int(S[0:2]) +s2 = int(S[2:4]) + +if 1 <= s1 <= 12 : + if 1<= s2 <= 12: + print(""AMBIGUOUS"") + else : + print(""MMYY"") +elif 1 <= s2 <= 12: + print(""YYMM"") +else : + print(""NA"") +" +p03042,s314231908,Accepted,"s = input() +first = int(s[:2]) +second = int(s[2:]) +if 1 <= first <= 12: + if 1 <= second <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 1 <= second <= 12: + print('YYMM') + else: + print('NA')" +p03042,s805726104,Accepted,"S = input() + +MM = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] + +if S[0:2] in MM and S[2:4] in MM: + print('AMBIGUOUS') +elif S[0:2] in MM: + print('MMYY') +elif S[2:4] in MM: + print('YYMM') +else: + print('NA') +" +p03042,s359454764,Accepted,"S=input() +s1=S[0:2] +s2=S[2:4] +li=[""01"",""02"",""03"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if s1 not in li: + a=False +else: + a=True +if s2 not in li: + b=False +else: + b=True + +if a==b==True: + print(""AMBIGUOUS"") +elif a==b==False: + print(""NA"") +elif a==True: + print(""MMYY"") +else: + print(""YYMM"") +" +p03042,s538517105,Accepted,"S = input() +s1 = S[0] + S[1] +s2 = S[2] + S[3] + +if ""00"" < s1 < ""13"" and ""00"" < s2 < ""13"" : + print(""AMBIGUOUS"") +elif ""00"" < s2 < ""13"" : + print(""YYMM"") +elif ""00"" < s1 < ""13"" : + print(""MMYY"") +else : + print(""NA"") +" +p03042,s665328946,Accepted,"s = (input()) +a= s[0:2] +b= s[2:4] +a = int(a) +b= int(b) +if a == 0 or b == 0: + if b!= 0 and b<13: + print('YYMM') + elif a!= 0 and a<13: + print('MMYY') + else: + print('NA') +elif a<13 or b<13: + if a>12: + print('YYMM') + elif b>12: + print('MMYY') + else: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s924891932,Accepted,"def main(): + S = input().rstrip() + v1 = int(S[:2]) + v2 = int(S[2:]) + if 1 <= v1 <= 12 and 1 <= v2 <= 12: + print(""AMBIGUOUS"") + elif 1 <= v1 <= 12 and (v2 >= 13 or v2 == 0): + print(""MMYY"") + elif (v1 >= 13 or v1 == 0) and 1 <= v2 <= 12: + print(""YYMM"") + else: + print(""NA"") + + +if __name__ == '__main__': + main() +" +p03042,s295978892,Accepted," +s=int(input()) +a=s//100 +b=s%100 +if 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS"") +elif 1<=a<=12 and not 1<=b<=12: + print(""MMYY"") +elif 1<=b<=12 and not 1<=a<=12: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s435221049,Accepted,"s=input() +ym=True if 0 < int(s[2:]) < 13 else False +my=True if 0 < int(s[:2]) < 13 else False +if my and ym: + print('AMBIGUOUS') +elif my: + print('MMYY') +elif ym: + print('YYMM') +else: + print('NA')" +p03042,s837786080,Accepted,"def is_month(t): + return 1 <= int(t) <= 12 + +s = input() +pre, suf = s[:2], s[2:] + +if is_month(pre) and is_month(suf): + print('AMBIGUOUS') +elif not is_month(pre) and not is_month(suf): + print('NA') +elif is_month(pre) and not is_month(suf): + print('MMYY') +else: + print('YYMM') +" +p03042,s831448547,Accepted,"# 126 B + +s = input() + +fir = int(s[:2]) +sec = int(s[2:]) + +if fir > 0 or sec > 0: + if 1 <= fir <= 12 and 1 <= sec <= 12 : + print(""AMBIGUOUS"") + elif 1 <= fir <= 12: + print(""MMYY"") + elif 1 <= sec <= 12: + print(""YYMM"") + else: + print(""NA"") +else: + print(""NA"") +" +p03042,s845030660,Accepted,"x = input() +a, b = int(x[0:2]), int(x[2:4]) +flag = 0 +ans = [""AMBIGUOUS"", ""YYMM"", ""MMYY"", ""NA""] + +if (a >= 1 and a <= 12) and (b >= 1 and b <= 12): + flag = 0 +elif (a == 0 and b > 12) or (b == 0 and a > 12) or (b > 12 and a > 12) or (b == 0 and a == 0): + flag = 3 +elif ((a > 0 and a <= 12) and (b >= 13)) or (b == 0 and (a >= 1 and a <= 12)): + flag = 2 +elif ((a >= 13) and (b > 0 and b <= 12)) or (a == 0 and (b >= 1 and b <= 12)): + flag = 1 + + +print(ans[flag]) +" +p03042,s864958000,Accepted,"s=str(input()) +a=s[:2] +b=s[-2:] +m=['01','02','03','04','05','06','07','08','09','10','11','12'] +if a not in m and b in m: + print('YYMM') +elif a in m and b not in m: + print('MMYY') +elif a in m and b in m: + print('AMBIGUOUS') +else: + print('NA') + " +p03042,s657800967,Accepted,"n = input() +a = int(n[0]+n[1]) +b = int(n[2]+n[3]) + +if 1 <= a <= 12 and 1 <= b <=12: + print(""AMBIGUOUS"") +elif 1 <= b <= 12: + print(""YYMM"") +elif 1 <= a <= 12 : + print(""MMYY"") +else: + print(""NA"") +" +p03042,s667870863,Accepted,"s = raw_input() +print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[tuple(map(int,list(tuple([(00 and b<13 +cMMYY=a>0 and a<13 +#print(a,b) +#print([""NO"",""YES""][1-cond]) +print([[""NA"",""YYMM""],[""MMYY"",""AMBIGUOUS""]][cMMYY][cYYMM]) + +" +p03042,s750856940,Accepted,"s = input() +a = 1 <= int(s[:2]) <= 12 +b = 1 <= int(s[2:]) <= 12 +if a and b: + print(""AMBIGUOUS"") +elif a: + print(""MMYY"") +elif b: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s785071528,Accepted,"S = input() +S_front = S[:2] +S_back = S[2:] + +if 0 < int(S_front) < 13: + if 0 < int(S_back) < 13: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 0 < int(S_back) < 13: + print(""YYMM"") + else: + print(""NA"")" +p03042,s974792750,Accepted,"s = input() + +s_a = int(s[:2]) +s_b = int(s[2:]) + +if s_a >= 1 and s_a <=12 and s_b >= 1 and s_b <=12: + ans = ""AMBIGUOUS"" +elif (s_a > 12 or s_a == 0) and s_b >= 1 and s_b <=12: + ans = ""YYMM"" +elif (s_b > 12 or s_b == 0) and s_a >= 1 and s_a <=12: + ans = ""MMYY"" +else: + ans = ""NA"" + +print(ans)" +p03042,s706509786,Accepted,"s = input() + +y = int(s[:2]) +m = int(s[2:]) +if 1 <= y <= 12 and 1 <= m <= 12: + print(""AMBIGUOUS"") +elif 1 <= y <= 12: + print(""MMYY"") +elif 1 <= m <= 12: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s502975304,Accepted,"def solve(): + S = input() + l = int(S[:2]) + r = int(S[2:]) + + if 1 <= l <= 12: + if 1 <= r <= 12: + return 'AMBIGUOUS' + else: + return 'MMYY' + else: + if 1 <= r <= 12: + return 'YYMM' + else: + return 'NA' + +print(solve())" +p03042,s325202898,Accepted,"s = input() +if int(s[:2]) >= 1 and int(s[:2]) <= 12 and int(s[2:]) >= 1 and int(s[2:]) <= 12: + print('AMBIGUOUS') +elif int(s[:2]) >= 1 and int(s[:2]) <= 12: + print('MMYY') +elif int(s[2:]) >= 1 and int(s[2:]) <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s465770556,Accepted,"s = input() +a = 1<= int(s[:2]) <=12 +b = 1<= int(s[2:]) <=12 +if a and b: + print(""AMBIGUOUS"") +elif a: + print('MMYY') +elif b: + print('YYMM') +else: + print('NA')" +p03042,s988296026,Accepted,"S = input() + +from datetime import datetime as dt + +ans = 0 + +#x = dt.strptime(S, ""%Y%m"") + +try: + x = dt.strptime(""20""+S, ""%Y%m"") + ans_s = ""YYMM"" +except: + ans += 1 +try: + dt.strptime(S[:2] + ""20"" + S[2:], ""%m%Y"") + ans_s = ""MMYY"" +except: + ans += 1 + +if ans == 2: + print(""NA"") +elif ans == 0: + print(""AMBIGUOUS"") +else: + print(ans_s)" +p03042,s157210246,Accepted,"s = list(input()) +s1 = ''.join(s[:2]) +s2 = ''.join(s[2:]) +flag1 = False +flag2 = False +if 1 <= int(s1) and int(s1) <= 12: + flag1 = True +if 1 <= int(s2) and int(s2) <= 12: + flag2 = True +if flag1 and flag2: + print('AMBIGUOUS') +elif flag1: + print('MMYY') +elif flag2: + print('YYMM') +else: + print('NA') +" +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"") +" +p03042,s804069295,Accepted,"s=int(input()) +s1=s//100 +s2=s-s1*100 +if 012 or s1==0) and 012 or s2==0): + print(""MMYY"") +else: + print(""NA"")" +p03042,s068370482,Accepted,"S=input() + +if 1<=int(S[:2])<=12: + if 1<=int(S[2:])<=12: + print(""AMBIGUOUS"") + elif 0<=int(S[2:])<=99: + print(""MMYY"") +elif 0<=int(S[:2])<=99: + if 1<=int(S[2:])<=12: + print(""YYMM"") + elif 0<=int(S[2:])<=99: + print(""NA"") + +" +p03042,s232671388,Accepted,"S = input() +mm = [""0""+str(x) for x in range(1,10)]+[""10"",""11"",""12""] +mmyy = (S[:2] in mm) +yymm = (S[2:] in mm) +a = ""NA"" + +if yymm and mmyy: + a = ""AMBIGUOUS"" +elif yymm: + a = ""YYMM"" +elif mmyy: + a = ""MMYY"" + +print(a)" +p03042,s089528988,Accepted," +import sys +sys.setrecursionlimit(10 ** 5 + 10) +def input(): return sys.stdin.readline().strip() + +def resolve(): + s=input() + s1=s[:2] + s2=s[2:] + l=['01','02','03','04','05','06','07','08','09','10','11','12'] + if s1 in l and s2 in l: + print('AMBIGUOUS') + elif s1 in l and s2 not in l: + print('MMYY') + elif s1 not in l and s2 in l: + print('YYMM') + else: + print('NA') +resolve()" +p03042,s422547591,Accepted,"s = input() + +i1 = int(s[:2]) +i2 = int(s[2:]) + + + +def f(i): + if (0 < i < 13): + return 1 + elif (0 < i < 100): + return 2 + else: + return 0 + + +f1 = f(i1) +f2 = f(i2) + +if (f1 == 1): + if (f2 == 1): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if (f2 == 1): + print(""YYMM"") + else: + print(""NA"") + + +" +p03042,s169131366,Accepted,"n=input() + +n1,n2=int(n[:2]),int(n[2:]) +if (n1>12 and n2>12) or (n1==0 and n2==0): + print(""NA"") +elif (n1!=0 and n1<=12) and (n2!=0 and n2<=12): + print(""AMBIGUOUS"") +elif n1!=0 and n1<=12: + print(""MMYY"") +elif n2!=0 and n2<=12: + print(""YYMM"") +else: + print(""NA"") + + + + " +p03042,s731382819,Accepted,"s=input() +s1=int(s[0:2]) +s2=int(s[2:]) + +if (s1==0 or s1>12) and (s2==0 or s2>12): + print(""NA"") +elif (s1>0 and s1<=12) and ((s2>0 and s2<=12)): + print(""AMBIGUOUS"") +elif (s1>0 and s1<=12) and (s2==0 or s2>12): + print(""MMYY"") +else: + print(""YYMM"") +" +p03042,s049584986,Accepted,"import sys +A=int(sys.stdin.readline(2)) +D=int(sys.stdin.readline(2)) +if A>=1 and A<=12: + if D>=1 and D<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif D>=1 and D<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s366259675,Accepted,"S = input() +left = int(S[:2]) +right = int(S[2:]) +year_flag = [0, 0] + +if left > 12 or left == 0: + year_flag[0] += 1 +if right > 12 or right == 0: + year_flag[1] += 1 + +if sum(year_flag) == 2: + print('NA') +elif sum(year_flag) == 0: + print('AMBIGUOUS') +elif year_flag[0] == 1: + print('YYMM') +else: + print('MMYY') +" +p03042,s030475600,Accepted,"a=int(input()) +x=a//100 +y=a%100 +c=False +d=False +if 1<= x<=12: + c=True +if 1<= y<=12: + d=True +if c==True and d==True: + print(""AMBIGUOUS"") +if c==True and d==False: + print(""MMYY"") +if c==False and d==True: + print(""YYMM"") +if c==False and d==False: + print(""NA"")" +p03042,s600884407,Accepted,"S = input() +s1 = int(S[:2]) +s2 = int(S[2:]) + +if 1 <= s1 <= 12: + if 1 <= s2 <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= s2 <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s190436773,Accepted,"def is_month(x): + if 1 <= x <= 12: + return True + else: + return False + +S = input() +first, latter = is_month(int(S[:2])), is_month(int(S[2:])) +if first and latter: + ans = ""AMBIGUOUS"" +elif not first and not latter: + ans = ""NA"" +elif first: + ans = ""MMYY"" +else: + ans = ""YYMM"" +print(ans)" +p03042,s739468472,Accepted,"import sys +def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし + +S = LI2() + +a = 10*S[0]+S[1] +b = 10*S[2]+S[3] + +if 1 <= a <= 12 and 1 <= b <= 12: + print('AMBIGUOUS') +elif not 1 <= a <= 12: + if 1 <= b <= 12: + print('YYMM') + else: + print('NA') +else: + print('MMYY') + +" +p03042,s848770382,Accepted,"def main(): + S = str(input()) + front = int(S[0:2]) + latter = int(S[2:4]) + if front < 13 and latter < 13 and (front > 0 and latter > 0): + print('AMBIGUOUS') + elif front < 13 and latter < 100 and front > 0: + print('MMYY') + elif front < 100 and latter < 13 and latter > 0: + print('YYMM') + else: + print('NA') +main()" +p03042,s233626836,Accepted,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if 012 and n2>12) or (n1==0 and n2==0): +# print(""NA"") +if (n1!=0 and n1<=12) and (n2!=0 and n2<=12): + print(""AMBIGUOUS"") +elif n1!=0 and n1<=12: + print(""MMYY"") +elif n2!=0 and n2<=12: + print(""YYMM"") +else: + print(""NA"") + + + +" +p03042,s372494948,Accepted,"def is_month( n :int ): + return ( 1 <= n ) and ( n <= 12 ) + +def judge( first, second ): + if (first and second): + return ""AMBIGUOUS"" + elif (first and not(second)): + return ""MMYY"" + elif (not( first ) and second): + return ""YYMM"" + else: + return ""NA"" + +s = input() +first = is_month( int( s[0:2] )) +second = is_month( int( s[2:4] )) +print( judge( first, second ) )" +p03042,s421774401,Accepted,"S=input() + +a=int(S[:2]) +b=int(S[2:]) + +if(1<=a<=12 and 1<=b<=12): + print(""AMBIGUOUS"") +elif(1<=a<=12): + print(""MMYY"") +elif(1<=b<=12): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s098347605,Accepted,"S = input() +f, l = S[:2], S[2:] + +if 1 <= int(f) <= 12 and 1 <= int(l) <= 12: + print('AMBIGUOUS') +elif 1 <= int(f) <= 12: + print('MMYY') +elif 1 <= int(l) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s832183039,Accepted,"#!/usr/bin/env python3 + +s = str(input()) + +a = s[0:2] + +b = s[2:] + + +def div(a): + a = int(a) + if a <= 12 and a >= 1: + return ""BOTH"" + else: + return ""YY"" + + +if div(a) == div(b): + if div(a) == ""YY"": + print(""NA"") + else: + print(""AMBIGUOUS"") +elif div(a) == ""YY"": + print(""YYMM"") +else: + print(""MMYY"") +" +p03042,s753494786,Accepted,"S= input() + +f=int(S[0]+S[1]) +r=int(S[2]+S[3]) + +if f>=1 and f<=12 and r>=1 and r<=12: + print('AMBIGUOUS') +elif (r>=1 and r<=12): + print('YYMM') +elif (f>=1 and f<=12): + print('MMYY') +else: + print('NA') + " +p03042,s837286424,Accepted,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if a <= 12 and b <= 12: + if a==0 and b!=0: + print(""YYMM"") + elif b==0 and a!=0: + print(""MMYY"") + elif a==0 and b==0: + print(""NA"") + else: + print(""AMBIGUOUS"") +elif a<=12 and b>12: + if a==0: + print(""NA"") + else: + print(""MMYY"") +elif a>12 and b<=12: + if b==0: + print(""NA"") + else: + print(""YYMM"") +else: + print(""NA"")" +p03042,s706572767,Accepted,"s=input() +m=int(s[:2]) +n=int(s[2:]) +flag1=1<=m and m<=12 +flag2=1<=n and n<=12 +if flag1 and flag2 : print(""AMBIGUOUS"") +elif flag1 : print(""MMYY"") +elif flag2 : print(""YYMM"") +else : print(""NA"")" +p03042,s257346894,Accepted,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=b<=12: + print('YYMM') +elif 1<=a<=12: + print('MMYY') +else: + print('NA') +" +p03042,s034850695,Accepted,"s=input() + +if 12=int(s[2:])>=1: + print(""YYMM"") + else: + print(""NA"") +elif 1<=int(s[:2])<=12: + if 12>=int(s[2:])>=1: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + +" +p03042,s243679612,Accepted,"S=input() +x=int(S[:2]) +y=int(S[2:]) + +if 0 0 and MM <= 12 and MM > 0: + print(""AMBIGUOUS"") +elif YY <= 12 and YY > 0 and (MM >= 13 or MM == 0): + print(""MMYY"") +elif (YY == 0 or YY >= 13) and MM <= 12 and MM > 0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s759788736,Accepted,"#126 b +def change(x): + if 1<=x<=12: + return 0 + else: + return 1 +ans=[""AMBIGUOUS"",""NA"",""MMYY"",""YYMM""]#[00,11,01,10] +s=input() +a=change(int(s[:2])) +b=change(int(s[2:])) +if a==b: + print(ans[a]) +else: + print(ans[a+2])" +p03042,s209277635,Accepted,"s = input() + +a = s[:2] +b = s[-2:] + +mm = [""01"",""02"",""03"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if a in mm and b in mm: + print(""AMBIGUOUS"") +elif a in mm: + print(""MMYY"") +elif b in mm: + print(""YYMM"") +else: + print(""NA"") + + + + + + + + +" +p03042,s541253151,Accepted,"S = input() +f = int(S[:2]) +l = int(S[2:]) +if f==0 or f>12: + if l==0 or l>12: + print(""NA"") + else: + print(""YYMM"") +else: + if l==0 or l>12: + print(""MMYY"") + else: + print(""AMBIGUOUS"")" +p03042,s033991968,Accepted,"S = list(map(int, input())) + +if 0 12): + print(""MMYY"") +elif (L == 0 or L > 12) and 1 <= R <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s507027142,Accepted,"S=input() +left=int(S[:2]) +right=int(S[2:]) +mmyy,yymm=False,False +if 12>=left and left>=1: + mmyy=True +if 12>=right and right>=1: + yymm=True + +if mmyy==True and yymm==False: + print('MMYY') +elif mmyy==False and yymm==True: + print('YYMM') +elif mmyy==True and yymm==True: + print('AMBIGUOUS') +else: + print('NA') +" +p03042,s899513452,Accepted,"z = input() +x = int(z[:2]) +y = int(z[2:]) + +if (0= 1 and int(l) <=12 and int(r) <= 12 and int(r) >= 1): + print('AMBIGUOUS') +else : + if(int(l) <= 12 and int(l) >= 1): + print('MMYY') + else: + if(int(r) <= 12 and int(r) >= 1): + print('YYMM') + else: + print('NA') + " +p03042,s778355065,Accepted,"s = input() +head = int(s[:2]) +tail = int(s[2:]) + +is_mmyy = False +is_yymm = False + +if 1 <= head <= 12: + is_mmyy = True + +if 1 <= tail <= 12: + is_yymm = True + +if is_yymm and is_mmyy: + print('AMBIGUOUS') +elif is_yymm: + print('YYMM') +elif is_mmyy: + print('MMYY') +else: + print('NA') +" +p03042,s886555798,Accepted,"S = input() +s1,s2 = int(S[0:2]),int(S[2:4]) + +def f(n): + if n >= 1 and n <= 12: + return True + else: + return False + +if f(s1) and f(s2): + print(""AMBIGUOUS"") +elif f(s1) and (s2 > 12 or s2 ==0): + print(""MMYY"") +elif f(s2) and (s1 > 12 or s1 ==0): + print(""YYMM"") +else: + print(""NA"")" +p03042,s501816652,Accepted,"s = list(input()) +if int(s[0])*10 + int(s[1]) > 12 or int(s[0]) + int(s[1]) == 0: + if int(s[2])*10 + int(s[3]) <= 12 and int(s[2]) + int(s[3]) != 0: + print(""YYMM"") + else: + print(""NA"") + +else: + if int(s[2])*10 + int(s[3]) > 12 or int(s[2]) + int(s[3]) == 0: + print(""MMYY"") + else: + print(""AMBIGUOUS"")" +p03042,s441200551,Accepted,"s = input() +first = int(s[:2]) +second =int(s[2:]) + +if (first > 0 and first < 13) and (second > 0 and second < 13): + print(""AMBIGUOUS"") +elif (first > 0 and first < 13): + print(""MMYY"") +elif (second > 0 and second < 13): + print('YYMM') +else: + print('NA') + +" +p03042,s003516453,Accepted,"S=input() +a=int(S[:2]) +b=int(S[2:]) +ans=0 +lab=[""NA"",""MMYY"",""YYMM"",""AMBIGUOUS""] + +if a>=1 and a<=12: + ans+=1 + +if b>=1 and b<=12: + ans+=2 + +print(lab[ans])" +p03042,s787036967,Accepted,"s = int(input()) +a, b = s // 100, s % 100 +x = ""YY"" if a == 0 or a > 12 else ""MM"" +y = ""YY"" if b == 0 or b > 12 else ""MM"" +print(x + y if x != y else ""NA"" if x == ""YY"" else ""AMBIGUOUS"") +" +p03042,s925911912,Accepted,"S = input() + +former = int(S[:2]) +latter = int(S[2:]) + +if((former >= 13 or former == 0) and 1 <= latter <= 12): + print(""YYMM"") +if((latter >= 13 or latter == 0) and 1 <= former <= 12): + print(""MMYY"") +if(1 <= former <= 12 and 1 <= latter <= 12): + print(""AMBIGUOUS"") +if((former >= 13 or former == 0) and (latter >= 13 or latter == 0)): + print(""NA"")" +p03042,s840957118,Accepted,"s = input() +a = list(map(str, range(1, 10))) +b = list(map(str, range(0, 3))) +mm = 0 +ba = 0 +for i in [0, 2]: + if s[i] == ""0"" and s[i+1] in a: + mm += 1 + ba = i + elif s[i] == ""1"" and s[i+1] in b: + mm += 1 + ba = i +if mm == 0: + print(""NA"") +elif mm == 1 and ba == 0: + print(""MMYY"") +elif mm == 1 and ba == 2: + print(""YYMM"") +elif mm == 2: + print(""AMBIGUOUS"")" +p03042,s146707977,Accepted,"import sys +input=sys.stdin.readline + +s=input() + + +if 0= 13 or l == 0) and 1 <= r <= 12: + print('YYMM') + elif 1 <= l <= 12 and (r >= 13 or r == 0): + print('MMYY') + elif 1 <= l <= 12 and 1 <= r <= 12: + print('AMBIGUOUS') + else: + print('NA') + + +if __name__ == ""__main__"": + setrecursionlimit(10000) + main() +" +p03042,s814875230,Accepted,"S=input() +F=int(S[:2]) +L=int(S[2:]) + +if 012 or int(s2)==0): + print(""MMYY"") +elif 012 or int(s1)==0): + print(""YYMM"") +else: + print(""NA"")" +p03042,s857125249,Accepted,"s=int(input()) +a=s//100 +b=s-a*100 +if a<13 and b<13 and a>0 and b>0: + print(""AMBIGUOUS"") +elif a<13 and a>0: + print(""MMYY"") +elif b<13 and b>0: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s138907198,Accepted,"def check_month(n): + return 1 <= n <= 12 +def check_year(n): + return 0 <= n <= 99 + +S = input() +Y = int(S[:2]) +M = int(S[2:]) +if check_month(Y) and check_month(M): + print('AMBIGUOUS') +elif check_month(Y) and check_year(M): + print('MMYY') +elif check_year(Y) and check_month(M): + print('YYMM') +else: + print('NA')" +p03042,s942409742,Accepted,"S = input() +a = int(S[0]+S[1]) +b = int(S[2]+S[3]) +if a > 12 and b >12: + print('NA') +if (a == 0 and b >12) or (b ==0 and a > 12) or (a==0 and b ==0): + print('NA') +elif a == 0: + print('YYMM') +elif b == 0: + print('MMYY') +elif a <= 12 and b <= 12: + print('AMBIGUOUS') +elif a <= 12 and b > 12: + print('MMYY') +elif a > 12 and b <= 12: + print('YYMM')" +p03042,s889727188,Accepted,"s = input() + +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +#print(s1, s2) +L=[] + +for i in range(1, 13): + L.append(i) + + +if s1 not in L and s2 not in L: + print('NA') +elif s1 in L and s2 not in L: + print('MMYY') +elif s1 not in L and s2 in L: + print('YYMM') +else: + print('AMBIGUOUS') +" +p03042,s620062110,Accepted,"s = str(input()) +a = int(s[0]) * 10 + int(s[1]) +b = int(s[2]) * 10 + int(s[3]) +if 1 <= a <= 12 and 1 <= b <= 12: + print('AMBIGUOUS') +elif 1 <= a <= 12: + print('MMYY') +elif 1 <= b <= 12: + print('YYMM') +else: + print('NA')" +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"") + + " +p03042,s773491048,Accepted,"S = str(input()) + +f, r = map(int, (S[:2], S[2:])) +ans = '' +if 1 <= f <= 12 and 1 <= r <= 12: + ans = 'AMBIGUOUS' +elif 1 <= f <= 12: + ans = 'MMYY' +elif 1 <= r <= 12: + ans = 'YYMM' +else: + ans = 'NA' + +print(ans)" +p03042,s638328912,Accepted,"S = input() +l, r = map(int, [S[:-2], S[2:]]) + +if 0 < l < 13: + if 0 < r < 13: + print('AMBIGUOUS') + exit() + else: + print('MMYY') +else: + if 0 < r < 13: + print('YYMM') + else: + print('NA')" +p03042,s860837981,Accepted,"s = int(input()) +L, R = divmod(s, 100) +if 0 < L < 13: + if 0 < R < 13: + print('AMBIGUOUS') + else: + print('MMYY') +elif 0 < R < 13: + print('YYMM') +else: + print('NA')" +p03042,s668361463,Accepted,"s = int(input()) +s1 = s // 100 +s2 = s % 100 +c = 0 +l = [""NA"",""YYMM"",""MMYY"",""AMBIGUOUS""] +if 1<=s2<=12: + c += 1 +if 1<=s1<=12: + c += 2 +print(l[c])" +p03042,s470216451,Accepted,"import datetime + +s = input() +ans = [['NA', 'MMYY'], ['YYMM', 'AMBIGUOUS']] + +try: + datetime.datetime.strptime(s,""%y%m"") + ans1 = 1 +except ValueError: + ans1 = 0 + +try: + datetime.datetime.strptime(s,""%m%y"") + ans2 = 1 +except ValueError: + ans2 = 0 + +print(ans[ans1][ans2]) +" +p03042,s803437008,Accepted,"S = input() +AA = int(S[:2]) +BB = int(S[2:]) +if (1 <= AA <= 12) and (1 <= BB <= 12): + print('AMBIGUOUS') +elif (13 <= AA or AA == 0) and (1 <= BB <= 12): + print('YYMM') +elif (1 <= AA <= 12) and (13 <= BB or BB == 0): + print('MMYY') +else: + print('NA')" +p03042,s592425042,Accepted,"s = list(input()) +a = int(s[0]) +b = int(s[1]) +c = int(s[2]) +d = int(s[3]) + +mae = a*10 + b +ushiro = c*10 + d +if mae <= 12 and mae != 0: + if ushiro <= 12 and ushiro != 0: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if ushiro <= 12 and ushiro != 0: + print(""YYMM"") + else: + print(""NA"")" +p03042,s373757874,Accepted," +s = list(input()) +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) + +if (a == 0 or 13 <= a <= 99) and (b != 0 and 1 <= b <= 12): + print(""YYMM"") +elif (1 <= a <= 12) and (b == 0 or 13 <= b <=99): + print(""MMYY"") +elif 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"") +" +p03042,s610121220,Accepted,"S = input() + +def is_yymm(s): + if 1<=int(s)<=12: + return ""both"" + else: + return ""YY"" + +left = is_yymm(S[:2]) +right = is_yymm(S[2:]) + +ans = left + right + +if ans==""YYboth"": + print(""YYMM"") +elif ans==""bothYY"": + print(""MMYY"") +elif ans==""bothboth"": + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s807853129,Accepted,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if (1 <= a <= 12) and (1 <= b <= 12): + print(""AMBIGUOUS"") +elif (1 <= a <= 12): + print(""MMYY"") +elif (1 <= b <= 12): + print(""YYMM"") +else: + print(""NA"")" +p03042,s851542570,Accepted,"import math + + +def main(): + # n = int(input()) + # n, k = map(int, input().split()) + # h = list(map(int, input().split())) + s = input() + # h = [int(input()) for _ in rane(n)] + f = int(s[:2]) + b = int(s[2:]) + if 1 <= f and f <= 12 and 1 <= b and b <= 12: + print(""AMBIGUOUS"") + elif 0 <= f and f <= 99 and 1 <= b and b <= 12: + print(""YYMM"") + elif 0 <= b and b <= 99 and 1 <= f and f <= 12: + print(""MMYY"") + else: + print(""NA"") + + +if __name__ == '__main__': + main() +" +p03042,s007558566,Accepted,"S = input() + +first = int(S[0:2]) +last = int(S[2:4]) + +if (0 < first < 13): + if (0 < last < 13): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if (0 < last < 13): + print(""YYMM"") + else: + print(""NA"")" +p03042,s206218232,Accepted,"s = input() + +s_1 = int(s[0:2]) +s_2 = int(s[2:4]) + +if (s_1>12 or s_1<1) and (s_2>12 or s_2<1): + print('NA') +elif s_1<=12 and s_1>=1 and s_2<=12 and s_2>=1: + print('AMBIGUOUS') +elif s_1<=12 and s_1>=1: + print('MMYY') +else: + print('YYMM')" +p03042,s592686612,Accepted,"s = input() + +l = int(s[0:2]) +r = int(s[2:4]) + +if (l == 00 and r == 00) or (l>12 and r > 12) or (l == 00 and r > 12) or(l > 12 and r == 00): + print(""NA"") +elif l > 12 and r < 13: + print(""YYMM"") +elif l < 13 and r > 12: + print(""MMYY"") +elif l == 00 and r < 13: + print(""YYMM"") +elif l < 13 and r == 00: + print(""MMYY"") +elif l <= 12 and r <= 12: + print(""AMBIGUOUS"")" +p03042,s489191701,Accepted,"s = input() +s1 = int(s[:2]) +s2 = int(s[2:]) +m = range(1,13) +if s1 in m and s2 in m: + print('AMBIGUOUS') +elif s1 in m: + print('MMYY') +elif s2 in m: + print('YYMM') +else: + print('NA')" +p03042,s952268232,Accepted,"S = input() +if int(S[:2]) != 0 and int(S[:2]) <= 12: + if int(S[2:]) != 0 and int(S[2:]) <= 12: print(""AMBIGUOUS"") + else:print(""MMYY"") +else: + if int(S[2:]) != 0 and int(S[2:]) <= 12: print(""YYMM"") + else:print(""NA"")" +p03042,s352056546,Accepted,"s=input() +f=int(s[:2]) +b=int(s[2:]) + +if f>=1 and f<=12: + if b>=1 and b<=12: + print('AMBIGUOUS') + else: + print('MMYY') + +else: + if b>=1 and b<=12: + print('YYMM') + else: + print('NA')" +p03042,s136506751,Accepted,"s = str(input()) +top = int(s[:2]) +bottom = int(s[2:]) + +if 1 <= top <= 12 and 1 <= bottom <= 12: + print('AMBIGUOUS') +elif top > 12 and bottom > 12: + print('NA') +elif 1 <= top <= 12: + print('MMYY') +elif 1 <= bottom <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s355554190,Accepted,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if (a > 12 or a == 0) and (b > 12 or b == 0): + print(""NA"") +elif a > 12 or a == 0: + print(""YYMM"") +elif b > 12 or b == 0: + print(""MMYY"") +else: print(""AMBIGUOUS"")" +p03042,s540545555,Accepted,"S = input() +a = S[0:2] +b = S[2:4] +A = int(a) +B = int(b) +if A>=1 and A <=12: + if B>= 1 and B <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if B>= 1 and B<= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s241197264,Accepted,"def f(s): + m,y = int(s[:2]), int(s[2:]) + return (0 < m <= 12,0 < y <= 12) + +print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[tuple(map(int,list(f(raw_input()))))] +" +p03042,s220766232,Accepted,"s = int(input()) +a = s // 100 +b = s % 100 + +if 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +elif 1 <= a <= 12: + print(""MMYY"") +elif 1 <= b <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s322242873,Accepted,"S = list(input()) +x = int("""".join(S[0:2])) +y = int("""".join(S[2:4])) +if 1 <= x <= 12: + if 1 <= y <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= y <= 12: + print(""YYMM"") + else: + print(""NA"") +pass +" +p03042,s441940868,Accepted,"S = input() +LL,RR = int(S[:2]), int(S[2:]) + +def v_month(x): + return 1<=x and x<=12 + +def v_year(x): + return 0<=x + +m1 = v_month(LL) +y1 = v_year(LL) + +m2 = v_month(RR) +y2 = v_year(RR) + +if (m1 and y1) and (m2 and y2): + print(""AMBIGUOUS"") +elif m1 and y2: + print(""MMYY"") +elif y1 and m2: + print(""YYMM"") +else: + print(""NA"") " +p03042,s785139971,Accepted,"s=input() +a=int(s[:2]) +b=int(s[2:]) +l=list(range(1,13)) +ans=""NA"" +if a not in l and b in l: + ans=""YYMM"" +elif a in l and b not in l: + ans=""MMYY"" +elif a in l and b in l: + ans=""AMBIGUOUS"" +print(ans)" +p03042,s538712615,Accepted,"S = input() +if (int(S[:2]) == 0 or int(S[:2]) >= 13) and 1 <= int(S[2:]) <= 12: + print('YYMM') +elif (int(S[2:]) == 0 or int(S[2:]) >= 13) and 1 <= int(S[:2]) <= 12 : + print('MMYY') +elif 1 <= int(S[2:]) <= 12 and 1 <= int(S[:2]) <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s559062525,Accepted,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if 1 <= a and a <= 12 and 1 <= b and b <=12: + print(""AMBIGUOUS"") +elif 1 <= a <=12 and (12 < b or b < 1): + print(""MMYY"") +elif (12 < a or a < 1) and 1 <= b <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s081583999,Accepted,"s = input() +ans = {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'} +print(ans[1 <= int(s[:2]) <= 12, 1 <= int(s[2:]) <= 12])" +p03042,s446069219,Accepted,"S=input() +a=int(S[:2]); b=int(S[2:]) +if 0= 1 and x <= 12: + if y >= 1 and y <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if y >= 1 and y <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s838776310,Accepted,"from sys import stdin +def S(): return stdin.readline().rstrip() + +s = S() + +ym = True +my = True + +tmp = '' +for i in range(2): + tmp += s[i] +tmp = int(tmp) +if tmp < 1 or 12 < tmp: + my = False + +tmp = '' +for i in range(2): + tmp += s[i+2] +tmp = int(tmp) +if tmp < 1 or 12 < tmp: + ym = False + +if ym and my: + print('AMBIGUOUS') +elif ym and not my: + print('YYMM') +elif not ym and my: + print('MMYY') +else: + print('NA')" +p03042,s918241295,Accepted,"S = input() + + +if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + print(""AMBIGUOUS"") +elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 0 < int(S[2:]) <= 12: + print(""YYMM"") +elif 0 < int(S[:2]) <= 12 and (int(S[2:]) > 12 or int(S[2:]) == 0): + print(""MMYY"") +else: + print(""NA"")" +p03042,s091503126,Accepted," +s=list(input()) +s1=s[0]+s[1] +s2=s[2]+s[3] + +if 1<=int(s1)<=12 and 1<=int(s2)<=12:print('AMBIGUOUS') +elif 1<=int(s1)<=12 and 0<=int(s2)<=99:print('MMYY') +elif 1<=int(s2)<=12 and 0<=int(s1)<=99:print('YYMM') +else:print('NA')" +p03042,s762610508,Accepted,"import sys + +INPUT = lambda: sys.stdin.readline().rstrip() + +sys.setrecursionlimit(10 ** 9) + + +def main(): + S = INPUT() + + b = 0 + for i in range(2): + if 0 < int(S[2*i:2*i+2]) <= 12: b += i + 1 + + if b == 0: print(""NA"") + elif b == 1: print(""MMYY"") + elif b == 2: print(""YYMM"") + else: print(""AMBIGUOUS"") + + +if __name__ == '__main__': + main()" +p03042,s577571905,Accepted,"s = input() + +a, b = int(s[:2]), int(s[2:]) +if 0 < a < 13 and 0 < b < 13: + print('AMBIGUOUS') +elif 0 < a < 13: + print('MMYY') +elif 0 < b < 13: + print('YYMM') +else: + print(""NA"") +" +p03042,s912933631,Accepted,"import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +S = read().rstrip().decode() + +is_YYMM = 1 <= int(S[2:]) <= 12 +is_MMYY = 1 <= int(S[:2]) <= 12 + +if is_YYMM and is_MMYY: + print('AMBIGUOUS') +elif is_YYMM: + print('YYMM') +elif is_MMYY: + print('MMYY') +else: + print('NA')" +p03042,s370984535,Accepted,"import datetime + + +def is_YYMM(s: str) -> bool: + try: + datetime.datetime.strptime(s, ""%y%m"") + except ValueError: + return False + else: + return True + + +def is_MMYY(s: str) -> bool: + try: + datetime.datetime.strptime(s, ""%m%y"") + except ValueError: + return False + else: + return True + + +S = input() +if is_MMYY(S) and is_YYMM(S): + print(""AMBIGUOUS"") +elif is_MMYY(S): + print(""MMYY"") +elif is_YYMM(S): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s322141226,Accepted," +s = str(input()) + +mm_f = 0 +mm_e = 0 + +if 0 < int(s[0:2]) <= 12: + mm_f = 1 +if 0 < int(s[2:]) <= 12: + mm_e = 1 + +if mm_f == 1 and mm_e == 1: + print('AMBIGUOUS') +elif mm_f == 1 and mm_e == 0: + print('MMYY') +elif mm_f == 0 and mm_e == 1: + print('YYMM') +else: + print('NA')" +p03042,s998162350,Accepted,"s = input() +ans = [0,0] +if 1 <= int(s[:2]) <= 12: + ans[0] = 1 +if 1 <= int(s[2:]) <= 12: + ans[1] = 1 +print([[""NA"",""YYMM""],[""MMYY"",""AMBIGUOUS""]][ans[0]][ans[1]])" +p03042,s554718619,Accepted,"date=input() +if 1<=int(date[:2])<=12: + if 1 <= int(date[2:]) <= 12: + print(""AMBIGUOUS"") + exit(0) + else: + print(""MMYY"") + exit(0) +if int(date[2:])==0 or 13 <= int(date[2:]): + print(""NA"") + exit(0) +print(""YYMM"")" +p03042,s861958861,Accepted,"s = int(input()) +s1 = s // 100 +s2 = s % 100 +if 1 <= s1 <= 12 and 1 <= s2 <= 12: + print(""AMBIGUOUS"") +elif 1 <= s2 <= 12: + print(""YYMM"") +elif 1 <= s1 <= 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s071021082,Accepted,"S = input() + +def M(x): + if 1 <= int(x) <= 12: + return 1 + else: + return 0 + +L = M(S[:2]) +R = M(S[2:]) + +if L == 1: + if R == 1: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if R == 1: + print(""YYMM"") + else: + print(""NA"")" +p03042,s380167376,Accepted,"s=input() +f=int(s[:2]) +b=int(s[2:]) +if f>=13 or f==0: + if 0a or a>12) and (1>b or b>12): + print(""NA"") +elif (1<=a and a<=12) and (1>b or b>12): + print(""MMYY"") +else: + print(""YYMM"")" +p03042,s242919347,Accepted,"S = input() + +F = int(S[:2]) +B = int(S[2:]) + +if F == 0 and B == 0: + print('NA') +elif (F == 0 and B > 12) or (B == 0 and F > 12): + print('NA') +elif F == 0: + print('YYMM') +elif B == 0: + print('MMYY') +elif (F <= 12 and B <= 12): + print('AMBIGUOUS') +elif F > 12 and B <= 12: + print('YYMM') +elif F <= 12 and B > 12: + print('MMYY') +else: + print('NA') +" +p03042,s319413674,Accepted,"S = input() +F = int(S[0] + S[1]) +B = int(S[2] + S[3]) +if min(F, B) > 12 or max(F, B) == 0 or min(F,B) == 0 and max(F, B) > 12: + print('NA') +elif min(F, B) != 0 and max(F, B) <= 12: + print('AMBIGUOUS') +elif F <= 12 and F != 0: + print('MMYY') +else: + print('YYMM')" +p03042,s931802721,Accepted,"S = input() +l,r = int(S[:2]),int(S[2:]) +if 1 <= l <= 12 and 1 <= r <= 12: + print(""AMBIGUOUS"") +elif 1<=r<=12: + print(""YYMM"") +elif 1<=l<=12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s608602971,Accepted,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if 1<= a <= 12 and 1<= b <= 12: + print('AMBIGUOUS') +elif 1 <= a <= 12 and (b==0 or 13 <= b): + print('MMYY') +elif 1 <= b <= 12 and (a==0 or 13 <= a): + print('YYMM') +else: + print('NA')" +p03042,s074885683,Accepted,"s=input() +if (0<=int(s[:2])<=99 and 1<=int(s[2:])<=12) and not(0<=int(s[2:])<=99 and 1<=int(s[:2])<=12): + print(""YYMM"") +elif (0<=int(s[2:])<=99 and 1<=int(s[:2])<=12) and not((0<=int(s[:2])<=99 and 1<=int(s[2:])<=12)): + print(""MMYY"") +elif (0<=int(s[:2])<=99 and 1<=int(s[2:])<=12) and (0<=int(s[2:])<=99 and 1<=int(s[:2])<=12): + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s308890977,Accepted,"S = input() +LL = int(S[0]+S[1]) +RR = int(S[2]+S[3]) +# YY or MM +L = """" +if LL == 0 or LL > 12: + L = ""YY"" +else: + L = ""YY or MM"" + +if L == ""YY"": + if RR == 0 or RR > 12: + print(""NA"") + elif 1 <= RR <= 12: + print(""YYMM"") +elif L == ""YY or MM"": + if RR == 0 or RR > 12: + print(""MMYY"") + elif 1 <= RR <= 12: + print(""AMBIGUOUS"")" +p03042,s626753307,Accepted,"s=input() +a=int(s[:2]) +b=int(s[2:]) + +if 1<= a <=12 and 1<= b <= 12: + print(""AMBIGUOUS"") + +elif 1<= b <= 12: + print(""YYMM"") + +elif 1 <= a <= 12: + print(""MMYY"") + +else: + print(""NA"")" +p03042,s814802208,Accepted,"S = int(input()) + +flag = [0, 0] # [YYMM, MMYY] +l = S // 100 +r = S % 100 +if 1<=r and r<=12: + flag[0] += 1 +if 1<=l and l<=12: + flag[1] += 1 +if flag == [0, 0]: + print('NA') +elif flag == [0, 1]: + print('MMYY') +elif flag == [1, 0]: + print('YYMM') +elif flag == [1, 1]: + print(""AMBIGUOUS"")" +p03042,s274554530,Accepted,"s = input() +n1 = int(s[0:2]) +n2 = int(s[2:4]) + +if 1 <= n1 <= 12: + if 1 <= n2 <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +elif 1 <= n2 <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s227836352,Accepted,"S=input() +a,b=int(S[:2]),int(S[2:]) +if 0= 1 and sa <= 12 and sb >= 1 and sb <= 12: + print('AMBIGUOUS') + exit() +else: + if sa >= 1 and sa <= 12: + print('MMYY') + exit() + if sb >= 1 and sb <= 12: + print('YYMM') + exit() + +print('NA')" +p03042,s254672333,Accepted,"def main(): + S = input() + a = S[0:2] + b = S[2:4] + + if 1 <= int(a) <= 12: + if 1 <= int(b) <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + else: + if 1 <= int(b) <= 12: + print(""YYMM"") + else: + print(""NA"") + + +if __name__ == ""__main__"": + main()" +p03042,s717948262,Accepted,"S = input() +sform = int(S[:2]) +slatt = int(S[2:]) + +if sform <= 12 and sform >= 1: + if slatt <= 12 and slatt >= 1: + print('AMBIGUOUS') + else: + print('MMYY') + +else: + if slatt <= 12 and slatt >= 1: + print('YYMM') + else: + print('NA')" +p03042,s295546108,Accepted,"S=input() +x=int(S[:2]) +y=int(S[2:]) + +if 1<=x<=12 and 1<=y<=12: + print(""AMBIGUOUS"") +elif 1<=x<=12: + print(""MMYY"") +elif 1<=y<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s594382575,Accepted,"input_s = input() +head_num = int(input_s[:2]) +bottom_num = int(input_s[2:]) +yymm_flag = 0 +mmyy_flag = 0 + +if bottom_num <= 12 and bottom_num != 0: + yymm_flag += 1 + + +if head_num <= 12 and head_num != 0: + mmyy_flag += 1 + +if yymm_flag == 1 and mmyy_flag == 1: + print(""AMBIGUOUS"") +elif yymm_flag == 1: + print(""YYMM"") +elif mmyy_flag == 1: + print(""MMYY"") +else: + print(""NA"") + " +p03042,s922920037,Accepted,"def main(): + s = int(input()) + k = s//100 + t = s%100 + + if(k>0 and k<13) and (t>0 and t<13): + res = ""AMBIGUOUS"" + elif(k>0 and k<13): + res = ""MMYY"" + elif(t>0 and t<13): + res = ""YYMM"" + else: + res = ""NA"" + print(res) + + + + + + +if __name__ == '__main__': + main() +" +p03042,s443863937,Accepted," +s = int(input()) + +left = int(s/100) +right = int(s%100) + + +if left > 12 or left <= 0: + if right > 12 or right <= 0: + print('NA') + else: + print('YYMM') +else: + if right > 12 or right <= 0: + print('MMYY') + else: + print('AMBIGUOUS')" +p03042,s367464911,Accepted,"s = input() +am = s[0]+s[1] +pm = s[2]+s[3] +p = [""01"",""02"",""03"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] +if am in p and pm in p: + print(""AMBIGUOUS"") +elif am in p and pm not in p: + print(""MMYY"") +elif am not in p and pm in p: + print(""YYMM"") +elif am not in p and pm not in p: + print(""NA"")" +p03042,s890125534,Accepted,"s = list(input()) +a = int(s[0]+s[1]) +b = int(s[2]+s[3]) + +if (a==0 and 1 <= b <= 12) or (a >= 13 and 1 <= b <= 12): + print(""YYMM"") +elif (b==0 and 1 <= a <= 12) or (b >= 13 and 1 <= a <= 12): + print(""MMYY"") +elif 1 <= a<= 12 and 1<=b<=12: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s315436903,Accepted,"s = input() + +s1 = int(s[0] + s[1]) +s2 = int(s[2] + s[3]) +if 1 <= s1 <= 12 and 1 <= s2 <= 12: + print('AMBIGUOUS') +elif 1 <= s1 <= 12: + print('MMYY') +elif 1 <= s2 <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s363011358,Accepted,"s = input() + +l = int(s[0:2]) +r = int(s[2:4]) + +if (l > 0 and l < 13) and (r > 0 and r < 13): + ret = 'AMBIGUOUS' +elif (l > 0 and l < 13) and (r == 0 or r >= 13): + ret = 'MMYY' +elif (l == 0 or l >= 13) and (r > 0 and r < 13): + ret = 'YYMM' +else: + ret = 'NA' + +print(ret) +" +p03042,s085207177,Accepted,"n = input() +a = int(n[:2]) +b = int(n[2:]) +if 1 <= a <= 12 and 1 <= b <= 12: + print('AMBIGUOUS') +elif 1 <= a <= 12: + print('MMYY') +elif 1 <= b <= 12: + print('YYMM') +else: + print('NA')" +p03042,s048457619,Accepted,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +if (0 12 and 1 <= b <= 12) or (a == 0 and 1 <= b <= 12): + print(""YYMM"") +elif (1 <= a <= 12 and b > 12) or (1 <= a <= 12 and b == 0): + print(""MMYY"") +elif 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"") + + +" +p03042,s122001636,Accepted,"s = input() +s0, s1 = int(s[:2]), int(s[2:]) +if (1 <= s0 <= 12) and (1 <= s1 <= 12): + print('AMBIGUOUS') +elif 1 <= s0 <= 12: + print('MMYY') +elif 1 <= s1 <= 12: + print('YYMM') +else: + print('NA')" +p03042,s218198445,Accepted,"S = input() + +A = int(S[:2]) +B = int(S[2:]) + +if 1 <= A and A <= 12: + if 1 <= B and B <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= B and B <= 12: + print(""YYMM"") + else: + print(""NA"") +" +p03042,s840685775,Accepted,"S = str(input()) +s1,s2 = int(S[:2]),int(S[2:]) +c1,c2 = 0,0 + +if 0 < s1 < 13: + c1 = 1 +if 0 < s2 < 13: + c2 = 1 + +if c1 and c2: + ans = ""AMBIGUOUS"" +elif c1: + ans = ""MMYY"" +elif c2: + ans = ""YYMM"" +else: + ans = ""NA"" +print(ans)" +p03042,s106592680,Accepted,"s=input();a,b=map(int,(s[:2],s[2:]));print('AMBIGUOUS'if 1<=a<=12 and 1<=b<=12 else'MMYY'if 1<=a<=12 and 0<=b<=99 else'YYMM'if 0<=a<=99 and 1<=b<=12 else'NA')" +p03042,s489887749,Accepted,"s = input() +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) +c = 0 +if 0 < a <= 12: + c += 10 +if 0 < b <= 12: + c += 1 +if c == 11: + print(""AMBIGUOUS"") +elif c == 10: + print(""MMYY"") +elif c == 1: + print(""YYMM"") +else: + print(""NA"")" +p03042,s929889759,Accepted,"s = input() +x = int(s[0:2]) +y = int(s[2:4]) +if 1 <= x <= 12: + if 1 <= y <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif 1 <= y <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s046632271,Accepted,"s = input() + +left = int(s[:2]) +right = int(s[2:]) + +if 0 < left <= 12 and 0 < right <= 12: + print('AMBIGUOUS') +elif 0 < left <= 12 < right or right == 0 < left <= 12: + print('MMYY') +elif 0 < right <= 12 < left or left == 0 < right <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s523204329,Accepted,"s = int(input()) +mae = s // 100 +usiro = s % 100 +Mflag = True +Uflag = True + +if mae < 1 or mae > 12: + Mflag = False + +if usiro < 1 or usiro > 12: + Uflag = False + +if Mflag: + if Uflag: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if Uflag: + print('YYMM') + else: + print('NA')" +p03042,s674158139,Accepted,"s = input() +if 1<=int(s[0:2])<=12 and 1<=int(s[2:4])<=12: + print(""AMBIGUOUS"") +elif 1<=int(s[0:2])<=12: + print(""MMYY"") +elif 1<=int(s[2:4])<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s998782653,Accepted,"S=str(input()) +if int(S[0:2])<=12 and int(S[0:2])>=1: + if int(S[2:4])<=12 and int(S[2:4])>=1: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if int(S[2:4])<=12 and int(S[2:4])>=1: + print(""YYMM"") + else: + print(""NA"")" +p03042,s894605875,Accepted,"from collections import Counter +from collections import defaultdict +from collections import deque +import math +import itertools +import heapq +import sys +sys.setrecursionlimit(10**6) + +#n=int(input()) +#n,m=list(map(int,input().split())) +#a=list(map(int,input().split())) +input_list = lambda : list(map(int,input().split())) + +s=input() +p_a=int(s[:2]) +p_b=int(s[2:]) +yymm=(0int(S1)>0: + if 13>int(S2)>0: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 13>int(S2)>0: + print(""YYMM"") + else: + print(""NA"")" +p03042,s941024593,Accepted,""""""" +N = list(map(int,input().split())) +S = [str(input()) for _ in range(N)] +S = [list(map(int,list(input()))) for _ in range(h)] +print(*S,sep="""") +"""""" + +import sys +sys.setrecursionlimit(10**6) +input = lambda: sys.stdin.readline().rstrip() + +s = input() +a = 00 and a<=12 and b>0 and b<=12: + print('AMBIGUOUS') +elif b>0 and b<=12: + print('YYMM') +elif a>0 and a<=12: + print('MMYY') +else: + print('NA')" +p03042,s880403682,Accepted,"S = input() +s = list(S) +p = -1 +q = -1 +a = [s[0],s[1]] +b = [s[2],s[3]] +if 1 <= int(''.join(a)) <= 12: + p = 1 +else: + p = 0 +if 1 <= int(''.join(b)) <= 12: + q = 1 +else: + q = 0 +if p == 1 and q == 1: + print('AMBIGUOUS') +elif p == 0 and q == 1: + print('YYMM') +elif p == 1 and q == 0: + print('MMYY') +else: + print('NA')" +p03042,s435883396,Accepted,"s=input() +if 1<=int(s[:2])<=12: + if 1<=int(s[2:])<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1<=int(s[2:])<=12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s601625510,Accepted,"S = input() +a = int(S[:2]) +b = int(S[2:]) + +def ismonth(x): + return 0 < x and x < 13 + +if ismonth(a) and ismonth(b): + print(""AMBIGUOUS"") +elif ismonth(a): + print(""MMYY"") +elif ismonth(b): + print(""YYMM"") +else: + print(""NA"")" +p03042,s041811434,Accepted,"S = input() +A = int(S[0]+S[1]) +B = int(S[2]+S[3]) +if 0 < A <= 12: + if 0 < B <= 12: + print('AMBIGUOUS') + + else: + print('MMYY') + +elif A > 12 or A == 0: + if 0 < B <= 12: + print('YYMM') + + else: + print('NA')" +p03042,s596089662,Accepted,"S = input() +first = S[:2] +second = S[2:] +if 0 < int(first) and int(first) <= 12 and 0 < int(second) and int(second) <= 12: + print(""AMBIGUOUS"") +elif 0 < int(second) and int(second) <= 12: + print(""YYMM"") +elif 0 < int(first) and int(first) <= 12: + print(""MMYY"") +else: + print(""NA"") +" +p03042,s856552006,Accepted,"s = input() +s1 = s[0 : 2] +s2 = s[2 : 4] +if 1 <= int(s1) <= 12 and 1 <= int(s2) <= 12: + print(""AMBIGUOUS"") +elif 1 <= int(s1) <= 12: + print(""MMYY"") +elif 1 <= int(s2) <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s539925961,Accepted,"S = input() +A = int(S[0:2]) +B = int(S[2:4]) +if(1<=A<=12): + if(1<=B<=12): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif(1<=B<=12): + print(""YYMM"") +else: + print(""NA"")" +p03042,s418742039,Accepted,"N = list(input()) +if 1 <= int(N[0]+N[1]) <=12 and 1 <= int(N[2]+N[3]) <=12: + print('AMBIGUOUS') +elif 1 <= int(N[0]+N[1]) <=12: + print('MMYY') +elif 1 <= int(N[2]+N[3]) <=12: + print('YYMM') +else: + print('NA') +" +p03042,s457228960,Accepted,"s=int(input()) +a=s//100 +b=s%100 +if a<=12 and a>=1 and b<=12 and b>=1: + print(""AMBIGUOUS"") +elif (a>=13 or a==0) and b<=12 and b>=1: + print(""YYMM"") +elif a<=12 and a>=1 and (b>=13 or b==0): + print(""MMYY"") +else: + print(""NA"")" +p03042,s835372698,Accepted,"S=input() +forward="""" +back="""" +yymm=0 +mmyy=0 +for i in range(4): + forward=S[:2] + back=S[2:] +forward=int(forward) +back=int(back) +if ((1<=forward)and(forward<=12)): + mmyy=1 +if ((1<=back)and(back<=12)): + yymm=1 +if (mmyy==1): + if (yymm==1): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if(yymm==1): + print(""YYMM"") + else: + print(""NA"")" +p03042,s519691456,Accepted,"s=int(input()) +n1=s//100 +n2=s%100 +if n1>12 or n1==0: + if n2>12 or n2==0:print(""NA"") + else:print(""YYMM"") +else: + if n2>12 or n2==0:print(""MMYY"") + else:print(""AMBIGUOUS"") +" +p03042,s786516592,Accepted,"# coding: utf-8 + +S = input() + +s1 = int(S[0]) * 10 + int(S[1]) +s2 = int(S[2]) * 10 + int(S[3]) + +if 1 <= s1 <= 12: + if 1 <= s2 <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= s2 <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s150538829,Accepted,"S = int(input()) +S1, S2 = S // 100, S % 100 + +YYMM = (1 <= S2 and S2 <= 12) +MMYY = (1 <= S1 and S1 <= 12) + +if YYMM and MMYY: + print(""AMBIGUOUS"") +elif YYMM: + print(""YYMM"") +elif MMYY: + print(""MMYY"") +else: + print(""NA"")" +p03042,s868076162,Accepted,"S = str(input()) +red = int(S[0:2]) +blue = int(S[2:4]) +if 1<=red<=12: + if 1<=blue<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1<=blue<=12: + print(""YYMM"") + else: + print(""NA"") + +" +p03042,s511300678,Accepted,"S = input() + +if(00 and r<=12 and r>0: + print('AMBIGUOUS') +elif l<=12 and l>0: + print('MMYY') +elif r<=12 and r>0: + print('YYMM') +else: + print('NA')" +p03042,s720695182,Accepted,"s=list(input()) +s=list(map(int,s)) + +a=s[0]*10+s[1] +b=s[2]*10+s[3] + +if (a==0 and b==0) or (a>=13 and b>=13) or (a==0 and b>=13) or (a>=13 and b==0): + print(""NA"") +elif 00) and (B>12 or B==0):#A is between 0-12 and B is not month (=year) + strFormat = ""MMYY"" +elif (A>12 or A==0) and (B<=12 and B>0):#B is between 0-12 and B is not month(=year) + strFormat = ""YYMM"" +elif (A>0 and A<=12 and B>0 and B<=12 ):#both are between 1-12 + strFormat = ""AMBIGUOUS"" +else: + strFormat = ""NA"" + +print(strFormat)" +p03042,s156244297,Accepted,"S = int(input()) +x = S//100 +y = S%100 +yymm = (1<=y<=12) +mmyy = (1<=x<=12) + +ans = ""NA"" +if yymm and mmyy: + ans = 'AMBIGUOUS' +elif yymm and not(mmyy): + ans = 'YYMM' +elif mmyy and not(yymm): + ans = 'MMYY' + +print(ans) " +p03042,s597470327,Accepted,"s=input() + +if 0= 1 and ab <= 12 and cd >= 1 and cd <= 12: + ans = 'AMBIGUOUS' +else: + if ab >= 1 and ab <= 12: + ans = 'MMYY' + elif cd >= 1 and cd <= 12: + ans = 'YYMM' + else: + ans = 'NA' + +print(ans)" +p03042,s351401846,Accepted,"a=str(input()) +f=int(a[0:2]) +r=int(a[2:4]) +if f>=1 and f<=12: + f1=True +else: + f1=False + +if r>=1 and r<=12: + r1=True +else: + r1=False + +if f1==True and r1==True: + print('AMBIGUOUS') +if f1==True and r1==False: + print('MMYY') +if f1==False and r1==True: + print('YYMM') +if f1==False and r1==False: + print('NA')" +p03042,s564280145,Accepted,"s = input() + +s_a = int(s[:2]) +s_b = int(s[2:]) + +if 1 <= s_a <=12 and 1 <= s_b <=12: + ans = ""AMBIGUOUS"" +elif not(1 <= s_a <=12) and 1 <= s_b <=12: + ans = ""YYMM"" +elif 1 <= s_a <=12 and not(1 <= s_b <=12): + ans = ""MMYY"" +else: + ans = ""NA"" + +print(ans)" +p03042,s339823398,Accepted,"s=input() +if int(s[:2])<=12 and int(s[:2])>0: + if int(s[2:4])<=12 and int(s[2:4])>0: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif int(s[2:4])<=12 and int(s[2:4])>0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s671989549,Accepted,"S = int(input()) + +a = int(S/100 - (S%100)/100) +b = int(S%100) + +if( 0 12 or n1 == 0) and 1 <= n2 <= 12: + print(""YYMM"") +elif 1 <= n1 <= 12 and (n2 > 12 or n2 == 0): + print(""MMYY"") +else: + print(""NA"") +" +p03042,s780275147,Accepted,"s = int(input()) +a, b = s // 100, s % 100 + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=a<=12: + print('MMYY') +elif 1<=b<=12: + print('YYMM') +else: + print('NA')" +p03042,s277155289,Accepted,"S = input() +months = [ + '01', '02', '03', + '04', '05', '06', + '07', '08', '09', + '10', '11', '12'] +if S[:2] in months and S[2:] in months: + print('AMBIGUOUS') +elif S[:2] in months: + print('MMYY') +elif S[2:] in months: + print('YYMM') +else: + print('NA') +" +p03042,s319526057,Accepted,"# -*- coding: utf-8 -*- + +def main(): + + S = input() + + listS = [int(S[:2]), int(S[2:])] + + if 1 <= listS[0] <= 12 and 1 <= listS[1] <= 12: + ans = 'AMBIGUOUS' + + elif 1 <= listS[0] <= 12: + ans = 'MMYY' + + elif 1 <= listS[1] <= 12: + ans = 'YYMM' + + else: + ans = 'NA' + + print(ans) + + +if __name__ == ""__main__"": + main()" +p03042,s964202053,Accepted,"S = input() + +# 0 to 99 YY +# 1 to 12 MM + +AA = int(S[:2]) +BB = int(S[2:]) + +A = """" +B = """" +ans = """" +if AA == 0 or AA > 12: + A = ""YY"" +else: + A = ""MM"" + +if BB == 0 or BB > 12: + B = ""YY"" +else: + B = ""MM"" + +if A == ""YY"" and B == ""YY"": + ans = ""NA"" +elif A == ""YY"" and B == ""MM"": + ans = ""YYMM"" +elif A == ""MM"" and B == ""YY"": + ans = ""MMYY"" +else: + ans = ""AMBIGUOUS"" + +print(ans) + " +p03042,s875428597,Accepted,"S = input() +n1 = int(S[:2]) +n2 = int(S[2:]) + +if 1 <= n1 <= 12 and 1 <= n2 <= 12: + print('AMBIGUOUS') +elif 1 <= n1 <= 12 and (not 1 <= n2 <= 12): + print('MMYY') +elif (not 1 <= n1 <= 12) and 1 <= n2 <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s084160673,Accepted,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if 0= 13 or s1 <= 0) and (s2 >= 13 or s2 <= 0): + print(""NA"") +elif s1 <= 12 and s1 >= 1 and s2 <= 12 and s2 >= 1: + print(""AMBIGUOUS"") +elif s2 >= 13 or s2 == 0: + print(""MMYY"") +else: + print(""YYMM"") + " +p03042,s973673172,Accepted,"S=input() +A=int(S[0:2]) +B=int(S[2:4]) +if (1<=A and A<=12) and (1<=B and B<=12): + print(""AMBIGUOUS"") +elif (1<=A and A<=12) and not(1<=B and B<=12): + print(""MMYY"") +elif not(1<=A and A<=12) and (1<=B and B<=12): + print(""YYMM"") +else: + print(""NA"")" +p03042,s440221787,Accepted,"S = list(input()) + +head = int("""".join(S[:2])) +tale = int("""".join(S[2:])) + +if 1 <= head <= 12: + if 1 <= tale <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif 1 <= tale <= 12: + print(""YYMM"") +else: + print(""NA"") + +" +p03042,s149617253,Accepted,"S = input() + + +def check_mm(x): + return (0 < int(x) and int(x) <= 12) + + +if check_mm(S[:2]) and check_mm(S[2:]): + print(""AMBIGUOUS"") +elif check_mm(S[:2]) == False and check_mm(S[2:]): + print(""YYMM"") +elif check_mm(S[:2]) and check_mm(S[2:]) == False: + print(""MMYY"") +else: + print(""NA"") +" +p03042,s433994646,Accepted,"S = input() +f = int(S[0]+S[1]) +b = int(S[2]+S[3]) + +def judge(int): + if 1 <= int <= 12: + return 0 + else: + return 1 +ref = [judge(f), judge(b)] + +if ref == [1, 1]: + print(""NA"") +elif ref == [0, 1]: + print(""MMYY"") +elif ref == [1, 0]: + print(""YYMM"") +else: + print(""AMBIGUOUS"") +" +p03042,s463278428,Accepted,"s = input() + +if 1 <= int(s[2:4]) <= 12 and 1 <= int(s[0:2]) <= 12: + print('AMBIGUOUS') +elif 1 <= int(s[2:4]) <= 12: + print('YYMM') +elif 1 <= int(s[0:2]) <= 12: + print('MMYY') +else: + print('NA')" +p03042,s941349007,Accepted,"A = input() +B = A[0:2] +C = A[2:4] +if 12 >= int(B) > 0: + if 12 >= int(C) > 0: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif 12 >= int(C) > 0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s992387500,Accepted,"a, b = divmod(int(input()), 100) +x = ""MM"" if 0 < a < 13 else ""YY"" +y = ""MM"" if 0 < b < 13 else ""YY"" +print(x + y if x != y else ""NA"" if x == ""YY"" else ""AMBIGUOUS"") +" +p03042,s465147270,Accepted,"s=input() + +x=int(s[:2]) +y=int(s[2:]) + +if (1<=x<=12) and (1<=y<=12): + print('AMBIGUOUS') + +elif (x==0 or x>12) and (1<=y<=12): + print('YYMM') + +elif (1<=x<=12) and (y==0 or y>12): + print('MMYY') + +else: + print('NA')" +p03042,s653917291,Accepted,"a=input() +b=int(a[0]+a[1]) +c=int(a[2]+a[3]) +if 1<=b<=12: + if 1<=c<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1<=c<=12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s978171074,Accepted,"def main(): + S = input() + if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + return ""AMBIGUOUS"" + elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0: + return ""YYMM"" + elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0): + return ""MMYY"" + else: + return ""NA"" + + +if __name__ == '__main__': + print(main()) +" +p03042,s868720325,Accepted,"S = int(input()) + +front = S // 100 +back = S % 100 + +if 1 <= front <= 12 : + if 1 <= back <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= back <= 12: + print(""YYMM"") + else: + print(""NA"") +" +p03042,s679484847,Accepted,"s = int(input()) +s_1 = s // 100 #4桁の数字列の上2桁を取り出す +s_2 = s % 100 #4桁の数字列の下2桁を取り出す + +if 1 <= s_1 <=12 and 1 <= s_2 <= 12: + print(""AMBIGUOUS"") +elif 1 <= s_1 <= 12: + print(""MMYY"") +elif 1 <= s_2 <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s530333168,Accepted,"S = input() + +if int(S[:2]) > 12 or int(S[:2]) == 0: + if int(S[2:]) > 12 or int(S[2:]) == 0: print('NA') + else: print('YYMM') +else: + if int(S[2:]) > 12 or int(S[2:]) == 0: print('MMYY') + else: print('AMBIGUOUS')" +p03042,s798244664,Accepted,"s=input() +if 0= 1 and a <= 12: + if b >= 1 and b <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if b >= 1 and b <= 12: + print('YYMM') + else: + print('NA')" +p03042,s255962948,Accepted,"s=input() +yy = [""%02d"" % i for i in range(100)] +mm = [""%02d"" % i for i in range(1, 13)] +yymm = s[:2] in yy and s[2:] in mm +mmyy = s[:2] in mm and s[2:] in yy +print([""NA"",""MMYY"",""YYMM"",""AMBIGUOUS""][yymm*2+mmyy]) +" +p03042,s289953985,Accepted,"s = input() +if 0 < int(s[:2]) <= 12: + if int(s[2:]) > 12 or int(s[2:]) == 0: + print('MMYY') + else: + print('AMBIGUOUS') +else: + if 0 < int(s[2:]) <= 12: + print('YYMM') + else: + print('NA') + + " +p03042,s149959101,Accepted,"S1, S2, S3, S4 = input() +Front = 10 * int(S1) + int(S2) +Back = 10 * int(S3) + int(S4) + +if 1 <= Front <= 12 and 1 <= Back <= 12: + print('AMBIGUOUS') +elif (Front > 12 or Front == 0) and 1 <= Back <= 12: + print('YYMM') +elif 1 <= Front <= 12 and (Back > 12 or Back == 0): + print('MMYY') +else: + print('NA')" +p03042,s608931643,Accepted,"S = list(map(str, input())) + +F = int(S[0]+S[1]) +L = int(S[2]+S[3]) + +if (L == 0 and F == 0) or (F > 12 and L > 12) or (F == 0 and L > 12) or (L == 0 and F > 12): + print('NA') + +elif F <= 12 and (L > 12 or L == 0): + print('MMYY') + +elif L <= 12 and (F > 12 or F == 0): + print('YYMM') + + +else: + print('AMBIGUOUS')" +p03042,s287316169,Accepted,"s = input() +mmyy = (1 <= int(s[:2]) <= 12) +yymm = (1 <= int(s[2:]) <= 12) +if mmyy: + if yymm: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if yymm: + print('YYMM') + else: + print('NA')" +p03042,s281114607,Accepted,"#input +S = str(input()) + +#output +S1 = int(S[:2]) +S2 = int(S[2:]) + +if S1 == 0 and S2 == 0: + print(""NA"") +elif S1 ==0 and 0 < S2 <= 12: + print(""YYMM"") +elif S1 == 0 and S2 > 12: + print(""NA"") +elif S2 == 0 and S1 > 12: + print(""NA"") +elif S2 == 0 and 0 < S1 <= 12: + print(""MMYY"") +elif 0 < S1 <= 12 and 0 < S2 <= 12: + print(""AMBIGUOUS"") +elif S1 > 12 and 0 < S2 <= 12: + print(""YYMM"") +elif 0 < S1 <= 12 and S2 > 12: + print(""MMYY"") +elif S1 > 12 and S2 > 12: + print(""NA"")" +p03042,s739604119,Accepted,"s=input() + +s1=s[0]+s[1] +s2=s[2]+s[3] + +if (s1[0]=='0' and s1!='00') or s1=='11' or s1=='12': + ans1='MM' +else: + ans1='YY' + +if (s2[0]=='0' and s2!='00') or s2=='11' or s2=='12': + ans2='MM' +else: + ans2='YY' + +if ans1==ans2=='MM': + print('AMBIGUOUS') +elif ans1==ans2=='YY': + print('NA') +else: + print(ans1+ans2)" +p03042,s332834700,Accepted,"S = input() +s0 = 0 < int(S[:2]) <= 12 +s1 = 0 < int(S[2:]) <= 12 +if s0 and s1: + print('AMBIGUOUS') +elif s0 and not s1: + print('MMYY') +elif not s0 and s1: + print('YYMM') +else: + print('NA')" +p03042,s493579243,Accepted,"S = input() +a = int(S[0:2]) +b = int(S[2:4]) +if 1<=a<=12: + if 1<=b<=12: + print('AMBIGUOUS') + else: + print('MMYY') +elif 1<=b<=12: + print('YYMM') +else: + print('NA')" +p03042,s191121905,Accepted,"s = input() +if 0 < int(s[:2]) <13 and 0< int(s[2:]) < 13: + print(""AMBIGUOUS"") +elif 0 < int(s[:2]) < 13: + print(""MMYY"") +elif 0 < int(s[2:]) < 13: + print(""YYMM"") +else: + print(""NA"")" +p03042,s702339457,Accepted,"s = input() +YYMM = False +MMYY = False + +if 1 <= int(s[:2]) <= 12: + MMYY = True +if 1 <= int(s[2:]) <= 12: + YYMM = True + +ans = '' +if YYMM and MMYY: + ans = 'AMBIGUOUS' +elif YYMM: + ans = 'YYMM' +elif MMYY: + ans = 'MMYY' +else: + ans = 'NA' + +print(ans)" +p03042,s447164039,Accepted," + +s = input() +s12 = int(s[0:2]) +s34 = int(s[2:]) + +if (0 < s12 < 13) and(0 < s34 < 13): + print(""AMBIGUOUS"") +elif 0 < s12 < 13: + print(""MMYY"") +elif 0 < s34 < 13: + print(""YYMM"") +else: + print(""NA"")" +p03042,s067807627,Accepted,"# coding: utf-8 +import sys + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +S = list(sr()) +head = int(''.join(S[:2])) +tail = int(''.join(S[2:])) +bl_head = (1 <= head <= 12) +bl_tail = (1 <= tail <= 12) +if bl_head and bl_tail: + answer = ""AMBIGUOUS"" +elif bl_head: + answer = ""MMYY"" +elif bl_tail: + answer = ""YYMM"" +else: + answer = ""NA"" + +print(answer) +" +p03042,s377407119,Accepted,"n = list(input()) +x = int(n[0]+n[1]) +y = int(n[2]+n[3]) + +if 1 <= x and x <= 12: + if 1 <= y and y <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif 1 <= y and y <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s658788814,Accepted,"n = input() +s, t = (1 <= int(n[:2]) <= 12), (1 <= int(n[2:]) <= 12) +print(""AMBIGUOUS"" if s and t else ""YYMM"" if t else ""MMYY"" if s else ""NA"")" +p03042,s633270695,Accepted,"s=input() +ans=[0]*2 +a=int(s[:2]) +b=int(s[2:]) +if 1<=a<=12: + ans[0]=1 +if 1<=b<=12: + ans[1]=1 + +if ans[0]==ans[1]==1: + print('AMBIGUOUS') +elif ans[0]==ans[1]==0: + print('NA') +elif ans[0]==1 and ans[1]==0: + print('MMYY') +else: + print('YYMM')" +p03042,s084631892,Accepted,"S = int(input()) +a = S % 100 +b = (S- (S % 100))/100 +if b <= 12 and a<=12 and a!=0 and b!= 0: + print(""AMBIGUOUS"") +elif b <= 12 and b!=0: + print(""MMYY"") +elif a<=12 and a!=0 : + print(""YYMM"") +else : + print(""NA"")" +p03042,s898196875,Accepted,"S = input() +f = int(S[:2]) +e = int(S[2:]) +if 1 <= f <= 12 and (e > 12 or e == 0): + print('MMYY') +elif (f > 12 or f == 0) and 1 <= e <= 12: + print('YYMM') +elif 1 <= f <= 12 and 1 <= e <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s932571580,Accepted,"S = input() +a, b = S[0:2], S[-2:] + +if ""00"" < a <= ""12"": + if ""00"" < b <= ""12"": + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif ""00"" < b <= ""12"": + print(""YYMM"") +else: + print(""NA"")" +p03042,s608455400,Accepted,"s = input() +s1 = int(s[:2]) +s2 = int(s[2:]) +MMYY = False +YYMM = False +if 0= 1) and (int(s2) <= 12 and int(s2) >= 1): + print('AMBIGUOUS') +elif ((int(s1) == 0) or int(s1) > 12) and (int(s2) <= 12 and int(s2) >= 1): + print('YYMM') +elif ((int(s2) == 0) or (int(s2) > 12)) and (int(s1) <= 12 and int(s1) >= 1): + print('MMYY') +else: + print('NA') +" +p03042,s570620197,Accepted,"def main(): + S = input() + first = int(S[0:2]) + last = int(S[2:4]) + + if((first>12 or first==0) and last<=12 and last>=1): + print(""YYMM"") + elif((last>12 or last==0) and first<=12 and first>=1): + print(""MMYY"") + elif(last<=12 and first<=12 and last>=1 and first>=1): + print(""AMBIGUOUS"") + else: + print(""NA"") + + return +main() +" +p03042,s641929348,Accepted,"S=input() +months=['01','02','03','04','05','06','07','08','09','10','11','12'] + +if S[0:2] in months and S[2:4] in months: + print('AMBIGUOUS') +elif S[0:2] in months: + print('MMYY') +elif S[2:4] in months: + print('YYMM') +else: + print('NA')" +p03042,s692743397,Accepted,"s = input() +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +if s1 == s2 == 0: + print('NA') +elif s1 <= 12 and s2 <= 12 and s1 >= 1 and s2 >= 1: + print('AMBIGUOUS') +elif s1 <= 12 and s1 >= 1: + print('MMYY') +elif s2 <= 12 and s2 >= 1: + print('YYMM') +else: + print('NA')" +p03042,s171349098,Accepted,"s=input() +YYMM=MMYY=False +if s[:2]<=""12"" and s[:2]>=""01"": + MMYY=True +if s[2:]<=""12"" and s[2:]>=""01"": + YYMM=True +if YYMM and MMYY: + print(""AMBIGUOUS"") +elif YYMM: + print(""YYMM"") +elif MMYY: + print(""MMYY"") +else: + print(""NA"")" +p03042,s841223525,Accepted,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +if 1 <= s1 <= 12 and 1 <= s2 <= 12: + print(""AMBIGUOUS"") +elif 1 <= s1 <= 12: + print(""MMYY"") +elif 1 <= s2 <= 12: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s087786141,Accepted,"import sys + +input = sys.stdin.readline + + +def main(): + S = input().strip() + s, t = int(S[:2]), int(S[2:]) + + s_mm = (1 <= s <= 12) + t_mm = (1 <= t <= 12) + + mapping = { + (True, True): 'AMBIGUOUS', + (True, False): 'MMYY', + (False, True): 'YYMM', + (False, False): 'NA' + } + + print(mapping[(s_mm, t_mm)]) + + + +if __name__ == '__main__': + main()" +p03042,s680987567,Accepted,"s = input() +YYMM, MMYY, ova = False, False, False +if(1 <= int(s[:2]) <= 12): + MMYY = True +if(1 <= int(s[2:]) <= 12): + YYMM = True + +if(MMYY and YYMM): + print('AMBIGUOUS') +elif(MMYY): + print(""MMYY"") +elif(YYMM): + print('YYMM') +else: + print('NA')" +p03042,s601136714,Accepted,"n = list(input()) +a=int(n[0]+n[1]) #4桁の数値の前2桁 +b=int(n[2]+n[3]) #4桁の数値の後2桁 + +if 1<= a <=12: + if 1<= b <=12: + print('AMBIGUOUS') + else: + print('MMYY') +elif 1<= b <=12: + print('YYMM') +else: + print('NA') +" +p03042,s105437282,Accepted,"S = input() +flagA = False +flagB = False +if 1 <= int(S[2:4])<= 12: + flagB = True +if 1 <= int(S[0:2])<= 12: + flagA = True +if flagA and flagB: + print(""AMBIGUOUS"") +elif flagA and not flagB: + print(""MMYY"") +elif flagB and not flagA: + print(""YYMM"") +else: + print(""NA"")" +p03042,s615381440,Accepted,"x = int(input()) + +a = x % 100 +b = (x - a)//100 + +fa = False +fb = False + +if 0 < a <= 12: + fa = True +if 0 < b <= 12: + fb = True +if fa & fb: + print(""AMBIGUOUS"") +elif fa: + print(""YYMM"") +elif fb: + print(""MMYY"") +else: + print(""NA"")" +p03042,s230909881,Accepted,"s = input() +mae = int(s[:2]) +ush = int(s[2:]) + +if 1<=mae<=12: + if 1<=ush<=12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 1<=ush<=12: + print('YYMM') + else: + print('NA')" +p03042,s588388435,Accepted,"S = input() +f = int(S[:2]) +s = int(S[2:]) +t1 = False +t2 = False +if(f > 0 and f < 13): + t1 = True +if(s > 0 and s < 13): + t2 = True +if(t1 == True): + if(t2 == True):print('AMBIGUOUS') + else:print('MMYY') +else: + if(t2 == True):print('YYMM') + else:print('NA') +" +p03042,s700016766,Accepted,"s = int(input()) +a = s//100 +b = s%100 +if 0 < b and b < 13 and 0 < a and a < 13: + print(""AMBIGUOUS"") +elif 0 < b and b < 13: + print(""YYMM"") +elif 0 < a and a < 13: + print(""MMYY"") +else: + print(""NA"")" +p03042,s917546461,Accepted,"s = input() +mae = int(s[:2]) +usiro = int(s[2:]) + +ym = 0 +my = 0 + +if (1 <= usiro <= 12): ym = 1 +if (1 <= mae <= 12): my = 1 + +if (ym and my): print(""AMBIGUOUS"") +elif (ym): print(""YYMM"") +elif (my): print(""MMYY"") +else: print(""NA"") + +" +p03042,s440983619,Accepted,"def solve_128b(a, b): + if 1 <= a & a <= 12: + if 1 <= b & b <= 12: + return ""AMBIGUOUS"" + else: + return ""MMYY"" + else: + if 1 <= b & b <= 12: + return ""YYMM"" + else: + return ""NA"" + +s = int(input()) +s2 = int(s / 100) +s1 = s % 100 +print(solve_128b(s2, s1))" +p03042,s070796295,Accepted,"#126 +s = input() + +a = int(s[0:2]) +b = int(s[2:]) + +res = """" +if 1 <= a and a <= 12: + if 1 <= b and b <= 12: + res = ""AMBIGUOUS"" + else: + res = ""MMYY"" +else: + if 1 <= b and b <= 12: + res = ""YYMM"" + else: + res = ""NA"" +print(res)" +p03042,s495674076,Accepted,"S = input() +A = int(S[0:2]) +B = int(S[2:4]) + +if (0 < A) and (A <= 12): + if (0 < B) and (B <= 12): + print('AMBIGUOUS') + else: + print('MMYY') + +else: + if (0 < B) and (B <= 12): + print('YYMM') + else: + print('NA')" +p03042,s303129757,Accepted,"S = input() +MM = [""01"",""02"",""03"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if S[:2] in MM and S[2:] in MM: + print(""AMBIGUOUS"") +elif S[:2] in MM: + print(""MMYY"") +elif S[2:] in MM: + print(""YYMM"") +else: + print(""NA"")" +p03042,s693927740,Accepted,"S = input() +a,b = int(S[:2]),int(S[2:]) +if (1<=a and a<=12) or (1<=b and b<=12): + if (1<=a and a<=12) and (1<=b and b<=12): + print(""AMBIGUOUS"") + elif (1<=b and b<=12): + print(""YYMM"") + elif (1<=a and a<=12): + print(""MMYY"") + +else: + print(""NA"") + + + + +" +p03042,s674391508,Accepted,"def q2(): + S = int(input()) + d, m = divmod(S, 100) + + is_YYMM, is_MMYY = False, False + if 1 <= d <= 12: + is_MMYY = True + if 1 <= m <= 12: + is_YYMM = True + + if is_MMYY: + if is_YYMM: + print('AMBIGUOUS') + else: + print('MMYY') + else: + if is_YYMM: + print('YYMM') + else: + print('NA') + + +if __name__ == '__main__': + q2() +" +p03042,s259537698,Accepted,"S = input() + +mae = int(S[:2]) +ato = int(S[2:]) + +if 1 <= mae <= 12 and 1 <= ato <= 12: + print(""AMBIGUOUS"") +elif 1 <= ato <= 12: + print(""YYMM"") +elif 1 <= mae <= 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s299506057,Accepted,"s = list(map(int, input())) +l = [0]*2 +l[0] = s[0]*10 + s[1] +l[1] = s[2]*10 + s[3] + +F = False +L = False + +if 0 < l[0] <= 12: + F = True +if 0 < l[1] <= 12: + L = True + +if F == True and L == True: + print('AMBIGUOUS') + +elif F == True: + print('MMYY') + +elif L == True: + print('YYMM') + +else: + print('NA')" +p03042,s364171288,Accepted,"s=input() +flag1=0 +flag2=0 +if 0 12 or b == 0)): print(""MMYY"") +elif ((0 < b and b <= 12) and (f > 12 or f == 0)): print(""YYMM"") +elif (f == 0 or b == 0 or (f > 12 and b > 12)): print(""NA"") +else: print(""AMBIGUOUS"") +" +p03042,s643048611,Accepted,"s = str(input()) +ans = ['YYMM','MMYY','AMBIGUOUS','NA'] +#print(s[:2],s[-2:]) +if (0==int(s[:2]) or 13<=int(s[:2])) and (0==int(s[-2:]) or 13<=int(s[-2:])): + print(ans[3]) +if 0= 1 and int(former) <= 12: + if int(latter) >= 1 and int(latter) <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if int(latter) >= 1 and int(latter) <= 12: + print(""YYMM"") + else: + print(""NA"") +" +p03042,s377336257,Accepted,"s = str(input()) +num = ['01','02','03','04','05','06','07','08','09','10','11','12'] +if s[:2] in num and s[2:] in num: + print(""AMBIGUOUS"") +elif s[:2] in num: + print(""MMYY"") +elif s[2:] in num: + print(""YYMM"") +else: + print(""NA"")" +p03042,s427427945,Accepted,"num = list(map(int, input())) + +f = num[0]*10 + num[1] +b = num[-2]*10 + num[-1] + +if 0 < f <= 12 and 0 < b <= 12: + print('AMBIGUOUS') +elif 0 < f <= 12: + print('MMYY') +elif 0 < b <= 12: + print('YYMM') +else: + print('NA')" +p03042,s591887313,Accepted,"import sys +S = list(input()) +S = [S[0]+S[1],S[2]+S[3]] +month = ['01','02','03','04','05','06','07','08','09','10','11','12'] + +# 月表示、年表示についてのステータス +# [前表示、後ろ表示] +mon = [0,0] +yer = [0,0] + +if S[0] in month: + mon[0] = 1 +if S[1] in month: + mon[1] = 1 + + +if mon[0] == 1 and mon[1] == 1: + print('AMBIGUOUS') + sys.exit() +if mon[0] == 1: + print('MMYY') + sys.exit() +if mon[1] == 1: + print('YYMM') + sys.exit() +else: + print('NA') + sys.exit() +" +p03042,s542189391,Accepted,"s = input() + +ans = [0, 0] +for i in range(100): + for j in range(1, 13): + if str(i).zfill(2) + str(j).zfill(2) == s: + ans[0] = 1 + if str(j).zfill(2) + str(i).zfill(2) == s: + ans[1] = 1 + +if sum(ans) == 2: + print(""AMBIGUOUS"") +elif ans[0] == 1: + print(""YYMM"") +elif ans[1] == 1: + print(""MMYY"") +else: + print(""NA"")" +p03042,s098542985,Accepted,"import math +import sys +import numpy as np + +def int_input(): + return map(int, input().split()) + +s = input() + +flag = 0 +if 1 <= int(s[:2]) <= 12: flag += 2 +if 1 <= int(s[2:]) <= 12: flag += 1 + +ans = [""NA"", ""YYMM"", ""MMYY"", ""AMBIGUOUS""] +print(ans[flag]) +" +p03042,s639314236,Accepted,"s = input() +# YYMM +aa = int(s[0]+s[1]) +bb = int(s[2]+s[3]) +if aa>=13 or aa==0: + if 0= 12: + print('MMYY') +elif 0 < int(s[:2]) < 12 and int(s[2:]) == 0: + print('MMYY') +elif int(s[:2]) >= 12 > 0 and 0 < int(s[2:]) <= 12: + print('YYMM') +elif int(s[:2]) == 0 and 0 < int(s[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s150846157,Accepted,"S = input() +S = list(S) +S1 = S[0] + S[1] +S1 = int(S1) +S2 = S[2] + S[3] +S2 = int(S2) + +if 1 <= S1 and S1 <= 12: + if 1 <= S2 and S2 <=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + +elif 1 <= S2 and S2 <= 12: + print(""YYMM"") + +else: + print(""NA"")" +p03042,s519399102,Accepted,"S = input() + +if (1 <= int(S[:2]) <= 12) and (1 <= int(S[2:4]) <= 12): + print('AMBIGUOUS') +elif (0 <= int(S[:2]) <= 99) and (1 <= int(S[2:4]) <= 12): + print('YYMM') +elif (1 <= int(S[:2]) <= 12) and (0 <= int(S[2:4]) <= 99): + print('MMYY') +else: + print('NA')" +p03042,s273449059,Accepted,"S=input().strip() +a=int(S[:2]) +b=int(S[2:]) +aa = a < 13 and a != 0 +bb = b < 13 and b != 0 + +if aa and bb: + ans = 'AMBIGUOUS' +elif aa and not bb: + ans = 'MMYY' +elif bb and not aa: + ans = 'YYMM' +else: + ans = 'NA' +print(ans) +" +p03042,s300467934,Accepted,"yymm = input() + +if (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12): + print('AMBIGUOUS') +elif (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and int(yymm[2:4]) <= 99: + print('MMYY') +elif int(yymm[0:2]) <= 99 and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12): + print('YYMM') +else: + print('NA')" +p03042,s780314883,Accepted,"def f(s): + m,y = int(s[:2]), int(s[2:]) + return (0 < m <= 12,0 < y <= 12) + +p,q = map(int,list(f(raw_input()))) +print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[(p,q)] +" +p03042,s619518031,Accepted,"s = input() +a = int(s[:2]) #上2桁 +b = int(s[2:]) #下2桁 + +if 0 < a < 13: + if 0 < b < 13: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 0 < b < 13: + print('YYMM') + else: + print('NA')" +p03042,s187034968,Accepted,"def aaa(s): + if s[0]=='0': + if s[1]=='0': + return 'y' + return 'm' + elif s[0]=='1': + if int(s[1])<3: + return 'm' + return 'y' + +s = input() +l = aaa(s[:2]) +r = aaa(s[2:]) +if l=='m' and r=='m': + print('AMBIGUOUS') +elif l=='m' and r=='y': + print('MMYY') +elif l=='y' and r=='m': + print('YYMM') +else: + print('NA')" +p03042,s035479907,Accepted,"S = input() + +L = int(S[:2]) +R = int(S[2:]) + +if 1 <= L <= 12 and 1 <= R <= 12: + print('AMBIGUOUS') +elif 1 <= R <= 12: + print('YYMM') +elif 1 <= L <= 12: + print('MMYY') +else: + print('NA') +" +p03042,s832578722,Accepted,"# -*- coding: utf-8 -*- + +s = input() + +a = int(s[0])*10 + int(s[1]) +b = int(s[2])*10 + int(s[3]) + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=a<=12: + print('MMYY') +elif 1<=b<=12: + print('YYMM') +else: + print('NA')" +p03042,s067613372,Accepted,"s=list(input()) +S=[] +for i in range(len(s)): + S.append(int(s[i])) +if 1<=S[2]*10+S[3] and S[2]*10+S[3]<=12: + if 1<=S[0]*10+S[1] and S[0]*10+S[1]<=12: + print('AMBIGUOUS') + else: + print('YYMM') +else: + if 1<=S[0]*10+S[1] and S[0]*10+S[1]<=12: + print('MMYY') + else: + print('NA')" +p03042,s736609041,Accepted,"s = input() + +aa = int(s[0])*10 + int(s[1]) +bb = int(s[2])*10 + int(s[3]) + +if 1 <= aa <= 12 and 1 <= bb <= 12 : + print(""AMBIGUOUS"") +elif 1 <= aa <= 12 and bb == 0 : + print(""MMYY"") +elif 1 <= aa <= 12 and 13 <= bb : + print(""MMYY"") +elif aa == 0 and 1<= bb <= 12 : + print(""YYMM"") +elif 13<=aa and 1<=bb<=12 : + print(""YYMM"") +else : + print(""NA"") +" +p03042,s908608027,Accepted,"form = input().strip() +m_limit = [""{:0>2}"".format(i) for i in range(1, 13)] + +f2d, l2d = form[:2], form[2:] +if f2d in m_limit and l2d in m_limit: + print(""AMBIGUOUS"") +elif f2d in m_limit: + print(""MMYY"") +elif l2d in m_limit: + print(""YYMM"") +else: + print(""NA"") + + + +" +p03042,s688153000,Accepted,"s = input() +aa = s[:2] +bb = s[2:] +if 0 < int(aa) < 13 and 0 < int(bb) < 13: + print('AMBIGUOUS') +elif 0 < int(aa) < 13: + print('MMYY') +elif 0 < int(bb) < 13: + print('YYMM') +else: + print('NA') +" +p03042,s891153585,Accepted,"S=input() +s=int(S[:2]) +t=int(S[2:]) +if (s>12 or s==0) and (t>12 or t==0): + print(""NA"") +elif s>=1 and s<=12 and (t>12 or t==0): + print(""MMYY"") +elif t>=1 and t<=12 and (s>12 or s==0): + print(""YYMM"") +else: + print(""AMBIGUOUS"")" +p03042,s697240360,Accepted,"S=input() +x=int(S[:2]) +y=int(S[2:]) +if x==0: + if 0=13: + if 012): + ans=""MMYY"" +elif 1<=int(ba)<=12 and (int(fr)<1 or int(fr)>12): + ans=""YYMM"" +elif (int(ba)<1 or int(ba)>12) and (int(ba)<1 or int(ba)>12): + ans=""NA"" +print(ans) +" +p03042,s383529268,Accepted,"S=input() + +if (int(S[:2])>12 or int(S[:2])==0) and 012 or int(S[2:])==0): + print(""MMYY"") +elif 0 0 and int(s) <= 12 + isOnlyYY = lambda s: int(s)>12 or int(s) == 0 + if isMM(S[:2]) and isOnlyYY(S[2:]): print('MMYY') + elif isOnlyYY(S[:2]) and isMM(S[2:]): print('YYMM') + elif isMM(S[:2]) and isMM(S[2:]): print('AMBIGUOUS') + else: print('NA') + +if __name__ == '__main__': + main() +" +p03042,s017583652,Accepted,"def is_yymm(fmt): + _, month = fmt[:2], fmt[2:] + if 1 <= int(month) <= 12: + return True + else: + return False + + +def is_mmyy(fmt): + month, _ = fmt[:2], fmt[2:] + if 1 <= int(month) <= 12: + return True + else: + return False + + +s = input() +if is_mmyy(s) and is_yymm(s): + print('AMBIGUOUS') +elif is_mmyy(s): + print('MMYY') +elif is_yymm(s): + print('YYMM') +else: + print('NA')" +p03042,s635868756,Accepted,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=b<=12: + print('YYMM') +elif 1<=a<=12: + print('MMYY') +else: + print('NA')" +p03042,s084241672,Accepted,"S=list(input()) +F=int(''.join(S[0:2])) +B=int(''.join(S[2:4])) +if 012 and B>12: + ans='NA' +elif F>12 and 012 and 0 0: + is_month_first = True +if last <= 12 and last > 0: + is_month_last = True + +if is_month_first and is_month_last: + print(""AMBIGUOUS"") +elif not is_month_first and not is_month_last: + print(""NA"") +else: + if is_month_first: + print(""MMYY"") + else: + print(""YYMM"")" +p03042,s488890773,Accepted,"s = input() +before = int(s[:2]) +after = int(s[2:]) +if 1 <= before <= 12: + if 1 <= after <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 1 <= after <= 12: + print('YYMM') + else: + print('NA')" +p03042,s840684356,Accepted,"s=input() +t,u=0 12 and S2 > 12)): + print('NA') +elif(S1 == 0 or S2 ==0): + if(S1 < 13 and S1 > 0): + print('MMYY') + elif(S2 < 13 and S2 > 0): + print('YYMM') + else: + print('NA') +elif(S1 < 13 and S2 < 13): + print('AMBIGUOUS') +elif(S1 < 13 and S1 > 0): + print('MMYY') +elif(S2 < 13 and S2 > 0): + print('YYMM') +" +p03042,s548303963,Accepted,"s = int(input()) +b = s%100 +a = (s - b)//100 +if (0 < a <= 12 and 0 < b <= 12): + print(""AMBIGUOUS"") +elif (0 < a <= 12): + print(""MMYY"") +elif (0 < b <= 12): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s842331495,Accepted,"#!/usr/bin/env python3 +s = input() +a=0 12 or int(s_f) == 0) and (int(s_s) > 12 or int(s_s) == 0): + print('NA') +elif int(s_f) > 12 or int(s_f) == 0: + print('YYMM') +elif int(s_s) > 12 or int(s_s) == 0: + print('MMYY') + +else: + print('AMBIGUOUS')" +p03042,s308348418,Accepted,"s=list(input()) +a=int(s[0])*10+int(s[1]) +b=int(s[2])*10+int(s[3]) +if (a>12 or a<1) and (b>12 or b<1): + print(""NA"") +elif (a>12 or a<1): + print(""YYMM"") +elif (b>12 or b<1): + print(""MMYY"") +else: + print(""AMBIGUOUS"") +" +p03042,s550673460,Accepted,"from datetime import datetime + +S = input() +a = S[:2] +b = S[2:] + +def is_month(m): + m = int(m) + return 0 < m < 13 + +def is_year(y): + y = int(y) + return True + +if is_month(a) and is_year(a) and is_month(b) and is_year(b): + print(""AMBIGUOUS"") +elif is_month(a) and is_year(b): + print(""MMYY"") +elif is_year(a) and is_month(b): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s268772080,Accepted,"S = str(input()) + +mae = str(S[:2]) +ato = str(S[2:]) + +if (1 <= int(mae) <= 12) and (1 <= int(ato) <= 12): + print('AMBIGUOUS') +elif (1 <= int(mae) <= 12): + print('MMYY') +elif (1 <= int(ato) <= 12): + print('YYMM') +else: + print('NA') +" +p03042,s192485409,Accepted,"S=input() +first = S[:2] +second= S[2:] +ans="""" + + +if int(first) > 12 or int(first) == 0:#MM + if int(second) <= 12 and int(second) >= 1:#YY + ans=""YYMM"" + if int(second) > 12 or int(second) == 0:#YY + ans=""NA"" + +elif int(first) <= 12 and int(first) >= 1:#YY + if int(second) <= 12 and int(second) >= 1:#YY + ans=""AMBIGUOUS"" + if int(second) > 12 or int(second) == 0:#YY + ans=""MMYY"" + +print(ans)" +p03042,s209428866,Accepted,"# -*- coding: utf-8 -*- +"""""" +Created on Wed May 13 12:19:27 2020 + +@author: shinba +"""""" + +s = input() + +B1 = (s[0] == ""0"" and s[1] != ""0"") or (s[0] == ""1"" and 0 <= int(s[1]) <= 2) +B2 = (s[2] == ""0"" and s[3] != ""0"") or (s[2] == ""1"" and 0 <= int(s[3]) <= 2) + +if B1 and B2: + print(""AMBIGUOUS"") +elif B1: + print(""MMYY"") +elif B2: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s811541118,Accepted,"n = int(input()) + +d2 = n % 100 +u2 = n // 100 + +if 1 <= d2 <= 12 and 1 <= u2 <= 12: + print(""AMBIGUOUS "") +elif 1 <= d2 <= 12: + print(""YYMM"") +elif 1 <= u2 <= 12: + print(""MMYY"") +else: + print(""NA"") +" +p03042,s583103948,Accepted,"S = list(input()) + +a = int("""".join(S[0:2])) +b = int("""".join(S[2:4])) + +if 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +elif 1 <= a <= 12: + print(""MMYY"") +elif 1 <= b <= 12: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s764290931,Accepted,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if 0 < a <= 12: + if 0 < b <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 0 < b <= 12: + print(""YYMM"") + else: + print(""NA"") + +" +p03042,s731143350,Accepted,"S = input() + +former = int(S[:2]) +latter = int(S[2:]) + +if 1 <= former <= 12 and 1 <= latter <= 12: + print('AMBIGUOUS') +elif 1 <= former <= 12: + print('MMYY') +elif 1 <= latter <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s963438045,Accepted,"a=input() +a_i=int(a[0:2]) +b_i=int(a[2:4]) +if 0 12): + print('MMYY') +elif (a == 0 or a > 12) and 0 < b <= 12: + print('YYMM') +elif 0 < a <= 12 and 0 < b <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s439920726,Accepted,"s = input() +first = int(s[:2]) +second = int(s[2:]) + +month = [False,False] + + +if(1 <= first and first <= 12): + month[0] = True + +if(1 <= second and second <= 12): + month[1] = True + +if(month[0] & month[1]): + print('AMBIGUOUS') +elif(month[0]): + print('MMYY') +elif(month[1]): + print('YYMM') +else: + print('NA') + +" +p03042,s354878494,Accepted,"S = str(input()) +year = int(S[0] + S[1]) +month = int(S[2] + S[3]) +if year <= 12 and year >= 1 and month >= 1 and month <= 12: + print('AMBIGUOUS') +elif year >= 0 and year <= 99 and month >= 1 and month <= 12: + print('YYMM') +elif year >= 1 and year <= 12 and month >= 0 and month <= 99: + print('MMYY') +else: + print('NA')" +p03042,s758787338,Accepted,"s=int(input()) +a=s//100 +b=s%100 + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=a<=12 and not 1<=b<=12: + print('MMYY') +elif not 1<=a<=12 and 1<=b<=12: + print('YYMM') +else: + print('NA')" +p03042,s858310342,Accepted,"def main(): + s = int(input()) + f = int(s/100) + b = s%100 + + if f > 0 and f <= 12: + if b > 0 and b <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + else: + if b > 0 and b <= 12: + print(""YYMM"") + else: + print(""NA"") + +main() +" +p03042,s188074593,Accepted,"S = input() + +l = S[:2] +r = S[2:] + +def isMonth(num): + if 1 <= int(num) <= 12: + return True + else: + return False + +if isMonth(l) and isMonth(r): + print(""AMBIGUOUS"") +elif isMonth(l): + print(""MMYY"") +elif isMonth(r): + print(""YYMM"") +else: + print(""NA"")" +p03042,s484720907,Accepted,"s = list(input()) +a = int("""".join(s[:2])) +b = int("""".join(s[2:])) +c = 0 +d = 0 +if a and a <= 12: + c = 1 +if b and b <= 12: + d = 1 +if c and d: + print(""AMBIGUOUS"") +elif c: + print(""MMYY"") +elif d: + print(""YYMM"") +else: + print(""NA"")" +p03042,s973947527,Accepted,"S = int(input()) + +a = S//100 +b = S%100 + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=a<=12 and (b>12 or b==0): + print('MMYY') +elif (a==0 or a>12) and 1<=b<=12: + print('YYMM') +else: + print('NA') +" +p03042,s480587053,Accepted,"def chk(innum): + if 1<=innum and innum<=12: + return ""MM"" + elif 0<=innum and innum<=99: + return ""YY"" + +s=input() +front=int(s[0:2]) +back=int(s[2:4]) +ans=chk(front)+chk(back) +if ans==""YYYY"": + ans=""NA"" +elif ans==""MMMM"": + ans=""AMBIGUOUS"" +print(ans)" +p03042,s041938781,Accepted,"S = str(input()) + +S_list = [int(S[:2]), int(S[2:])] + + +if 1 <= S_list[1] and S_list[1] <= 12 and 1 <= S_list[0] and S_list[0] <= 12: + print('AMBIGUOUS') +elif 1 <= S_list[1] and S_list[1] <= 12: + print('YYMM') +elif 1 <= S_list[0] and S_list[0] <= 12: + print('MMYY') +else: + print('NA')" +p03042,s040813145,Accepted,"def solve(yy,mm): + if 1<=yy<=12: + if 1 <= mm <=12: + return 'AMBIGUOUS' + else: + return 'MMYY' + else: + if 1<= mm <= 12: + return 'YYMM' + else: + return ""NA"" + + +s = input() +yy = int(s[:2]) +mm = int(s[2:]) +print(solve(yy,mm))" +p03042,s713117463,Accepted,"s = input() +first = 0 < int(s[:2]) < 13 +second = 0 < int(s[2:]) < 13 + +if first and second: + print('AMBIGUOUS') +elif first: + print('MMYY') +elif second: + print('YYMM') +else: + print('NA') +" +p03042,s508220225,Accepted,"import sys +from bisect import * +from heapq import * +from collections import * +from itertools import * +from functools import * +from math import * + +sys.setrecursionlimit(100000000) +input = lambda: sys.stdin.readline().rstrip() + +S = input() +x, y = int(S[:2]), int(S[2:]) +yymm = 1 <= y <= 12 +mmyy = 1 <= x <= 12 +if yymm and mmyy: + print('AMBIGUOUS') +elif yymm: + print('YYMM') +elif mmyy: + print('MMYY') +else: + print('NA') +" +p03042,s511245948,Accepted,"S = int(input()) +s1 = S//100 +s2 = S%100 + +if s1 > 0 and s1 <=12: + flag1 = True +else: + flag1 = False +if s2 > 0 and s2 <=12: + flag2 = True +else: + flag2 = False + +if flag1 and flag2: + print(""AMBIGUOUS"") +if not flag1 and flag2: + print(""YYMM"") +if flag1 and not flag2: + print(""MMYY"") +if not flag1 and not flag2: + print(""NA"")" +p03042,s444501087,Accepted,"S = input() +month_list = [""01"",""02"",""03"",""04"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if S[0:2] in month_list: + if S[2:4] in month_list: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + +else: + if S[2:4] in month_list: + print(""YYMM"") + else: + print(""NA"")" +p03042,s057744036,Accepted,"import sys +import heapq +import math +import fractions +import bisect +import itertools +from collections import Counter +from collections import deque +from operator import itemgetter +def input(): return sys.stdin.readline().strip() +def mp(): return map(int,input().split()) +def lmp(): return list(map(int,input().split())) + +s=int(input()) +a=s//100 +b=s%100 +if 0 0 and s1 < 13: + if s2 > 0 and s2 < 13: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if s2 > 0 and s2 < 13: + print(""YYMM"") + else: + print(""NA"")" +p03042,s057426098,Accepted,"S = input() + +front = int(S[:2]) +rear = int(S[2:]) + +if (front > 12 and rear > 12) or (front > 12 and rear == 0) or (rear > 12 and front == 0) or (front == 0 and rear == 0): + print(""NA"") + exit() +elif 0 < rear <= 12 and (front > 12 or front == 0): + print(""YYMM"") + exit() +elif 0 < front <= 12 and (rear > 12 or rear == 0): + print(""MMYY"") +elif 0 < front <= 12 and 0 < rear <= 12: + print(""AMBIGUOUS"") +" +p03042,s062347674,Accepted,"S=list(input()) +def main(): + while True: + if 1<=int(S[0]+S[1])<=12: + if 1<=int(S[2]+S[3])<=12: + return 'AMBIGUOUS' + else: + return 'MMYY' + else: + if 1<=int(S[2]+S[3])<=12: + return 'YYMM' + else: + return 'NA' + +print(main())" +p03042,s071243962,Accepted,"s = input() +s1 = int(s[:2]) +s2 = int(s[2:]) +if 1<=s1<=12 and 1<=s2<=12: + print('AMBIGUOUS') +elif 1<=s1<=12: + print('MMYY') +elif 1<=s2<=12: + print('YYMM') +else: + print('NA')" +p03042,s283199982,Accepted,"S = input() +L = int(S[:2]) +R = int(S[2:]) + +if 1<=L<=12 and 1<=R<=12: + print(""AMBIGUOUS"") +elif 1<=L<=12: + print(""MMYY"") +elif 1<=R<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s976063134,Accepted,"S = input() +pre = int(S[:2]) +sur = int(S[2:]) +if pre <= 12 and pre > 0 and sur <= 12 and sur > 0: + print('AMBIGUOUS') +elif pre <= 12 and pre > 0: + print('MMYY') +elif sur <= 12 and sur > 0: + print('YYMM') +else: + print('NA') +" +p03042,s304724651,Accepted,"S=input() +s=int(S[:2]) +t=int(S[2:]) +if (s>12 or s==0) and (t>12 or t==0): + print(""NA"") +elif s>=1 and s<=12 and (t>12 or t==0): + print(""MMYY"") +elif t>=1 and t<=12 and (s>12 or s==0): + print(""YYMM"") +else: + print(""AMBIGUOUS"")" +p03042,s296166669,Accepted,"S = int(input()) +s_1 = S // 100 +s_2 = S % 100 + +if 1 <= s_1 <= 12 and 1 <= s_2 <= 12: + print('AMBIGUOUS') +elif 1 <= s_1 <= 12 and (s_2 < 1 or s_2 > 12): + print('MMYY') +elif 1 <= s_2 <= 12 and (s_1 < 1 or s_1 > 12): + print('YYMM') +else: + print('NA')" +p03042,s421149254,Accepted,"def main(): + S=int(input()) + a=S//100 + b=S%100 + if 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS "") + elif 1<=a<=12 and (b==0 or 13<=b<=99): + print(""MMYY"") + elif 1<=b<=12 and (a==0 or 13<=a<=99): + print(""YYMM"") + else: + print(""NA"") +main()" +p03042,s022540167,Accepted,"s = input() + +if int(s[:2]) >= 1 and int(s[:2]) <= 12 and int(s[2:]) >= 1 and int(s[2:]) <= 12: + print('AMBIGUOUS') +elif int(s[:2]) >= 1 and int(s[:2]) <= 12: + print('MMYY') +elif int(s[2:]) >= 1 and int(s[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s331322340,Accepted,"s=str(input()) +a=int(s[0:2]) +b=int(s[2:4]) + +if 1<=a<=12: + if 1<=b<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1<=b<=12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s711494434,Accepted,"S = input() +YYMM = 0 +MMYY = 0 +start = S[0:2] +end = S[2:4] +tmp1 = int(start) +tmp2 = int(end) +if(tmp2 <= 12 and tmp2 != 0): + YYMM = 1 +if(tmp1 <= 12 and tmp1 != 0): + MMYY = 1 +if(YYMM == 1 and MMYY == 1): + print(""AMBIGUOUS"") +elif(YYMM == 1): + print(""YYMM"") +elif(MMYY == 1): + print(""MMYY"") +else: + print(""NA"")" +p03042,s477367106,Accepted,"s = int(input()) + +a = s % 100 +b = (s-a) / 100 + +if a >= 1 and a <= 12: + if b >= 1 and b <= 12: + print('AMBIGUOUS') + else: + print('YYMM') +else: + if b >= 1 and b <= 12: + print('MMYY') + else: + print('NA')" +p03042,s899820429,Accepted,"S = input() + +if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12: + print(""AMBIGUOUS"") +elif int(S[:2]) >= 0 and 1 <= int(S[2:]) <= 12: + print(""YYMM"") +elif int(S[2:]) >= 0 and 1 <= int(S[:2]) <= 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s093794589,Accepted,"S = input() + +if int(S[0:2]) > 12 or S[0:2] == ""00"": + if 0 < int(S[2:4]) <= 12: + print(""YYMM"") + else: + print(""NA"") +else: + if 0 < int(S[2:4]) <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"")" +p03042,s986217357,Accepted,"S=input() +a=int(S[:2]) +b=int(S[2:]) +if((012 or b==0): + ans = 'MMYY' +elif (a>12 or a==0) and 0 12 + + +def is_month(a): + return 0 < a <= 12 + + +if is_only_year(head) and is_month(tail): + print(""YYMM"") +elif is_month(head) and is_only_year(tail): + print(""MMYY"") +elif is_month(head) and is_month(tail): + print(""AMBIGUOUS"") +else: + print(""NA"") +" +p03042,s439979185,Accepted,"import bisect,collections,copy,heapq,itertools,math,string +import sys +def S(): return sys.stdin.readline().rstrip() +def M(): return map(int,sys.stdin.readline().rstrip().split()) +def I(): return int(sys.stdin.readline().rstrip()) +def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) +def LS(): return list(sys.stdin.readline().rstrip().split()) +s = S() +ans = '' +xx = int(s[0:2]) +zz = int(s[2:4]) +if xx < 13 and zz < 13 and xx != 0 and zz != 0: + ans = 'AMBIGUOUS' +elif xx < 13 and xx != 0: + ans = 'MMYY' +elif zz < 13 and zz != 0: + ans = 'YYMM' +else: + ans = 'NA' +print(ans)" +p03042,s044038571,Accepted,"n=int(input()) +front=n//100 +back=n%100 +if 1<=front<=12 and 1<=back<=12: + print(""AMBIGUOUS"") +elif 1<=front<=12: + print(""MMYY"") +elif 1<=back<=12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s014435898,Accepted,"s = input() +ans = 0 +for i in range(0,3,2): + if s[i] == ""0"" and s[i+1] == ""0"": + continue + elif s[i] == ""0"": + ans += i+1 + elif (s[i] == ""1"" and s[i+1] == ""0"") or (s[i] == ""1"" and s[i+1] == ""1"") or (s[i] == ""1"" and s[i+1] == ""2""): + ans += i+1 +if ans == 1: + print(""MMYY"") +elif ans == 3: + print(""YYMM"") +elif ans == 4: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s652490418,Accepted,"s=input() +s1=int(s[:2]) +s2=int(s[2:]) + +if 1<=s1<=12 and 1<=s2<=12: + print(""AMBIGUOUS"") +elif 0<=s1<=99 and 1<=s2<=12: + print(""YYMM"") +elif 1<=s1<=12 and 0<=s2<=99: + print(""MMYY"") +else: + print(""NA"")" +p03042,s167357343,Accepted,"n = input() +a = int(n[:2]) +b = int(n[2:]) +x = 0 < a <= 12 +y = 0 < b <= 12 +if x and y : + print('AMBIGUOUS') +elif not x and y: + print('YYMM') +elif x and not y: + print('MMYY') +else: + print('NA')" +p03042,s185394043,Wrong Answer,"N=int(input("" "")) +Y=N%100 +M=N//100 +if M>11: + print(""YYMM"") +elif Y>11: + print(""MMYY"") +elif M<13: + print(""AMBIGUOUS"") +elif M==0 or Y==0: + print(""NA"")" +p03042,s413833771,Wrong Answer,"s = list(input()) +ans = 'NA' +if 12 < int(s[0]+s[1]): + if 1<=int(s[2]+s[3]) and int(s[2]+s[3])<=12: + ans = 'YYMM' +else: + if 1<=int(s[0]+s[1]) and int(s[0]+s[1])<=12: + ans = 'AMBIGUOUS' +print(ans)" +p03042,s289276840,Wrong Answer,"s = input() +n1 = int(s[:2]) +n2 = int(s[2:]) +if 1 <= n1 <= 12 and 1 <= n2 <= 12: + print(""AMBIGUOUS"") +elif n1 > 12 and 1 <= n2 <= 12: + print(""YYMM"") +elif 1 <= n1 <= 12 and n2 > 12: + print(""MMYY"") +else: + print(""NA"") +" +p03042,s479137576,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:4]) + +if b>=13 or b==0: + print('NA') +elif f>=13: + print('YYMM') +else: + print('AMBIGUOUS')" +p03042,s732699766,Wrong Answer,"S = input() + +if S[:2] == '00' or S[2:] == '00': + print('NA') +elif int(S[:2]) <= 12 and int(S[2:]) <= 12: + print('AMBIGUOUS') +elif int(S[:2]) <= 12: + print('MMYY') +elif int(S[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s108726626,Wrong Answer,"def main(): + S = input() + if int(S[:2]) > 12 and 12 >= int(S[2:]) > 0: + print(""YYMM"") + elif 0 < int(S[2:]) <= 12 and 12 < int(S[:2]): + print(""MMYY"") + elif 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + print(""AMBIGUOUS"") + else: + print(""NA"") + + +if __name__ == '__main__': + main() +" +p03042,s821837505,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:]) +if f>=13: + if 0 12 and lowInt > 12: + ans = 'NA' +elif highInt < 13: + ans = 'MMYY' +else: + ans = 'YYMM' + +print(ans)" +p03042,s944274706,Wrong Answer,"x = input() +a, b = int(x[0:2]), int(x[2:4]) +flag = 0 +ans = [""AMBIGUOUS"", ""YYMM"", ""MMYY"", ""NA""] + +if (a >= 1 and a <= 12) and (b >= 1 and b <= 12): + flag = 0 +elif (a == 0 and b > 12) or (b == 0 and a > 12) or (b > 12 and a > 12): + flag = 3 +elif (a > 0 and a <= 12) and (b >= 13): + flag = 2 +elif (a >= 13) and (b > 0 and b <= 12): + flag = 1 + + +print(ans[flag]) +" +p03042,s270994044,Wrong Answer,"S = input() +f, r = S[:2], S[2:] +if f == ""00"" or r == ""00"" or (int(f)>12 and int(r)>12): + ans = ""NA"" +elif int(f) > 12 and int(r) <= 12: + ans = ""YYMM"" +elif int(r) > 12 and int(f) <= 12: + ans = ""MMYY"" +else: + ans = ""AMBIGUOUS"" +print(ans)" +p03042,s297222825,Wrong Answer,"S = str(input()) +year = int(S[0] + S[1]) +month = int(S[2] + S[3]) +if year <= 12 and year >= 1 and month >= 1 and month <= 12: + print('AMBIGOUS') +elif year >= 1 and year <= 99 and month >= 1 and month <= 12: + print('YYMM') +elif year >= 12 and year <= 12 and month >= 1 and month <= 99: + print('MMYY') +else: + print('NA')" +p03042,s593072101,Wrong Answer,"S = list(input()) + +S = list(map(int, S)) + +if S[0] == S[1] == 0 or S[2] == S[3] == 0 or (S[0] > 1 and S[2] > 1): + print(""NA"") +elif S[2] > 1 or (S[2] == 1 and S[3] > 2): + print(""MMYY"") +elif S[0] > 1 or (S[0] == 1 and S[1] > 2): + print(""YYMM"") +else: + print(""AMBIGUOUS"") +" +p03042,s254562748,Wrong Answer,"s = input() + +s1 = int(s[0:2]) +s2 = int(s[2:4]) + +s1m = False +s1y = False +s2m = False +s2y = False +if s1 <= 12 and s1 >= 1: + s1y = True + s1m = True +elif s1 > 12 : + s1y = True + +if s2 <= 12 and s2 >= 1: + s2y = True + s2m = True +elif s2 > 12 : + s2y = True + +if s1y and s2y and s1m and s2m: + print(""AMBIGUOUS"") +elif s1y and s2m : + print(""YYMM"") +elif s2y and s1m : + print(""MMYY"") +else : + print(""NA"") + " +p03042,s426426042,Wrong Answer,"S = input() +f,e = int(S[:2]),int(S[2:]) +if f>12: + if 1<=e<=12: + print('YYMM') + else: + print('NA') +elif 1<=f<=12: + if e>12: + print('MMYY') + elif 1<=e<=12: + print('AMBIGUOUS') + else: + print('NA') +else: + print('NA') +" +p03042,s369972276,Wrong Answer,"def resolve(): + S = list(input()) + + front = int(''.join(S[:2])) + back = int(''.join(S[2:])) + + if (0 == front or 0 == back): + print('NA') + return + + if (front <= 12 and back <= 12): + print('AMBIGUOUS') + return + + if (front > 12 and back <= 12): + print('YYMM') + return + + if (front <= 12 and back > 12): + print('MMYY') + return + + print('NA') + +resolve()" +p03042,s284238238,Wrong Answer,"s = input() + +if '00' in s: + print('NA') +elif int(s[:2]) <= 12 and int(s[2:]) <= 12: + print('AMBIGUOUS') +elif int(s[2:]) > 13: + print('MMYY') +elif int(s[:2]) > 13: + print('YYMM') +else: + print('NA')" +p03042,s209656904,Wrong Answer,"s = input() +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +if s1 == s2 == 0: + print('NA') +elif s1 <= 12 and s2 <= 12: + print('AMBIGUOUS') +elif s1 <= 12: + print('MMYY') +elif s2 <= 12: + print('YYMM') +else: + print('NA')" +p03042,s856106690,Wrong Answer,"s = input() +if (int(s[:2]) > 12)&(int(s[2:]) <= 12)&(""00"" not in s): + print(""YYMM"") + +elif (int(s[:2]) <= 12)&(int(s[2:]) > 12)&(""00"" not in s): + print(""MMYY"") + +elif (int(s[:2]) <= 12)&(int(s[2:]) <= 12)&(""00"" not in s): + print(""AMBIGUOUS"") + +else: + print(""NA"")" +p03042,s279206471,Wrong Answer,"import sys, math, itertools, collections, bisect +input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') +inf = float('inf') ;mod = 10**9+7 +mans = inf ;ans = 0 ;count = 0 ;pro = 1 + +s = input() +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) +if a <= 12 and b <= 12: + print(""AMBIGUOUS"") +elif a <= 12: + print(""MMYY"") +elif b <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s611873170,Wrong Answer,"s = input() + +if s[:2] == ""00"" or s[2:] == ""00"": + print(""NA"") + exit() + +if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12: + print(""AMBIGUOUS"") + exit() + + +if int(s[2:]) > 13: + print(""MMYY"") +else: + print(""YYMM"") " +p03042,s067002039,Wrong Answer,"n=input() +a=int(n[0:2]) +b=int(n[2:4]) +if a<13 and b<13: + print('AMBIGUOUS') +elif a>0 and a<13: + print('MMYY') +elif 0 12 and int(month) != 0 and int(year) == 0: + print('MMYY') +elif int(year) > 12 and int(year) != 0 and int(month) != 0: + print('YYMM') +else: + print('NA')" +p03042,s633495990,Wrong Answer,"a,b,c,d=input() +x=int(a+b) +y=int(c+d) +if 1<=x<=12 and 1<=y<=12: + print('AMBIGUOUS') +elif 1<=x<=12 and 0<=y<=99: + print('MMYY') +elif 0<=x<=99 and 1<=x<12: + print('YYMM') +else: + print('NA')" +p03042,s717121079,Wrong Answer,"S = input() +F = int(S[0:2]) +SE = int(S[2:4]) + +if F > 12 and SE > 12: + print(""NA"") + +if F > 12 and SE <= 12: + print(""YYMM"") + +if F <= 12 and SE > 12: + print(""MMYY"") + +if F <= 12 and SE <= 12: + print(""AMBIGUOUS"") + + + +" +p03042,s068009949,Wrong Answer,"S = list(input()) + +ans = [] + +A = int(S[0] + S[1]) +B = int(S[2] + S[3]) + +if (1 <= A <= 12 and 1 <= B <= 12): + print(""AMBIGUOUS"") +elif (1 <= A <= 12 and 13 <= B <= 99): + print(""MMYY"") +elif (1 <= B <= 12 and 13 <= A <= 99): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s198575386,Wrong Answer,"s = input() +l = s[:2] +r = s[2:] + +if(int(l) <=12 and int(r) <= 12): + print('AMBIGUOUS') +else : + if(int(l) <= 12): + print('MMYY') + else: + if(int(r) <= 12): + print('YYMM') + else: + print('NA') + " +p03042,s735044749,Wrong Answer,"s=input() +a=int(s[0:2]) +b=int(s[2:]) +if 1<=a<=99 and 1<=b<=31: + if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') + else: + print('YYMM') +elif 1<=b<=99 and 1<=a<=31: + print('MMYY') +else: + print('NA')" +p03042,s184123550,Wrong Answer,"#B +s = list(input()) +left = int(s[0])*10+int(s[1]) +right = int(s[2])*10+int(s[3]) +print(left,right) +if 0 < left <= 12: + if 0 < right <= 12: + print(""AMBIGUOUS"") + else: + print('MMYY') +elif 0 < right <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s345639135,Wrong Answer,"s = input() + +f = (0 < int(s[:2]) < 12) +s = (0 < int(s[2:]) < 12) +ans = 'NA' +if f: + ans = 'YYMM' +elif s: + ans = 'MMYY' +elif f and s: + ans = 'AMBIGUOUS' +print(ans) +" +p03042,s885614394,Wrong Answer,"s=input() +if s[0] == '0': + if s[-2] == '0': + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif s[-2] == '0': + print(""YYMM"") +else: + print(""NA"")" +p03042,s325198027,Wrong Answer,"S=input() + +a=int(S[:2]) +b=int(S[2:]) + +if(1<=a<=12 and 1<=b<=12): + print(""AMBIGUOUS"") +elif(1<=a<=12): + print(""mmyy"") +elif(1<=b<=12): + print(""yymm"") +else: + print(""na"") +" +p03042,s758567106,Wrong Answer,"a,b,c,d=map(int,input()) +x=int(a+b) +y=int(c+d) +if 0<=x<=12 and 0<=b<=12: + if x==y==0: + print('NA') + else: + print('AMBIGUOUS') +elif 0<=x<=99 and 1<=y<=12: + print('YYMM') +elif 1<=x<=12 and 0<=y<=99: + print('MMYY') +else: + print('NA')" +p03042,s773883162,Wrong Answer,"S = str(input()) +front = int(S[:2]) +back = int(S[2:]) +S_list = list(S) + +if front > 12 or front == 0: + if 1 < back <= 12 : + print(""YYMM"") + else: + print(""NA"") +elif front <= 12 and front == 0: + if back <= 12 or back > 1: + print(""AMBIGUOUS"") + else: + print(""MMYY"")" +p03042,s385863042,Wrong Answer,"S = input() +a = int(S[:2]) +b = int(S[2:]) + +ym = False +my = False +if a > 0 and b>0 and b <= 12: + ym = True +if b > 0 and a>0 and a <= 12: + my = True + +if ym and my: + print(""AMBIGUOUS"") +elif ym and not(my): + print('YYMM') +elif not(ym) and my: + print('MMYY') +else: + print('NA') +" +p03042,s834429579,Wrong Answer,"S = input() +f,e = int(S[:2]),int(S[2:]) +if f==0 or e==0 or (f>12 and e>12): + print('NA') + exit() +if 1<=f<=12: + if e>12: + print('MMYY') + elif 1<=e<=12: + print('AMBIGUOUS') +elif f>12: + if 1<=e<=12: + print('YYMM') + " +p03042,s584533231,Wrong Answer,"#ABC126 B + +S = list(map(int,input())) +if S[0]*10 + S[1] <= 12 and S[2]*10 + S[3] <= 12: + print(""AMBIGUOUS"") +elif S[0]*10 + S[1] <= 12 and S[2]*10 + S[3] > 12: + print(""MMYY"") +elif S[0]*10 + S[1] > 12 and S[2]*10 + S[3] <= 12: + print(""YYMM"") +elif S[0]*10 + S[1] > 12 and S[2]*10 + S[3] > 12: + print(""NA"")" +p03042,s958530356,Wrong Answer,"def main(): + s = int(input()) + f = s/100 + b = s%100 + + if f > 0 and f <= 12: + if b > 0 and b <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + else: + if b > 0 and b <= 12: + print(""YYMM"") + else: + print(""NA"") + +main() +" +p03042,s713102134,Wrong Answer,"s = input() +a = int(s[0:2]) +b = int(s[2:4]) +if 0 < a <= 12 and 0 < b <= 12: + print(""AMBIGUOUS"") +elif (a > 12 and b > 12) or a == 0 or b == 0: + print(""NA"") +elif a > 12: + print(""YYMM"") +else: + print(""MMYY"")" +p03042,s889515349,Wrong Answer,"S = input() + +if (int(S[:2]) <= 0 or int(S[2:]) <= 0) or (int(S[:2]) > 12 and int(S[2:]) > 12): + print(""NA"") +elif int(S[:2]) > 12 and int(S[2:]) <= 12: + print(""YYMM"") +elif int(S[:2]) <= 12 and int(S[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s813830505,Wrong Answer,"S = list(input()) + +M = [""01"", ""02"", ""03"", ""04"", ""05"", ""06"", ""07"", ""08"", ""09"", ""10"", ""11"", ""12""] + +if S[0:2] in M and not(S[2:] in M): + print(""MMYY"") +elif not(S[0:2] in M) and S[2:] in M: + print(""YYMM"") +elif S[0:2] in M and S[2:] in M: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s045978597,Wrong Answer,"S = str(input()) +year = int(S[0] + S[1]) +month = int(S[2] + S[3]) +if year <= 12 and year >= 1 and month >= 1 and month <= 12: + print('AMBIGUOUS') +elif year >= 1 and year <= 99 and month >= 1 and month <= 12: + print('YYMM') +elif year >= 12 and year <= 12 and month >= 1 and month <= 99: + print('MMYY') +else: + print('NA')" +p03042,s041815875,Wrong Answer,"S = input() +f, r = int(S[:2]), int(S[2:]) +#print(f) +#print(r) +if f == 0 or r == 0 or (f > 12 and r > 12): + ans = ""NA"" +elif f > 12 and r <= 12: + ans = ""YYMM"" +elif f <= 12 and r > 12: + ans = ""MMYY"" +elif r <= 12 and f <= 12: + ans = ""AMBIGUOUS"" +print(ans)" +p03042,s805160800,Wrong Answer,"S = input() +f, r = int(S[:2]), int(S[2:]) +#print(f) +#print(r) +if f == 0 or r == 0 or (f > 12 and r > 12): + ans = ""NA"" +elif f > 12 and r <= 12: + ans = ""YYMM"" +elif f <= 12 and r > 12: + ans = ""MMYY"" +elif r <= 12 and f <= 12: + ans = ""AMBIGUOUS"" +print(ans)" +p03042,s403753553,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) +if a<=12 and b<=12: + print('AMBIGUOUS') +elif a<=99 and 0 12 and 0 < tail <= 12: + print(""YYMM"") +elif 0 < head <= 12 and tail > 12: + print(""MMYY"") +elif head <= 12 and tail <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"") +" +p03042,s127654569,Wrong Answer,"s = input() + +s_u, s_l = int(s[:2]), int(s[2:]) +if s_u > 12 and 1 <= s_l <= 12: + print('YYMM') +elif 1 <= s_u <= 12 and s_l > 12: + print('MMYY') +elif 1 <= s_u <= 12 and 1 <= s_l <= 12: + print('AMBIGUOUS') +elif s_u == 0 or s_l == 0: + print('NA') +" +p03042,s904653234,Wrong Answer,"s = input() + +if s[:2] == ""00"" or s[2:] == ""00"": + print(""NA"") + exit() + +if int(s[:2]) > 13 and int(s[2:]) > 13: + print(""NA"") + exit() + +if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12: + print(""AMBIGUOUS"") + exit() + + +if int(s[2:]) > 13: + print(""MMYY"") +else: + print(""YYMM"") " +p03042,s235343604,Wrong Answer,"def main(): + S = input() + a = S[0:2] + b = S[2:4] + + if (int(a) >= 13 and int(b) >= 13) or (a == ""00"" and b == ""00""): + ans = ""NA"" + elif (int(a) >= 13 and b == ""00"") or (int(b) >= 13 and a == ""00""): + ans = ""NA"" + elif int(a) >= 13: + ans = ""YYMM"" + elif int(b) >= 13: + ans = ""MMYY"" + else: + ans = ""AMBIGUOUS"" + print(ans) + + +if __name__ == ""__main__"": + main()" +p03042,s850105433,Wrong Answer,"s = input() +a = int(s[0:2]) +b = int(s[2:4]) +if 0 < a <= 12 and 0 < b <= 12: + print(""AMBIGUOUS"") +elif a > 12 and b > 12 or a == 0 or b == 0: + print(""NA"") +elif a > 12: + print(""YYMM"") +else: + print(""MMYY"")" +p03042,s979217353,Wrong Answer,"s = input() + +upper = int(s[:2]) +lower = int(s[2:4]) + +if upper <= 0 or lower <= 0: + print('NA') + exit() + +if upper > 12: + if lower > 31: print('NA') + else: print('YYMM') +else: + if lower > 31: print('MMYY') + else: print('AMBIGUOUS') + +" +p03042,s739277994,Wrong Answer,"S = input() +if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12: + print(""AMBIGUOUS"") +elif int(S[:2]) > 12: + print(""YYMM"") +elif int(S[2:]) > 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s704238451,Wrong Answer,"S = int(input()) + +A = S//100 +B = S%100 + +if A >= 13: + if B >= 13: + print('NA') + elif B <13: + if B != 0: + print('YYMM') + else: + print('NA') +elif A < 13: + if B >= 13: + if A != 0: + print('MMYY') + else: + print('NA') + elif B < 13: + print('AMBIGUOUS') +" +p03042,s262945040,Wrong Answer,"S = input() +year_list = [""01"",""02"",""03"",""04"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if S[0:2] in year_list: + if S[2:4] in year_list: + print(""AMBIGUOUS"") + else: + print(""YYMM"") +else: + if S[2:4] in year_list: + print(""MMYY"") + else: + print(""NA"")" +p03042,s651204427,Wrong Answer,"S = list(input()) + +fo = int(''.join(S[:2])) +la = int(''.join(S[2:])) + +if fo==0 or la==0: + print(""NA"") +elif fo <= 12 and la <= 12: + print(""AMBIGUOUS"") +elif fo <= 12 and la > 13: + print(""MMYY"") +elif fo > 13 and la <= 12: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s876409135,Wrong Answer,"S = input() +F = int(S[:2]) +L = int(S[2:]) + +if (F >= 13 and L >= 13) or (F == 0 and L == 0): + print('NA') +elif F >= 13 or F == 0: + print('YYMM') +elif L >= 13 or L == 0: + print('MMYY') +else: + print('AMBIGUOUS')" +p03042,s256444440,Wrong Answer,"s = input() + +former = int(s[:2]) +later = int(s[2:]) + +if former==0 or later==0 or (former>31 and later>31): + print(""NA"") +elif former<13 and later<13: + print(""AMBIGUOUS"") +elif former<13 and later<32: + print(""MMYY"") +elif former<32 and later<13: + print(""YYMM"")" +p03042,s474681719,Wrong Answer,"def solve(): + S = input() + l = int(S[:2]) + r = int(S[2:]) + + if l == 0 or r == 0: + return 'NA' + if l >= 20 or r >= 20: + return 'NA' + + if 12 < l <= 19 and r <= 12: + return 'YYMM' + elif l <= 12 and r <= 19: + return 'MMYY' + elif l <= 12 and r <= 12: + return 'AMBIGUOUS' + else: + return 'NA' + +print(solve())" +p03042,s398771816,Wrong Answer,"s=list(input()) +s=list(map(int,s)) + +a=s[0]*10+s[1] +b=s[2]*10+s[3] + +if (a==0 and b==0) or (a>=13 and b>=13): + print(""NA"") +elif 0 12 and second > 12: + print('NA') + elif first > 12 and second <= 12: + print('YYMM') + elif first <= 12 and second > 12: + print('MMYY') + else: + print('AMBIGUOUS') + + +if __name__ == ""__main__"": + main() +" +p03042,s796167194,Wrong Answer,"a = input() +frm = int(a[:2]) +lat = int(a[2:]) + + +if frm >= 12 and lat >= 12: + print('NA') +elif frm <= 12 and lat > 12: + if 0 12 and lat <= 12: + if lat > 0: + print('YYMM') + else: + print('NA') +elif frm <= 12 and lat==0: + print('MMYY') +elif frm == 0 and lat <= 12: + print('YYMM') +else: + print('AMBIGUOUS')" +p03042,s829346327,Wrong Answer,"S = input() +ju1, ju2 = S[:2],S[2:] + +if (int(ju1) > 0 and int(ju1) <= 12) or (int(ju2) > 0 and int(ju2) <= 12): + if int(ju1) <= 12 and int(ju2) > 12: + print('MMYY') + if int(ju1) > 12 and int(ju2) <= 12: + print('YYMM') + if int(ju1) <= 12 and int(ju1) <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s207842337,Wrong Answer,"S=input() +a=int(S[0]+S[1]) +b=int(S[2]+S[3]) +if (a==0 or a>12) and 012: + print(""MMYY"") +else: + print(""NA"")" +p03042,s117273025,Wrong Answer,"S = input() +if int(S[:2]) == 0 or int(S[3:]) ==0: + print('NA') +elif int(S[:2]) > 12 and int(S[3:]) >12: + print('NA') +elif int(S[:2]) > 12 and int(S[3:]) <=12: + print('YYMM') +elif int(S[:2]) <= 12 and int(S[3:]) >12: + print('MMYY') +elif int(S[:2]) <= 12 and int(S[3:]) <= 12: + print('AMBIGUOUS')" +p03042,s022491695,Wrong Answer,"s = input() +a = s[:2] +b = s[2:4] +a = int(a) +b = int(b) +ok_a = True +ok_b = True +if a == 0 or b == 0: + print('NA') + exit() +if a > 12: ok_a = False +if b > 12: ok_b = False +if ok_a == 1 and ok_b == 1: print('AMBIGUOUS') +elif ok_a == 1 and ok_b == 0: print('MMYY') +elif ok_a == 0 and ok_b == 1: print('YYMM') +else: print('NA')" +p03042,s645356360,Wrong Answer,"s=input() +fs=int(s[:2]) +ls=int(s[2:]) +if 1<=fs<=12 and 13<=ls: + print('MMYY') +elif 1<=fs<=12 and 1<=ls<=12: + print('AMBIGUOUS') +elif fs>=13 and 1<=ls<=12: + print('YYMM') +else: + print('NA') +" +p03042,s595050833,Wrong Answer,"n=input() + +n1,n2=int(n[:2]),int(n[2:]) +if n1>12 and n2>12 or n1==0 or n2==0: + print(""Na"") +elif (n1!=0 and n1<=12) and (n2!=0 and n2<=12): + print(""AMBIGUOUS"") +elif n1!=0 or n1<=12: + print(""MMYY"") +elif n2!=0 or n2<=12: + print(""YYMM"") +else: + print(""errer"") + +" +p03042,s670163519,Wrong Answer,"# #!/usr/bin/env python3 +# # -*- coding: utf-8 -*- + + +def main(): + S = input() + + first = int(S[:2]) + second = int(S[2:]) + + if first == 0 or second == 0: + print('NA') + elif first > 0 and second > 0: + print('NA') + elif first > 12 and second <= 12: + print('YYMM') + elif first <= 12 and second > 12: + print('MMYY') + else: + print('AMBIGUOUS') + + +if __name__ == ""__main__"": + main() +" +p03042,s942774569,Wrong Answer,"a=input() +b=int(a[0]+a[1]) +c=int(a[2]+a[3]) +if b>12 or b==0: + if c>12 or c==0: + print(""Na"") + else: + print(""YYMM"") +elif c>12 or c==0: + if b>12 or b==0: + print(""Na"") + else: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s784948006,Wrong Answer,"S = input() +S1, S2 = S[0:2], S[2:5] +if int(S1) > 12 and (int(S2) >= 1 and int(S2) <= 12): + print('YYMM') +elif (int(S1) >= 1 and int(S1) <=12) and int(S2) > 12: + print('MMYY') +elif (int(S1) >= 1 and int(S1) <=12) and (int(S2) >= 1 and int(S2) <=12): + print('AMBIGUOUS') +else: + print('NA') + +" +p03042,s976632122,Wrong Answer,"S=input() +x=int(S[:2]) +y=int(S[2:]) +if x<=12: + if y<=12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if y<=12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s341973752,Wrong Answer,"s=input() +YY=[] +MM=[""01"",""02"",""03"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +for i in range(13,100): + YY.append(str(i)) + +if s[:2] in YY and s[2:] in MM: + print(""YYMM"") +elif s[:2] in MM and s[2:] in YY: + print(""MMYY"") + +elif s[:2] in MM and s[2:] in MM: + print(""AMBIGUOUS"") +elif s[:2] in YY and s[2:] in YY: + print(""NA"") +" +p03042,s069873075,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if (1 <= a <= 12) and (1 <= b <= 12): + print(""AMBIGUOUS"") +elif (1 <= a <= 12): + print(""YYMM"") +elif (1 <= b <= 12): + print(""MMYY"") +else: + print(""NA"")" +p03042,s734092578,Wrong Answer,"S = input() +year_list = [""01"",""02"",""03"",""04"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if S[0:2] in year_list: + if S[2:4] in year_list: + print(""AMBIGUOUS"") + elif S[2:4] == ""00"": + print(""NA"") + elif int(S[2:4]) >= 32: + print(""NA"") + else: + print(""YYMM"") +elif S[0:2] == ""00"": + print(""NA"") +elif int(S[0:2]) >= 32: + print(""NA"") +else: + if S[2:4] in year_list: + print(""MMYY"") + else: + print(""NA"")" +p03042,s120906679,Wrong Answer,"S = input() +f,e = int(S[:2]),int(S[2:]) +if f==0 or e==0 or (f>12 and e>12): + print('NA') +else: + if 1<=f<=12 and e>12: + print('MMYY') + elif f>12 and 1<=e<=12: + print('YYMM') + else: + print('AMBIGUOUS') +" +p03042,s294686020,Wrong Answer,"S = list(input()) +a = S[0] + S[1] +b = S[2] + S[3] +A = int(a) +B = int(b) + +if (0 < A < 13 and 0 < B < 13): + print(""AMBIGUOUS"") +elif (0 < A < 13 and 12 < B <= 99): + print(""MMYY"") +elif (0 < B < 13 and 12 < A <= 99): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s477230633,Wrong Answer,"import sys + + +def input(): return sys.stdin.readline().strip() +def I(): return int(input()) +def LI(): return list(map(int, input().split())) +def IR(n): return [I() for i in range(n)] +def LIR(n): return [LI() for i in range(n)] +def SR(n): return [S() for i in range(n)] +def S(): return input() +def LS(): return input().split() + + +INF = float('inf') + + +s = S() +f = int(s[:2]) +l = int(s[2:]) + +if 1 <= f <= 12 and 1 <= l <= 12: + print('AMBIGUOUS') + +elif 1 <= l <= 12 and f > 12: + print('YYMM') + +elif 1 <= f <= 12 and l > 12: + print('MMYY') + +else: + print('NA') +" +p03042,s369996044,Wrong Answer," +S = input() +l = S[:2] +r = S[2:] + +lcnt = 0 +rcnt = 0 +if 0 < int(l) <= 12 and 0 < int(r): + lcnt = 1 +if 0 < int(r) <= 12 and 0 < int(l): + rcnt = 1 +if lcnt and rcnt: + print('AMBIGUOUS') + exit() +elif lcnt: + print('MMYY') +elif rcnt: + print('YYMM') +else: + print('NA')" +p03042,s385729494,Wrong Answer,"s = input() +f, b = int(s[:2]), int(s[2:]) +if (f == 0 or b == 0): print(""NA"") +elif (f > 12 and b > 12): print(""NA"") +elif (f > 12): print(""YYMM"") +elif (b > 12): print(""MMYY"") +else: print(""AMBIGUOUS"") +" +p03042,s222371214,Wrong Answer,"s = input() + +#s = list(s) + +mae = int(s[:2]) +usi = int(s[2:]) +#print(mae,usi) + + +if(mae >= 0 and mae <= 99 or usi >= 1 and usi <= 12): + print(""AMBIGUOUS"") +elif(usi >= 0 and usi <= 99 or mae >= 1 and mae <= 12): + print(""AMBIGUOUS"") +elif(mae == 0 and usi == 0): + print(""NA"") +elif(mae == 0 and usi >= 12): + print(""NA"") +elif(mae >= 12 and usi == 0): + print(""NA"") +elif(mae >= 0 and mae <= 99 and usi >= 1 and usi <= 12): + print(""YYMM"") +elif(usi >= 0 and usi <= 99 and mae >= 1 and mae <= 12): + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s090684231,Wrong Answer,"s = input() + +former = int(s[:2]) +later = int(s[2:]) + +if former==0 or later==0 or (former>31 and later>31): + print(""NA"") +elif former<13 and later<13: + print(""AMBIGUOUS"") +elif former<13 and later<32: + print(""MMYY"") +elif former<32 and later<13: + print(""YYMM"") +else: + print(""NA"")" +p03042,s010226794,Wrong Answer,"s = input() + +s_u, s_l = int(s[:2]), int(s[2:]) +if s_u > 12 and 1 <= s_l <= 12: + print('YYMM') +elif 1 <= s_u <= 12 and s_l > 12: + print('MMYY') +elif s_u == 0 or s_l == 0: + print('NA') +else: + print('AMBIGUOUS') +" +p03042,s883582502,Wrong Answer,"A = str(input()) +AC = list(A) +AB = int(A[0] + A[1]) +AC = int(A[2] + A[3]) + +if 1 <= AB <= 12 and 1 <= AC <= 12: + print(""AMBIGUOUS"") +elif AB > 13: + print(""YYMM"") +elif AC > 13: + print(""MMYY"") +else: + print(""NA"")" +p03042,s922147196,Wrong Answer,"from collections import defaultdict, deque +import sys, heapq, bisect, math, itertools, string, queue, copy, time +from fractions import gcd +import numpy as np +sys.setrecursionlimit(10**8) +INF = float('inf') +MOD = 10**9+7 +EPS = 10**-7 + + +s = input() +if s[:2] == '00' or s[2:] == '00': + print('NA') + exit() + +a = (1 <= int(s[:2]) <= 12) +b = (1 <= int(s[2:]) <= 12) + +if a and b: + print('AMBIGUOUS') +elif a and (not b): + print('MMYY') +elif (not a) and b: + print('YYMM') +else: + print('NA') +" +p03042,s531037507,Wrong Answer,"S = input() +up = int(S[0:2]) +down = int(S[2:4]) + +if(up >= 13 and 1 <= down <= 12): + print(""YYMM"") +if(1 <= up <= 12 and down >= 13): + print(""MMYY"") +if(1 <= up <= 12 and 1 <= down <= 12): + print(""AMBIGUOUS"") +if((up >= 13 and down >= 13) or (up == 0 or down == 0)): + print(""NA"")" +p03042,s782586613,Wrong Answer,"s=input() + +def month(n): + if n <= 12: + return True + else: + return False + +if month(int(s[0:2])): + if month(int(s[2:4])) and int(s[2:4]) != 0: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if month(int(s[2:4])) and int(s[2:4]) != 0: + print(""YYMM"") + else: + print(""NA"") +" +p03042,s543430295,Wrong Answer,"S = input() +ls = list(S) +lsa = [ls[0],ls[1]] +lsb = [ls[2],ls[3]] + +a = int(''.join(lsa)) +b = int(''.join(lsb)) + +if (a >= 1 and a <= 12): + if b >= 1 and b <= 12: + print('AMBIGIOUS') + else: + print('MMYY') +elif b >= 1 and b <= 12: + print('YYMM') +else: + print('NA')" +p03042,s119112531,Wrong Answer,"S = input() +if (int(S[:2]) > 12 and int(S[2:]) > 12) or int(S[:2]) == 0 or int(S[2:]) == 0: + print(""NA"") +elif int(S[:2]) > 12: + print(""YYMM"") +elif int(S[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s462236230,Wrong Answer,"a,b,c,d=input() +x=int(a+b) +y=int(c+d) +if 1<=x<=12 and 1<=y<=12: + print('AMBIGUOUS') +elif 1<=x<=12 and 0<=y<=99: + print('MMYY') +elif 0<=x<=99 and 1<=y<12: + print('YYMM') +else: + print('NA')" +p03042,s557809558,Wrong Answer,"# 126 B + +s = input() + +fir = int(s[:2]) +sec = int(s[2:]) + +if fir > 0 and sec > 0: + if 1 <= fir <= 12 and 1 <= sec <= 12 : + print(""AMBIGUOUS"") + elif 1 <= fir <= 12: + print(""MMYY"") + elif 1 <= sec <= 12: + print(""YYMM"") + else: + print(""NA"") +else: + print(""NA"") +" +p03042,s604606399,Wrong Answer,"s = input() +#print(s[2]) +#print(int(s[0] + s[1])) + +if int(s[0] + s[1])>12 and int(s[2] + s[3])<=12 and int(s[2] + s[3])>0: + print(""YYMM"") +elif int(s[0] + s[1])<=12 and int(s[2] + s[3])<=12 and int(s[0] + s[1])>0 and int(s[2] + s[3])>0: + print(""AMBIGUOUS"") +elif int(s[0] + s[1])>0 and int(s[0] + s[1])<=12 and int(s[2] + s[3])>12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s338863472,Wrong Answer,"s = input() + +a = int(s[:2]) +b = int(s[2:]) + +if 0 < a and a <= 12 and 0 < b and b <= 12: + print(""AMBIGUOUS"") +elif a > 12 and 0 < b and b <= 12: + print(""YYMM"") +elif 0 < a and a <= 12 and b > 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s130312645,Wrong Answer,"# input +S = input() +x, y = S[:2], S[2:] + +# check +not_YY_x = (int(x) >= 13) +not_YY_y = (int(y) >= 13) +zero_x = (x == ""00"") +zero_y = (y == ""00"") +checker = [not_YY_x, not_YY_y, zero_x, zero_y] + +if checker == [True, False, False, False]: + print(""YYMM"") +elif checker == [False, True, False, False]: + print(""MMYY"") +elif checker == [False, False, False, False]: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s746366448,Wrong Answer," + +s = input() + + +if int(s[:2]) <= 12 or int(s[2:]) <= 12: + if int(s[:2]) <= 12 and int(s[2:]) <= 12: + print('AMBIGUOUS') + elif 0 < int(s[:2]) <= 12: + print('MMYY') + elif 0 < int(s[2:]) <= 12: + print('YYMM') + else: + print('NA') +else: + print('NA') +" +p03042,s811828990,Wrong Answer,"#!/usr/bin/env python3 + +s = str(input()) + +a = s[0:2] + +b = s[2:] + + +def div(a): + a = int(a) + if a <= 12 and a >= 1: + return ""BOTH"" + else: + return ""YY"" + + +if div(a) == div(b): + if div(a) == ""YY"": + print(""NA"") + else: + print(""AMBIGUOUS"") +elif div(a) == ""YY"": + print(b+a) +else: + print(a+b) +" +p03042,s459536548,Wrong Answer,"a = input() +frm = int(a[:2]) +lat = int(a[2:]) + + +if frm > 12 and lat > 12: + print('NA') +elif frm <= 12 and lat > 12: + if 0 12 and lat <= 12: + if lat > 0: + print('YYMM') + else: + print('NA') +elif frm <= 12 and lat==0: + print('MMYY') +elif frm == 0 and lat <= 12: + print('YYMM') +else: + print('AMBIGUOUS')" +p03042,s977054246,Wrong Answer,"s = input() + +a = int(s[0]+s[1]) +b = int(s[2]+s[3]) + +if a > 12 and 1 <= b <= 12: + print('YYMM') +elif 1 <= a <= 12 and b > 12: + print('MMYY') +elif 1 <= a <= 12 and 1 <= b <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s073881141,Wrong Answer,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +ans="""" +if s1>12: + if s2>12: + ans=""NA"" + else: + ans=""YYMM"" +else: + if s2>12: + ans=""MMYY"" + else: + ans=""AMBIGUOUS"" +print(ans)" +p03042,s171067953,Wrong Answer,"S = input() +if int(S[:2]) == 0 or int(S[2:]) == 0 or \ + (int(S[2:]) >= 13 and int(S[:2]) >= 13): + print('NA') +elif int(S[:2]) >= 13 and int(S[2:]) < 13: + print('YYMM') +elif int(S[2:]) >= 13 and int(S[:2]) < 13: + print('MMYY') +else: + print('AMBIGUOUS') +" +p03042,s737773596,Wrong Answer,"S = input() +f, r = int(S[:2]), int(S[2:]) +#print(f) +#print(r) +if f > 12 and 0 < r <= 12: + ans = ""YYMM"" +elif 0 < f <= 12 and r > 12: + ans = ""MMYY"" +elif 0 < r <= 12 and 0 < f <= 12: + ans = ""AMBIGUOUS"" +else: + ans = ""NA"" +print(ans) +" +p03042,s045425634,Wrong Answer,"s = input() + +s_u, s_l = int(s[:2]), int(s[2:]) +if s_u > 12 and 1 <= s_l <= 12: + print('YYMM') +elif 1 <= s_u <= 12 and s_l > 12: + print('MMYY') +elif 1 <= s_u <= 12 and 1 <= s_l <= 12: + print('AMBIGUOUS') +else: + print('NA') +" +p03042,s020946519,Wrong Answer,"S = list(map(str, input())) + +F = int(S[0]+S[1]) +L = int(S[2]+S[3]) + +if L == 0 or F == 0 or F >= 13 and L >= 13: + print('NA') + +elif F <= 12 and L > 12: + print('MMYY') + +elif L <= 12 and F > 12: + print('YYMM') + + +else: + print('AMBIGUOUS')" +p03042,s022071421,Wrong Answer,"S = input() + +F = int(S[:2]) +B = int(S[2:]) + +if F > 12 and B > 12: + print('NA') +elif F == 0 and B > 12: + print('NA') +elif B == 0 and F > 12: + print('NA') +elif F <= 12 and B <= 12: + print('AMBIGUOUS') +elif B <= 12: + print('YYMM') +else: + print('MMYY') +" +p03042,s679953613,Wrong Answer,"s=str(input()) +a,b=int(s[:2]),int(s[2:]) +print(a,b) +if (a>12 and b>12) or min(a,b)==0 : + print(""NA"") +elif a>12 and b<12: + print(""YYMM"") +elif a<12 and b>12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s284601884,Wrong Answer,"s = input() +a = int(s[0:2]) +b = int(s[2:4]) +if 0 < a <= 12 and 0 < b <= 12: + print(""AMBIGUOUS"") +elif (a > 12 and b > 12) or a == 0 or b == 0: + print(""NA"") +elif a > 12: + print(""YYMM"") +elif b > 12: + print(""MMYY"")" +p03042,s365937598,Wrong Answer,"s = list(input()) +head = int(s[0] + s[1]) +tail = int(s[2] + s[3]) +if (12 < head < 100) and (0 < tail < 13): + print('YYMM') +elif (0 < head < 13) and (12 < tail < 100): + print('MMYY') +elif (0 < head < 13) and (0 < tail < 13): + print('AMBIGUOUS') +else: + print('NA')" +p03042,s536360592,Wrong Answer,"s = input() +YYMM, MMYY, ova = False, False, False + +if(1 <= int(s[:2]) <= 12 and int(s[3:]) != 0): + MMYY = True +if(1 <= int(s[3:]) <= 12 and int(s[:2]) != 0): + YYMM = True + +if(MMYY and YYMM): + ova = True + +if(ova): + print('AMBIGUOUS') +elif(MMYY): + print(""MMYY"") +elif(YYMM): + print('YYMM') +else: + print('NA') +" +p03042,s548846541,Wrong Answer,"S = input() +S1, S2 = S[0:2], S[2:5] +if int(S1) > 12: + print('YYMM') +elif int(S2) > 12: + print('MMYY') +else: + print('AMBIGUOUS') + +" +p03042,s143542348,Wrong Answer,"s = input() + +if int(s[:2]) <= 12 and int(s[2:]) <= 12: + print('AMBIGUOUS') +elif int(s[2:]) > 13 and s[:2] != '00': + print('MMYY') +elif int(s[:2]) > 13 and s[2:] != '00': + print('YYMM') +else: + print('NA')" +p03042,s112756401,Wrong Answer,"s=input() + +def month(n): + if n <= 12: + return True + else: + return False +if s == ""0000"": + print(""NA"") + exit() + +if month(int(s[0:2])): + if month(int(s[2:4])) and int(s[2:4]) != 0: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if month(int(s[2:4])) and int(s[2:4]) != 0: + print(""YYMM"") + else: + print(""NA"") +" +p03042,s848113313,Wrong Answer,"s = int(input()) +s_1 = s // 100 #4桁の数字列の上2桁を取り出す +s_2 = s % 100 #4桁の数字列の下2桁を取り出す + +if 1 <= s_1 <=12 and 1 <= s_2 <= 12: + print(""AMBIGUOUS"") +elif 1 <= s_1 <= 12 and s_2 > 12: + print(""MMYY"") +elif 1 <= s_2 <= 12 and s_1 > 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s379360461,Wrong Answer,"S = input() + +#print(int(S[:2]), int(S[2:])) + +if S[2:] == '00' or S[:2] == '00': + print('NA') +elif int(S[:2]) <= 12 and int(S[2:]) > 12: + print('MMYY') +elif int(S[:2]) > 12 and int(S[2:]) <= 12: + print('YYMM') +else: + print('AMBIGUOUS') +" +p03042,s990378659,Wrong Answer,"import sys +import math + +s=input() + +if (s[2]==""1"" and (s[3]==""1"" or s[3]==""2"" or s[3]==""0"")) or s[2]==""0"": + if (s[0]==""1"" and (s[1]==""1"" or s[1]==""2"" or s[1]==""0"") or s[0]==""0""): + print(""AMBIGUOUS"") + sys.exit() + print(""YYMM"") + sys.exit() + +else: + if (s[0]==""1"" and (s[1]==""1"" or s[1]==""2"" or s[1]==""0"") or s[2]==""0""): + print(""YYMM"") + sys.exit() +print(""NA"") + + +" +p03042,s504659182,Wrong Answer,"s = input() + +s_u, s_l = int(s[:2]), int(s[2:]) +if s_u != 0 and 1 <= s_l <= 12: + print('YYMM') +elif 1 <= s_u <= 12 and s_l != 0: + print('MMYY') +elif 1 <= s_u <= 12 and 1 <= s_l <= 12: + print('AMBIGUOUS') +else: + print('NA') +" +p03042,s999600300,Wrong Answer,"S = list(input()) +before = int(S[0] + S[1]) +after = int(S[2] + S[3]) + +if before == 0 or before > 12: + if after >= 1 and after <= 12: + print('YYMM') + else: + print('NA') +else: + if after >= 1 and after <= 12: + print('AMBIGUOS') + else: + print('MMYY')" +p03042,s890346037,Wrong Answer,"S = input() +ff = int(S[:2]) +ll = int(S[2:]) +if 012 and 012: + print(""MMYY"") +else: + print(""NA"")" +p03042,s910732113,Wrong Answer,"S = input() +ff = int(S[:2]) +ll = int(S[3:]) +if 012 and 012: + print(""MMYY"") +else: + print(""NA"")" +p03042,s047637167,Wrong Answer,"s=list(input()) +s=list(map(int,s)) + +a=s[0]*10+s[1] +b=s[2]*10+s[3] + +if (a==0 and b==0) or (a>=13 and b>=13) or (a==0 or b>=13) or (a>=13 or b==0): + print(""NA"") +elif 0 12: + print('NA') +elif S[2:] == '00' and int(S[:2]) > 12: + print('NA') +elif S == '0000': + print('NA') +elif int(S[:2]) <= 12 and int(S[2:]) <= 12: + print('AMBIGUOUS') +elif int(S[:2]) <= 12: + print('MMYY') +elif int(S[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s198750012,Wrong Answer,"s = input() + +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) + +if 13 <= a and 1 <= b <= 12: + print('YYMM') +elif 1 <= a <= 12 and 13 <= b: + print('MMYY') +elif 1 <= a <= 12 and 1 <= b <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s824725698,Wrong Answer,"s = input() +mmyy = (1 <= int(s[0:2]) <= 12) +yymm = (1 <= int(s[2:-1]) <= 12) +if mmyy: + if yymm: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if yymm: + print('YYMM') + else: + print('NA')" +p03042,s258942066,Wrong Answer,"def main(): + S = input() + if int(S[:2]) > 12 and 12 >= int(S[3:]) > 0: + print(""YYMM"") + elif int(S[3:]) > 12 and 12 >= int(S[:2]) > 0: + print(""MMYY"") + elif 0 < int(S[:2]) <= 12 and 0 < int(S[3:]) <= 12: + print(""AMBIGUOUS"") + else: + print(""NA"") + + +if __name__ == '__main__': + main()" +p03042,s099595945,Wrong Answer,"S = input() +Fa = int(S[:2]) +Se = int(S[2:]) +if 1 <= Fa <= 12 and 1 <= Se <= 12: + print(""AMBIGIOUS"") +elif 1 <= Fa <= 12: + print(""MMYY"") +elif 1 <= Se <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s390647269,Wrong Answer,"s = input() +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +if s1 == s2 == 0: + print('NA') +elif s1 <= 12: + if s2 <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +elif s2 <= 12: + if s1 <= 12: + print('AMBIGUOUS') + else: + print('YYMM') +else: + print('NA')" +p03042,s082815925,Wrong Answer,"s = input() +mae = int(s[:2]) +ato = int(s[3:]) + +if mae<=12 and ato<=12 and mae>0 and ato>0: + print('AMBIGUOUS') +elif 120: + print('MMYY') +elif 120: + print('YYMM') +else: + print('NA')" +p03042,s914311571,Wrong Answer,"a=input() +a_i=int(a[0:2]) +b_i=int(a[2:4]) +if a_i<=12 and b_i<=12: + print('AMBIGUOUS') +elif 0=13 or f==00)and b>=13 : + print('NA') +elif (f>=13 or f==00)and 1<=b<=12 : + print('YYMM') +elif 1<=f<=12 and (b>=13 or b==00) : + print('MMYY') +elif f<=13 and (b>=13 or b==00) : + print('AMBIGUOUS') +" +p03042,s070657094,Wrong Answer,"s = list(map(int,list(input()))) +a = s[0]*10+s[1] +b = s[2]*10+s[3] +if 0 < a <= 12 and 0 < b <= 12: + print('AMBIGUOUS') +elif 0 < a<= 12 and b>12: + print('MMYY') +elif a > 12 and 0 < b <= 12: + print('YYMM') +else:print('NA')" +p03042,s324089148,Wrong Answer,"S = input() +a = int(S[:2]) +b = int(S[2:]) + +ym = False +my = False +if a > 0 and b>0 and b <= 12: + ym = True +if b > 0 and a>0 and a <= 12: + my = True + +if ym and my: + print(""AMBIGOUS"") +elif ym and not(my): + print('YYMM') +elif not(ym) and ym: + print('MMYY') +else: + print('NA')" +p03042,s765879374,Wrong Answer,"s = input() +YYMM = False +MMYY = False + +if 0 < int(s[:2]) < 100: + if 0 < int(s[2:]) < 13: + YYMM = True +if 0 < int(s[:2]) < 13: + if 0 < int(s[2:]) < 100: + MMYY = True +if YYMM == True and MMYY == True: + print('AMBIGUOUS') +elif YYMM == True: + print('YYMM') +elif MMYY == True: + print('MMYY') +else: + print('NA')" +p03042,s894112703,Wrong Answer,"s = input() + +first = s[:2] +second = s[2:] + +if int(first) > 12: + first_m = False +else: + first_m = True + +if int(second) > 12: + second_m = False +else: + second_m = True + +if first == ""00"" and not second_m: + print(""NA"") +elif second == ""00"" and not first_m: + print(""NA"") +elif first_m and second_m: + print(""AMBIGUOUS"") +elif first_m: + print(""MMYY"") +elif second_m: + print(""YYMM"") +else: + print(""NA"")" +p03042,s432976026,Wrong Answer,"S = list(input()) + +fo = int(''.join(S[:2])) +la = int(''.join(S[2:])) + +if fo==0 or la==0: + print(""NA"") +elif fo <= 12 and la <= 12: + print(""AMBIGUOUS"") +elif fo <= 12 and la > 12: + print(""MMYY"") +elif fo > 12 and la <= 12: + print(""YYMM"") +elif fo > 12 and la > 12: + print(""NA"") + +" +p03042,s489826688,Wrong Answer,"n = list(map(str,input().split())) +if int(n[0][0:2]) in range(13,100) and int(n[0][3]) in range(1,13): + print('YYMM') +elif int(n[0][1]) in range(1,13) and int(n[0][2:]) in range(13,100): + print('MMYY') +elif int(n[0][0:2]) in range(1,13) and int(n[0][2:]) in range(1,13): + print('AMBIGUOUS') +else: + print('NA')" +p03042,s134813008,Wrong Answer,"S = input() + +A, B = int(S[:2]), int(S[2:]) + +x = 1 <= A <= 99 and 1 <= B <= 12 +y = 1 <= A <= 12 and 1 <= B <= 99 + +if x and y: + print('AMBIGUOUS') +elif x: + print('YYMM') +elif y: + print('MMYY') +else: + print('NA') +" +p03042,s253478103,Wrong Answer,"n=input() + +m=n[0]+n[1] + +o=n[2]+n[3] + +x=int(m) +y=int(o) + +if x>0 and x<13 and y>0 and y<13: + print(""AMBIGUOUS"") + +elif (x<13 and x>0) and (y>12): + print(""MMYY"") +elif (x>12) and (y<13 and y>0): + print(""YYMM"") + +elif x==0 or y==0: + print(""NA"") +" +p03042,s904583211,Wrong Answer,"S = input() +ff = int(S[:2]) +ll = int(S[2:]) +if 012 and 012 or ll== 0: + print(""MMYY"") +else: + print(""NA"")" +p03042,s067359279,Wrong Answer,"s = [int(k) for k in list(input())] +s1 = 10*int(s[0])+int(s[1]) +s2 = 10*int(s[2])+int(s[3]) +if s2 == 0 and s1 > 12: + print(""NA"") +elif s1 > 12 and s2 <= 12: + print(""YYMM"") +elif s1 <= 12 and s2 > 12: + print(""MMYY"") +else: + if s1 > 12 and s2 > 12: + print(""NA"") + else: + print(""AMBIGUOUS"")" +p03042,s892679801,Wrong Answer,"def resolve(): + S = input() + P = int(S[0]+S[1]) + Q = int(S[2]+S[3]) + if 0012: + print(""MMYY"") + elif P>13 and 00 12: + # YYMM + if 0 == tale or tale > 12: + print(""NA"") + else: + print(""YYMM"") + +elif 0 == tale or tale > 12: + print(""AMBIGUOUS"") +else: + print(""AMBIGUOUS"") + +" +p03042,s132478896,Wrong Answer,"x = input() +a, b = int(x[0:2]), int(x[2:4]) +flag = 0 +ans = [""AMBIGUOUS"", ""YYMM"", ""MMYY"", ""NA""] + +if (a >= 1 and a <= 12) and (b >= 1 and b <= 12): + flag = 0 +elif (a == 0 and b > 12) or (b == 0 and a > 12) or (b > 12 and a > 12) or (b == 0 and a == 0): + flag = 3 +elif ((a > 0 and a <= 12) and (b >= 13)) or (a == 0 and (b >= 1 and b <= 12)): + flag = 2 +elif ((a >= 13) and (b > 0 and b <= 12)) or (b == 0 and (a >= 1 and a <= 12)): + flag = 1 + + +print(ans[flag]) +" +p03042,s067436819,Wrong Answer,"S = input() +year_list = [""01"",""02"",""03"",""04"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if S[0:2] in year_list: + if S[2:4] in year_list: + print(""AMBIGUOUS"") + elif S[2:4] == ""00"": + print(""NA"") + else: + print(""YYMM"") +elif S[0:2] == ""00"": + print(""NA"") +else: + if S[2:4] in year_list: + print(""MMYY"") + else: + print(""NA"")" +p03042,s608409134,Wrong Answer,"S=input() +a=int(S[:2]); b=int(S[2:]) +if (0 0: + is_month_first = True +if last <= 12 and last > 0: + is_month_last = True + +if is_month_first and is_month_last: + print(""AMBIGUOUS"") +elif not is_month_first and not is_month_last: + print(""NA"") +else: + if is_month_first: + print(""MMYY"") + else: + print(""YYMM"")" +p03042,s260663665,Wrong Answer,"s = input() +a = int(s[0:2]) +b = int(s[2:]) + +if 13 <= a: + if 1 <= b and b <= 12: + print('YYMM') + else: + print('NA') +elif 1<= a: + + if 1<= b and b<= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 1<= b and b <= 12: + print('MMYY') + else: + print('NA')" +p03042,s646163302,Wrong Answer,"# #!/usr/bin/env python3 +# # -*- coding: utf-8 -*- + + +def main(): + S = input() + + first = int(S[:2]) + second = int(S[2:]) + + if first == 0 or second == 0: + print('NA') + elif first > 12 and second <= 12: + print('YYMM') + elif first <= 12 and second > 12: + print('MMYY') + else: + print('AMBIGUOUS') + + +if __name__ == ""__main__"": + main() +" +p03042,s655767250,Wrong Answer,"s=input() + +first_two=int(''.join(s[:2])) +last_two=int(''.join(s[2:])) + +if 13<=first_two and 1<=last_two<=12: + print('YYMM') +elif 13<=last_two and 1<=first_two<=12: + print('MMYY') +elif 1<=first_two<=12 and 1<=last_two<=12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s799359649,Wrong Answer,"s = input() + +#s = list(s) + +mae = int(s[:2]) +usi = int(s[2:]) +#print(mae,usi) + + +if(mae >= 1 and mae <= 12 and usi >= 1 and usi <= 12): + print(""AMBIGUOUS"") +elif(mae == 0 and usi == 0): + print(""NA"") +elif(mae == 0 and usi >= 12): + print(""NA"") +elif(mae >= 12 and usi == 0): + print(""NA"") +elif(mae >= 0 and mae <= 99 and usi >= 1 and usi <= 12): + print(""YYMM"") +elif(usi >= 0 and usi <= 99 and mae >= 1 and mae <= 12): + print(""MMYY"")" +p03042,s177889121,Wrong Answer,"s = int(input()) +a = s % 100 +b = ((s-a) % 100) +if a <= 31 and b <= 12: + print(""YYMM"") +elif a <= 12 and b <= 31: + print(""MMYY"") +elif a <= 12 and b <= 31 and a <= 31 and b <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s298429626,Wrong Answer,"a = input() +b = a[0:2] +c = a[2:4] +if b.count(""0"") >= 1: + print(b.strip(""0"")) +else: + print(b) +if c.count(""0"") >= 1: + print(c.strip(""0"")) +else: + print(c) +b = int(b) +c = int(c) +if b > 12: + if c > 12: + print(""NA"") + else: + print(""MMYY"") +elif c > 12: + if b < 13: + print(""YYMM"") +else: + print(""AMBIGUOUS"")" +p03042,s690654697,Wrong Answer,"S = input() +l,r = int(S[:2]),int(S[2:]) +if 1 <= l <= 12 and 1 <= r <= 12: + print(""AMBICIOUS"") +elif 1<=r<=12: + print(""YYMM"") +elif 1<=l<=12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s629986705,Wrong Answer,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +if (0 12 and int(later) < 13: + print('YYMM') +elif int(former) < 13 and int(later) > 12: + print('MMYY') +else: + print('NA')" +p03042,s001663051,Wrong Answer,"S=input() + +if int(S[:2])>12 and 012: + print(""MMYY"") +elif 0= 13 or A == 0: + f1 = 0 +if B >= 13 or B == 0: + f2 = 0 +if f1 == 1 and f2 == 1: + print('AMBIGUOUS') +elif f1 == 1 and f2 == 0: + print('MMYY') +elif f1 == 0 and f2 == 1: + print('YYMM') +else: + print('NA')" +p03042,s697000370,Wrong Answer,"s = input() + +if s[:2] == ""00"" and s[2:] == ""00"": + print(""NA"") + exit() + +if int(s[:2]) >= 13 and int(s[2:]) >= 13: + print(""NA"") + exit() + +if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12: + print(""AMBIGUOUS"") + exit() + + +if 1 <= int(s[2:]) >= 12: + print(""MMYY"") +else: + print(""YYMM"") " +p03042,s446729552,Wrong Answer,"s = input() +f, b = int(s[:2]), int(s[2:]) +if (f == 0 or b == 0 or (f > 12 and b > 12)): print(""NA"") +elif ((0 < f and f <= 12) and (b > 12)): print(""MMYY"") +elif ((0 < b and b <= 12) and (f > 12)): print(""YYMM"") +else: print(""AMBIGUOUS"")" +p03042,s378485292,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:4]) + +if (f>=13 or f==00)and b>=13 : + print('NA') +if (f>=13 or f==00)and 1<=b<=12 : + print('YYMM') +elif 1<=f<=12 and (b>=13 or b==00) : + print('MMYY') +if f<=13 and (b>=13 or b==00) : + print('AMBIGUOUS') +" +p03042,s554041095,Wrong Answer,"S = input() +Y = int(S[:2]) +M = int(S[2:]) +print(''.join(['NA' if Y == 0 or M == 0 else 'AMBIGUOUS' if Y <= 12 and M <= 12 else 'YYMM' if Y > 12 else 'MMYY']))" +p03042,s871572073,Wrong Answer,"# input +S = input() +x, y = S[:2], S[2:] + +# check +not_YY_x = (int(x) >= 13) +not_YY_y = (int(y) >= 13) +zero_x = (x == ""00"") +zero_y = (y == ""00"") +checker = [not_YY_x, not_YY_y, zero_x, zero_y] + +if checker == [True, False, False, False] or checker == [True, False, False, True]: + print(""YYMM"") +elif checker == [False, True, False, False] or checker == [False, True, True, False]: + print(""MMYY"") +elif checker == [False, False, False, False]: + print(""AMBIGUOUS"") +else: + print(""NA"") +" +p03042,s877041219,Wrong Answer,"S = str(input()) + +S1 = S[0:2] +S2 = S[2:4] + +if 1 <= int(S1) <= 12: + if 1 <= int(S2) <= 12: + print('AMBIGOUS') + exit() + else: + print('MMYY') + exit() +elif 1 <= int(S2) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s076448778,Wrong Answer,"import sys + +S =int(input()) +a = S//100 +b = S%100 +if 1 <= a <= 12 and 1 <= b <= 12 : + print(""AMBIGUOUS"") + sys.exit() + +elif 1 <= a <= 12 : + print(""YYMM"") + sys.exit() + +elif 1 <= b <= 12 : + print(""MMYY"") + sys.exit() +else : print(""NA"") +" +p03042,s847010344,Wrong Answer,"s = str(input()) +a = int(s[0])*10 + int(s[1]) +b = int(s[2])*10 + int(s[3]) +if a >= 13 and 1 <= b <= 12: + print(""YYMM"") +elif 1 <= a <= 12 and b >= 13: + print(""MMYY"") +elif 1 <= a <= 12 and 1 <= b <= 12: + print(""ABIGUOUS"") +else: + print(""NA"")" +p03042,s039097101,Wrong Answer,"s=list(input()) +a=int("""".join(s[:2])) +b=int("""".join(s[2:])) +print(""NA"" if a == 0 or b == 0 else + ""NA"" if a >= 13 and b >= 13 else + ""YYMM"" if a > 12 else + ""MMYY"" if b > 12 else + ""AMBIGUOUS"")" +p03042,s143765845,Wrong Answer," +s = input() +a=int(s[0:2]) +b=int(s[2:4]) +if 0 0 or latter > 0): + print('AMBIGUOUS') + elif front < 13 and latter < 100 and front > 0: + print('MMYY') + elif front < 100 and latter < 13 and latter > 0: + print('YYMM') + else: + print('NA') +main() + +" +p03042,s327357355,Wrong Answer,"# input +S = input() +x, y = S[:2], S[2:] + +# check +not_YY_x = (int(x) >= 13) +not_YY_y = (int(y) >= 13) +zero_x = (x == ""00"") +zero_y = (y == ""00"") +checker = [not_YY_x, not_YY_y, zero_x, zero_y] + +if checker == [True, False, False, False]: + print(""MMYY"") +elif checker == [False, True, False, False]: + print(""YYMM"") +elif checker == [False, False, False, False]: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s977187039,Wrong Answer,"import sys +input = lambda: sys.stdin.readline().rstrip() +input_nums = lambda: list(map(int, input().split())) + +def main(): + S = input() + if S[:2] == '00' or S[2:] == '00': print('NA') + elif int(S[:2]) <= 12 and int(S[2:]) > 12: print('MMYY') + elif int(S[:2]) > 12 and int(S[2:]) <= 12: print('YYMM') + elif int(S[:2]) <= 12 and int(S[2:]) <= 12: print('AMBIGUOUS') + else: print('NA') + +if __name__ == '__main__': + main() +" +p03042,s560290586,Wrong Answer,"S = list(input()) + +S1 = int(S[0]+S[1]) +S2 = int(S[2]+S[3]) +#print(S1,S2) +if((S1 == 0 or S2 == 0) or (S1 > 12 and S2 > 12)): + print('NA') +elif(S1 < 13 and S2 < 13): + print('AMBIGUOUS') +elif(S1 < 13): + print('MMYY') +else: + print('YYMM') +" +p03042,s093599594,Wrong Answer,"s = input() +t = int(s[:2]) +tt = int(s[2:]) +if t <= 12 and tt <= 12: + print(""AMBIGUOUS"") +elif t > 12 and tt <= 12 and tt >= 1: + print(""YYMM"") +elif t <= 12 and tt > 12 and t >= 1: + print(""MMYY"") +else: + print(""NA"")" +p03042,s718239957,Wrong Answer," +s = input() +sa = int(s[:2]) +sb = int(s[3:]) + +if sa >= 1 and sa <= 12 and sb >= 1 and sb <= 12: + print('AMBIGUOUS') + exit() +if sa >= 1 and sa <= 12 and sb > 12: + print('MMYY') + exit() +if sa > 12 and sb >= 1 and sb <= 12: + print('YYMM') + exit() + +print('NA')" +p03042,s834375946,Wrong Answer,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +ans="""" +if s1>12 or s1<=0: + if s2>12 or s2<=0: + ans=""NA"" + else: + ans=""YYMM"" +else: + if s2>12: + ans=""MMYY"" + else: + ans=""AMBIGUOUS"" + +print(ans) +" +p03042,s214932835,Wrong Answer,"S = input() +high = int(S[0:2]) +low = int(S[2:4]) + +if 1<= high <= 12: + if 1<= low <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +if high < 1 or high > 12: + if 1<= low <= 12: + print(""YYMM"") + else: + print(""AMBIGUOUS"")" +p03042,s779947128,Wrong Answer,"s = input() +if 1 <=int(s[0:2]) <= 12 and 1<= int(s[2:4]) <= 12: + print(""AMBIGUOUS"") +elif (int(s[0:2]) == 0 or 13 <=int(s[0:2]) <= 99) and 1<= int(s[2:4]) <= 12: + print(""YYMM"") +elif (int(s[2:4]) == 0 or 13 <=int(s[0:2]) <= 99) and 1<= int(s[0:2]) <= 12: + print(""MMYY"") +else : + print(""NA"")" +p03042,s928333156,Wrong Answer,"S=input() +a=int(S[:2]); b=int(S[2:]) +if 012 and 00 and int(s[2] + s[3])>0: + print(""AMBIGUOUS"") +elif int(s[0] + s[1])>0 and int(s[0] + s[1])<=12 and int(s[2] + s[3])>12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s024504850,Wrong Answer,"s = input() +if s == '0000' or (int(s[:2]) >= 13 and int(s[-2:]) >= 13): + print('NA') +elif 1 <= int(s[:2]) <= 12 and 1 <= int(s[-2:]) <= 12: + print('AMBIGUOUS') +elif 1 <= int(s[:2]) <= 12: + print('MMYY') +elif 1 <= int(s[-2:]) <= 12: + print('YYMM')" +p03042,s716373870,Wrong Answer,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS"") +elif 1<=a<=12 and 12 12: print('MMYY') + elif int(S[:2]) > 12 and int(S[2:]) <= 12: print('YYMM') + else: print('AMBIGUOUS') + +if __name__ == '__main__': + main() +" +p03042,s493212744,Wrong Answer,"S = input() +a = int(S[0]) +b = int(S[1]) +c = int(S[2]) +d = int(S[3]) + +if a*10 + b == 0: + if c*10 + d == 0: + print(""NA"") + elif c*10 + d <= 12: + print(""YYMM"") + else: + print(""NA"") +elif a*10 + b <= 12: + if c*10 + d <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if c*10 + d == 0: + print(""NA"") + elif c*10 + d <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s156298708,Wrong Answer,"S = list(map(int, input())) + +if 0=13: + print('MMYY') +elif 0=13: + print('YYMM') +else: + print('NA')" +p03042,s496660924,Wrong Answer,"s = input() + +a = int(s[:2]) +b = int(s[2:]) + +if a == 0 or b == 0: + print(""NA"") +elif a > 12 and b <= 12: + print(""YYMM"") +elif a <= 12 and b > 12: + print(""MMYY"") +elif a <= 12 and b <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"") " +p03042,s544416507,Wrong Answer,"s=input() +a=int(s[0:2]) +b=int(s[2:]) +if 1<=a<=99 and 1<=b<=31: + if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') + else: + print('YYMM') +elif 1<=b<=99 and 1<=a<=12: + print('MMYY') +else: + print('NA')" +p03042,s865348671,Wrong Answer,"s=input() + +if int(s[:2])<=12: + if int(s[2:])<=12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 0 12 and int(later) < 13: + print('YYMM') +elif int(former) < 13 and int(later) > 12: + print('MMYY') +elif int(former) < 13 and int(later) < 13: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s735941907,Wrong Answer,"s = [int(k) for k in list(input())] +s1 = 10*int(s[0])+int(s[1]) +s2 = 10*int(s[2])+int(s[3]) +if s2 == 0: + print(""NA"") +elif s1 <= 12 and s2 <= 12: + print(""AMBIGUOUS"") +elif s1 <= 12 and s2 >= 12: + print(""MMYY"") +else: + print(""YYMM"")" +p03042,s106672174,Wrong Answer,"S = input() +pre, lat = int(S[0:2]), int(S[2:4]) +pre_M = 1 <= pre <= 12 +lat_M = 1 <= pre <= 12 +if pre_M and lat_M: + print(""AMBIGUOUS"") +elif pre_M: + print(""MMYY"") +elif lat_M: + print(""YYMM"") +else: + print(""NA"")" +p03042,s369317493,Wrong Answer,"S = input() +F = int(S[0:2]) +SE = int(S[2:4]) + +if F > 12 and SE > 12: + print(""NA"") +elif F > 12 and 1 <= SE <= 12: + print(""YYMM"") +elif 1 <= F <= 12 and SE > 12: + print(""MMYY"") +elif 1 <= F <= 12 and 1 <= SE <= 12: + print(""AMBIGUOUS"") +elif F == 0 and SE == 0: + print(""NA"") +else: + print(""NA"") + + + + + + +" +p03042,s158464433,Wrong Answer,"s = input() + +s1 = int(s[0:2]) +s2 = int(s[2:4]) + +if s1 == 0 or s2 ==0: + print(""NA"") + +elif s1>12 and s2>12: + print(""NA"") + +elif s1>12 and s2<=12: + print(""YYMM"") + +elif s1<=12 and s2>12: + print(""MMYY"") + +else: + print(""AMBIGUOUS"")" +p03042,s502042073,Wrong Answer,"S = input() + +if S[:2] == '00' and int(S[2:]) > 12: + print('NA') +elif S[2:] == '00' and int(S[:2]) > 12: + print('NA') +elif int(S[:2]) <= 12 and int(S[2:]) <= 12: + print('AMBIGUOUS') +elif int(S[:2]) <= 12: + print('MMYY') +elif int(S[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s959444158,Wrong Answer,"S = list(map(str, input())) + +F = int(S[0]+S[1]) +L = int(S[2]+S[3]) + +if L == 0 or F == 0 or F >= 13 and L >= 13: + print('NA') + +elif F <= 12 and L > 12: + print('MMYY') + +elif L <= 12 and F > 12: + print('YYMM') + + +else: + print('AMBIGOUS')" +p03042,s437432961,Wrong Answer,"n=input() +f=n[:2] +l=n[2:] +if (f==""00"" and l==""00"") or (int(f)>12 and int(l)>12): + print(""NA"") +elif int(f)>12 or f==""00"": + print(""YYMM"") +elif int(l)>12 or l==""00"": + print(""MMYY"") +else: + print(""AMBIGUOUS"") +" +p03042,s169667478,Wrong Answer,"def main(): + s = input() + print(s[:2], s[2:4]) + if int(s[:2]) > 12 and (int(s[2:4]) >= 1 and int(s[2:4]) <= 12) : + print(""YYMM"") + elif int(s[2:4])>12 and (int(s[:2]) >=1 and int(s[:2]) <=12) : + print(""MMYY"") + elif (int(s[:2]) >= 1 and int(s[:2])) <= 12 and (int(s[2:4]) >=1 and int(s[2:4]) <= 12) : + print(""AMBIGUOUS"") + else: + print(""NA"") + +if __name__ == ""__main__"": + main() +" +p03042,s330660158,Wrong Answer,"def main(): + s = input() + a=s[:2] + b=s[2:] + if (a==""00"" or 120: + print(""AMBIGUOUS"") + + + +else: + print(""NA"") +" +p03042,s878519197,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if a >12 and b>12 or a > 31 or b > 31 or a==0 or b == 0: + print('NA') +elif 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif a in (4,6,9,11) and 1<=b<=30 or a in (1,3,5,7,8,10,12) and 1<=b<31 or a==2 and 1<=b<=29: + print('MMYY') +elif b in (4,6,9,11) and 1<=a<=30 or b in (1,3,5,7,8,10,12) and 1<=a<31 or b==2 and 1<=a<=29: + print('YYMM') +else: + print('NA')" +p03042,s724777270,Wrong Answer,"S = input() + +ans = ""NA"" +if int(S[:2]) <= 12 and int(S[2:]) <= 12: + ans = ""AMBIGUOUS"" +elif 1 <= int(S[:2]) <= 12 and int(S[2:]) > 12: + ans = ""MMYY"" +elif int(S[:2]) > 12 and 1 <= int(S[2:]) <= 12: + ans = ""YYMM"" + +print(ans) " +p03042,s824529018,Wrong Answer,"S = input() +ju1, ju2 = S[:2],S[2:] + +if (int(ju1) > 0 and int(ju1) <= 12) or (int(ju2) > 0 and int(ju2) <= 12): + if (int(ju1) > 0 and int(ju1) <= 12) and (int(ju2) > 0 and int(ju2) <= 12): + print('AMBIGUOUS') + elif (int(ju1) > 0 and int(ju1) <= 12) and int(ju2) > 0: + print('MMYY') + elif int(ju1) > 0 and (int(ju2) > 0 and int(ju2) <= 12): + print('YYMM') +else: + print('NA')" +p03042,s221300752,Wrong Answer,"S = input() +if (int(S[:2])>12 or int(S[:2])==0) and (int(S[2:])>12 or int(S[2:])==0): + print('NA') +elif (int(S[:2])<=12 and int(S[:2])!=0) and (int(S[2:])>12 and int(S[2:])==0): + print('MMYY') +elif (int(S[2:])<=12 and int(S[2:])!=0) and (int(S[:2])>12 and int(S[:2])==0): + print('YYMM') +else: + print('AMBIGUOUS')" +p03042,s757957635,Wrong Answer,"S = str(input()) +year = S[0] + S[1] +month = S[2] + S[3] +if int(year) > 12 and int(month) != 0: + print('YYMM') +elif int(month) > 12 and int(month) != 0: + print('MMYY') +elif int(year) <= 12 and int(month) <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s858427740,Wrong Answer,"s = input() +n1 = int(s[0:2]) +n2 = int(s[2:4]) + +flag1 = False +flag2 = False +if n1 >= 1 and n2 >= 1 and n2 <= 12: + flag1 = True +if n1 >= 1 and n1 <= 12 and n2 >= 1: + flag2 = True + +if flag1 and flag2: + print('AMBIGUOUS') +elif flag1: + print('YYMM') +elif flag2: + print('MMYY') +else: + print('NA')" +p03042,s300032455,Wrong Answer,"NN = input() +AA = int(NN[0:2]) +BB = int(NN[2:-1]) +count1 = 0 +count2 = 0 +if AA >12 or AA == 00: + count1 +=1 +if BB >12 or BB == 00: + count2 +=2 +if count1 == 0 and count2 == 0: + print('AMBIGUOUS') +elif count1 ==1 and count2 == 0: + print('YYMM') +elif count1 ==0 and count2 == 1: + print('MMYY') +else: + print('NA') + " +p03042,s821477823,Wrong Answer,"yymm = input() +if int(yymm[2:4]) == 0: + print('NA') +elif int(yymm[0:2]) <= 12 and int(yymm[2:4]) <= 12: + print('AMBIGUOUS') +elif int(yymm[0:2]) <= 12 and int(yymm[2:4]) <= 99: + print('MMYY') +elif int(yymm[0:2]) <= 99 and int(yymm[2:4]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s290632226,Wrong Answer,"S = str(input()) +year = S[0] + S[1] +month = S[2] + S[3] +if (int(year) > 12 and int(month) >12) or (int(year) == 0) or (int(month) == 0): + print('NA') +elif int(year) > 12: + print('YYMM') +elif int(month) >12: + print('MMYY') +elif int(year) <= 12 and int(month) <= 12: + print('AMBIGUOUS')" +p03042,s126474991,Wrong Answer,"s = (input()) +a= s[0:2] +b= s[2:4] +a = int(a) +b= int(b) +if a == 0 or b == 0: + if b!= 0 and b<13: + print('YYMM') + elif a!= 0 and a<13: + print('MMYY') + else: + print('NA') +elif a<13 or b<13: + if a>12: + print('YYMM') + elif b>12: + print('MMYY') + else: + print('AMBIGUOUS')" +p03042,s181444749,Wrong Answer,"S = list(input()) +f1 = 1 +f2 = 1 +A = int(''.join(S[:2])) +B = int(''.join(S[2:])) +if A >= 13 or A == 0: + f1 = 0 +if B >= 13 or A == 0: + f2 = 0 +if f1 == 1 and f2 == 1: + print('AMBIGUOUS') +elif f1 == 1 and f2 == 0: + print('MMYY') +elif f1 == 0 and f2 == 1: + print('YYMM') +else: + print('NA')" +p03042,s628381513,Wrong Answer,"def resolve(): + S = input() + P = int(S[0]+S[1]) + Q = int(S[2]+S[3]) + if 012 or Q==0): + print(""MMYY"") + elif (P>13 or P==0) and 00: + print('NA') +if b==0: + if a<13: + print('MMYY') + elif a>0: + print('NA') + +if a>12: + if b>12: + print('NA') + elif b>0: + print('YYMM') +elif a>0: + if b>12: + print('MMYY') + elif b>0: + print('AMBIGUOUS') +" +p03042,s956327247,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) +if 012) and (b==0 or b>12): + print(""Na"") +elif (a==0 or a>12): + print(""YYMM"") +elif (b==0 or b>12): + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s851912283,Wrong Answer,"s = input() +s_f = int(s[0]+s[1]) +s_b = int(s[2]+s[3]) + +#print(s_f) +#print(s_b) +if s_f==0 or s_b==0: + print('NA') +elif s_f>12 and s_b<=12: + print('YYMM') +elif s_f>12 and s_b>12: + print(""NA"") +elif s_f<=12 and s_b<=12: + print(""AMBIGUOUS"") +else: + print('MMYY')" +p03042,s163511586,Wrong Answer,"s = input() +s_f = int(s[0]+s[1]) +s_b = int(s[2]+s[3]) + +#print(s_f) +#print(s_b) +if s_f==0 or s_b==0: + print('NA') +elif s_f<=12 and s_b<=12: + print(""AMBIGUOUS"") +elif s_f<=12 and s_b>12: + print('MMYY') +elif s_f>12 and s_b<=12: + print('YYMM') +elif s_f>12 and s_b>12: + print('NA') + + " +p03042,s113247168,Wrong Answer,"S = int(input()) + +a = int(S/100 - (S%100)/100) +b = int(S%100) + +if( 0 12 else ""YYMM"" if a > 12 else ""MMYY"" if b > 12 else ""AMBIGUOUS"")" +p03042,s921866120,Wrong Answer,"s=input() +if 1<=int(s[:2])<=12 and 13<=int(s[2:4])<=31:print(""MMYY"") +elif 12 12 and b > 12) or (a == 0 and b > 12) or (a > 12 and b == 0) : + print('NA') +elif a > 12: + print('YYMM') +else: + print('MMYY')" +p03042,s104095301,Wrong Answer,"S = input() + +s1 = int(S[0] + S[1]) +s2 = int(S[2] + S[3]) + +if s1 > 12: #YY + if 0 < s2 <= 12: + print('YYMM') + else: + print('NA') +elif s2 > 12: #YY + if 0 < s1 <= 12: + print('MMYY') + else: + print('NA')" +p03042,s113443430,Wrong Answer,"S = str(input()) + +S1 = S[0:2] +S2 = S[2:4] + +if 1 <= int(S1) <= 12: + if 1 <= int(S2) <= 12: + print('AMBIGOUS') + exit() + else: + print('MMYY') + exit() + +if 1 <= int(S2) <= 12: + if 1 <= int(S1) <= 12: + print('AMBIGOUS') + exit() + else: + print('YYMM') + exit() + +print('NA')" +p03042,s741290301,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) +if 012 and s2==00 or s2>12: + print('NA') + +elif s1==00 or s1>12 and 1<=s2<=12: + print('YYMM') +elif s2==00 or s2>12 and 1<=s1<=12 : + print('MMYY') +else: + print('AMBIGUOUS') + + + + +" +p03042,s486424931,Wrong Answer,"s = input() + +if '00' in s: + print('NA') +elif int(s[:2]) <= 12 and int(s[2:]) <= 12: + print('AMBIGUOUS') +elif int(s[2:]) < 13: + print('YYMM') +elif int(s[:2]) < 13: + print('MMYY') +else: + print('NA') +" +p03042,s969544665,Wrong Answer,"n=input() +a=int(n[0:2]) +b=int(n[2:4]) +if a<=12 and b<=12: + print('AMBIGUOUS') +elif a>=12 and a<=12: + print('MMYY') +elif 12<=b and b<=12: + print('YYMM') +else: + print('NA')" +p03042,s301771335,Wrong Answer,"s = input() +front, back = map(int, [s[:2], s[2:]]) + +yymm = False +mmyy = False +if 1 <= front and front <= 12: + mmyy = True + if 1 <= back and back <= 12: + yymm = True +else: + if 1 <= back and back <= 12: + mmyy = True + else: + pass + + +if yymm and mmyy: + print('AMBIGUOUS') +elif yymm: + print('YYMM') +elif mmyy: + print('MMYY') +else: + print('NA')" +p03042,s316311728,Wrong Answer,"s = input() +if int(s[:2]) and int(s[2:]) > 12: + print(""NA"") +elif int(s[:2]) and int(s[2:]) == 0: + print(""NA"") +elif int(s[:2]) > 12 and int(s[2:]) == 0: + print(""NA"") +elif int(s[:2]) == 0 and int(s[2:]) > 12: + print(""NA"") +elif int(s[:2]) > 12: + print(""YYMM"") +elif int(s[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s635641928,Wrong Answer,"s = input() + +if s[:2] == ""00"" or s[2:] == ""00"": + print(""NA"") + exit() + +if int(s[:2]) >= 13 and int(s[2:]) >= 13: + print(""NA"") + exit() + +if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12: + print(""AMBIGUOUS"") + exit() + + +if int(s[2:]) > 13: + print(""MMYY"") +else: + print(""YYMM"") " +p03042,s799639384,Wrong Answer,"s = input() +am = s[0]+s[1] +pm = s[2]+s[3] +p = [""01"",""02"",""03"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] +if am in p and pm in p: + print(""AMBIGUOUGS"") +elif am in p and pm not in p: + print(""MMYY"") +elif am not in p and pm in p: + print(""YYMM"") +elif am not in p and pm not in p: + print(""NA"")" +p03042,s260559658,Wrong Answer,"import sys, math, itertools, collections, bisect +input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') +inf = float('inf') ;mod = 10**9+7 +mans = inf ;ans = 0 ;count = 0 ;pro = 1 + +s = input() +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) +if a == 00 and b > 12: + print(""NA"") +elif a > 12 and b == 00: + print(""NA"") +elif a <= 12 and b <= 12: + print(""AMBIGUOUS"") +elif a <= 12: + print(""MMYY"") +elif b <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s367993396,Wrong Answer,"S = input() +up = int(S[0:2]) +down = int(S[2:4]) + +if(up >= 13 and 0 < down < 13): + print(""YYMM"") +if(0 < up < 13 and down >= 13): + print(""MMYY"") +if(0 < up < 13 and 0 < down < 13): + print(""AMBIGUOUS"") +if((up >= 13 and down >= 13) or (up == 0 or down == 0)): + print(""NA"") " +p03042,s713952661,Wrong Answer,"s = input() + +former = int(s[:2]) +later = int(s[2:]) + +if former==0 or later==0: + print(""NA"") +elif former<13 and later<13: + print(""AMBIGUOUS"") +elif former<13: + print(""MMYY"") +else: + print(""YYMM"")" +p03042,s481434351,Wrong Answer,"s = list(input()) + +a = int(s[0]+s[1]) +b = int(s[2]+s[3]) + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif a>12 and 1<=b<=12: + print('YYMM') +elif b>12 and 1<=a<=12: + print('MMYY') +else: + print('NA')" +p03042,s896879449,Wrong Answer,"s = input() +s1, s2 = s[:2],s[2:] +if s1>'12' and s2>'12': + print('NA') +elif s1<='12' and s2<='12': + if s1 == '00': + print('YYMM') + if s2 == '00': + print('MMYY') + else : + print('AMBIGUOUS') +elif s1<='12' and s2>'12': + print('NA' if s1 == '00' else 'MMYY') +elif s2<='12' and s1>'12': + print('NA' if s2 == '00' else 'YYMM') +else: + print('NA')" +p03042,s261358854,Wrong Answer,"import sys +S = str(input()) + +if (S[0]+S[1]) == ""00"" or (S[2]+S[3]) == ""00"": + print(""NA"") + sys.exit() + +if int(S[0]+S[1]) > 12: + if int(S[2]+S[3]) <= 12: + print(""YYMM"") + else: + print(""NA"") +if int(S[0]+S[1]) <= 12: + if int(S[2]+S[3]) <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"")" +p03042,s871008095,Wrong Answer,"s = input() +print(""{} {}"".format(s[0:2],s[2:4])) +s1 = int(s[0:2]) +s2 = int(s[2:4]) + +s1m = False +s1y = False +s2m = False +s2y = False +if s1 <= 12 and s1 >= 1: + s1y = True + s1m = True +elif s1 > 12 or s1 == 0: + s1y = True + +if s2 <= 12 and s2 >= 1: + s2y = True + s2m = True +elif s2 > 12 or s2 == 0: + s2y = True + +if s1y and s2y and s1m and s2m: + print(""AMBIGUOUS"") +elif s1y and s2m : + print(""YYMM"") +elif s2y and s1m : + print(""MMYY"") +else : + print(""NA"") + " +p03042,s155699053,Wrong Answer,"import sys +input = lambda: sys.stdin.readline().rstrip() + +S = input() + +f = int(S[:2]) +s = int(S[2:]) + +if (f <= 0 and s > 12) or (f > 12 and s <= 0) or (f <= 0 and s <= 0): + print(""NA"") +elif (f > 12 and 0 < s <= 12) or (f <= 0 and 0 < s <= 12): + print(""YYMM"") +elif (0 < f <= 12 and s > 12) or (0 < f <= 12 and s <= 0): + print(""MMYY"") +elif 0 < f <= 12 and 0 < s <= 12: + print(""AMBIGUOUS"") +" +p03042,s676599579,Wrong Answer,"s = input() + +upper = int(s[:2]) +lower = int(s[2:4]) + +if upper > 12: + if lower > 31 or lower <= 0: print('NA') + else: print('YYMM') +else: + if upper <= 0: print('NA') + elif lower > 31: print('MMYY') + else: print('AMBIGUOUS') + +" +p03042,s207984844,Wrong Answer,"s = input() +s1 = int(s[0]) +s2 = int(s[1]) +s3 = int(s[2]) +s4 = int(s[3]) +if(0 < (10 * s1 + s2) < 12 and 0 < (10 * s3 + s4) < 12): + print('AMBIGUOUS') +elif(0 < (10 * s3 + s4) < 12): + print('YYMM') +elif(0 < (10 * s1 + s2) < 12): + print('MMYY') +else: + print('NA')" +p03042,s418658965,Wrong Answer,"NN = input() +AA = int(NN[0:2]) +BB = int(NN[2:-1]) +count1 = 0 +count2 = 0 +if AA >12: + count1 +=1 +if BB >12: + count2 +=2 +if count1 == 0 and count2 == 0: + print('AMBIGUOUS') +elif count1 ==1 and count2 == 0: + print('YYMM') +elif count1 ==0 and count2 == 1: + print('MMYY') +else: + print('NA')" +p03042,s409082683,Wrong Answer,"S = input() +L = int(S[:2]) +R = int(S[2:]) +if (1<=L<=12): + if (1<=R<=12): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if (1<=R<=12): + print(""YYMM"") + else: + print(""NO"")" +p03042,s024475616,Wrong Answer,"s = input() + +a = int(s[:2]) +b = int(s[2:]) + +if a > 12 and b <= 12 and b >= 1: + print(""YYMM"") +elif a <= 12 and a >= 1 and b > 12: + print(""MMYY"") +elif a <= 12 and a >= 1 and b <= 12 and b >= 1: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s982816412,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[3:]) + +if 0 < a <= 12: + if 0 < b <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 0 < b <= 12: + print(""YYMM"") + else: + print(""NA"") + +" +p03042,s075870089,Wrong Answer,"s=str(input()) +a,b=int(s[:2]),int(s[2:]) +if (a>12 and b>12) or min(a,b)==0 : + print(""NA"") +elif a>12 and b<12: + print(""YYMM"") +elif a<12 and b>12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s040274457,Wrong Answer,"s = input() +s = [int(s[:2]),int(s[2:])] + +l = ['', ''] +for i in range(2): + if (s[i] == 0): + print('NA') + break + elif (1 <= s[i] <= 12): + l[i] = 'MM' + else: + l[i] = 'YY' +else: + if (l.count('MM') == 2): + print('AMBIGUOUS') + else: + print(l[0]+l[1]) +" +p03042,s149806153,Wrong Answer,"yymm = input() + +if 1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12 and 1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12: + print('AMBIGUOUS') +elif (1 <= int(yymm[0:2]) and int(yymm[0:2])) <= 12 and int(yymm[2:4]) <= 99: + print('YYMM') +elif int(yymm[0:2]) <= 99 and 1 <= (int(yymm[2:4]) and int(yymm[2:4]) <= 12): + print('MMYY') +else: + print('NA')" +p03042,s188891087,Wrong Answer,"S=input() +a=int(S[:2]) +b=int(S[2:]) +if a>12 and 1<=b<=12: + print(""YYMM"") +elif 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS"") +elif 1<=a<=12 and b>12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s930249425,Wrong Answer,"S = input() +a,b = int(S[:2]),int(S[2:]) +if (1<=a and a<=12) or (1<=b and b<=12): + if a>12 and b <= 12: + print(""YYMM"") + elif b>12 and a <= 12: + print(""MMYY"") + else: + print(""AMBIGUOUS"") + +else: + print(""NA"") + +" +p03042,s004318192,Wrong Answer,"s = input() +s1 = s[:2] +s2 = s[2:] +if int(s1) > 12 and int(s2) > 12 or (s1 == '00' and s2 == '00'): + print('NA') +elif (int(s1) > 12) or (s1 == '00'): + print('YYMM') +elif (int(s2) > 12) or (s2 == '00'): + print('MMYY') +elif int(s1) <= 12 and int(s2) <= 12 and int(s1) > 0 and int(s2) > 0: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s871420187,Wrong Answer,"s = input() +if s == '0000' or (int(s[:2]) >= 13 and int(s[-2:]) >= 13): + print('NA') +elif int(s[:2]) <= 12 and int(s[-2:]) <= 12: + print('AMBIGUOUS') +elif int(s[:2]) <= 12: + print('MMYY') +elif int(s[-2:]) <= 12: + print('YYMM')" +p03042,s297847417,Wrong Answer,"a= int(input()) +x= int(a%100) +y= int(a//100) +if x>0 and y>0: + if x<13 and y<13: + print(""AMBIGUOUS"") + elif x<13 and y<100: + print(""MMYY"") + elif x<100 and y<13: + print(""YYMM"") + else: + print(""NA"") +else: + print(""NA"")" +p03042,s039859886,Wrong Answer,"S=input() +S1=int(S[:2]) +S2=int(S[2:]) + +if ((0<=S1 and S1<=99) and (1<=S2 and S2<=12)): + if (0<=S1 and S1<=12) and (1<=S2 and S2<=99): + print(""AMBIGUOUS"") + else: + print(""YYMM"") +elif (1<=S1 and S1<=12) and (0<=S2 and S2<=99): + print(""MMYY"") + +else: + print(""NA"")" +p03042,s873563042,Wrong Answer,"N = list(input()) +if 1 <= int(N[0]+N[1]) <=12 and 1 <= int(N[2]+N[3]) <= 12: + print('AMBIGUOUS') +elif 1 <= int(N[0]+N[1]) <=12 and 12= 13 or int(S[:2]) == 0: + if int(S[2:]) >= 13 or int(S[2:]) == 0: print('NA') + else: print('YYMM') +else: + if int(S[2:]) >= 13: print('MMYY') + else: print('AMBIGUOUS')" +p03042,s191862077,Wrong Answer,"s = input() +n1 = int(s[0:2]) +n2 = int(s[2:4]) + +flag1 = False +flag2 = False +if n1 >= 1 and n2 >= 1 and n2 <= 12: + flag1 = True +if n1 >= 1 and n1 <= 12 and n2 >= 1: + flag2 = True + +if flag1 and flag2: + print('AMBIGUOUS') +elif flag1: + print('YYMM') +elif flag2: + print('MMYY') +else: + print('NA')" +p03042,s486184262,Wrong Answer,"S = input() +f,e = int(S[:2]),int(S[2:]) +if f>12: + if 012: + print('MMYY') + else: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s485046374,Wrong Answer,"s = list(input()) +head = int(s[0] + s[1]) +tail = int(s[2] + s[3]) + +if 0 < tail < 13: + print('YYMM') +elif 0 < head < 13: + print('MMYY') +elif (0 < head < 13) and (0 < tail < 13): + print('AMBIGUOUS') +else: + print('NA')" +p03042,s201991238,Wrong Answer,"a=input() +b=int(a[0]+a[1]) +c=int(a[2]+a[3]) +if b>12 or b==0: + if c>12 or c==0: + print(""Na"") + elif 1<=c<=12: + print(""YYMM"") +if c>12 or c==0: + if b>12 or b==0: + print(""Na"") + elif 1<=b<=12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s377056827,Wrong Answer,"S = input() +a = int(S[:2]) +b = int(S[2:]) + +ym = False +my = False +if a > 0 and b>0 and b <= 12: + ym = True +if b > 0 and a>0 and a <= 12: + my = True + +if ym and my: + print(""AMBIGUOUS"") +elif ym and not(my): + print('YYMM') +elif not(ym) and ym: + print('MMYY') +else: + print('NA') +" +p03042,s561811819,Wrong Answer,"S = input() + +if(int(S[:2])<=12 and int(S[2:])<=12): + print(""AMBIGUOUS"") +elif(int(S[:2])<=12): + print(""MMYY"") +elif(int(S[2:])<12): + print(""YYMM"") +else: + print(""NA"") +" +p03042,s024837202,Wrong Answer,"s = list(input()) + +a = int(s[0]+s[1]) +b = int(s[2]+s[3]) + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif a>12 and 1<=b<=12: + print('YYMM') +elif b>12 and 1<=a<=12: + print('MMYY') +elif a>12 and b>12: + print('NA') +elif a<0 and b<0: + print('NA')" +p03042,s218701206,Wrong Answer,"ym = int(input()) + +ym1 = int(ym/100) +ym2 = ym%100 + +if ym1>=1 and ym1<=12 and ym2>=1 and ym2<=12: + print('AMBIGUOUS') +elif ym1<1 or ym1 >12 and ym2<1 or ym2>12: + print('NA') +elif ym2<1 or ym2>12: + print('MMYY') +else: + print('YYMM')" +p03042,s094580299,Wrong Answer,"S = input() + +s1 = int(S[0] + S[1]) +s2 = int(S[2] + S[3]) + +if s1 > 12: #YY + if 0 < s2 <= 12: + print('YYMM') + else: + print('NA') + exit() +elif s2 > 12: #YY + if 0 < s1 <= 12: + print('MMYY') + else: + print('NA') + exit() +else: + if s1 == 0 and s1 == 0: + print('NA') + else: + print('AMBIGUOUS')" +p03042,s775947496,Wrong Answer,"from sys import stdin +def S(): return stdin.readline().rstrip() + +s = S() + +ym = True +my = True + +tmp = '' +for i in range(2): + tmp += s[i] +tmp = int(tmp) +if tmp<1: + ym = False + my = False +elif 12 < tmp: + my = False + +tmp = '' +for i in range(2): + tmp += s[i+2] +tmp = int(tmp) +if tmp < 1: + ym = False + my = False +if 12 < tmp: + ym = False + +if ym and my: + print('AMBIGUOUS') +elif ym and not my: + print('YYMM') +elif not ym and my: + print('MMYY') +else: + print('NA')" +p03042,s089602046,Wrong Answer,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if a>0 and a<13: + if b>0 and b<13: + print(""AMBIGUOUS"") + elif b!=0: + print(""MMYY"") + else: + print(""NA"") +elif a!=0: + if b>0 and b<13: + print(""YYMM"") +else: + print(""NA"")" +p03042,s043117097,Wrong Answer,"s = list(input()) +s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])] + +if 1 <= s[0] <= 12: + if 1 <= s[1] <= 12: + print(""AMIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= s[1] <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s004003310,Wrong Answer,"s=input() +be=s[:2] +af=s[2:] + +if s==""0000"": + print(""NA"") + +elif int(be)<=12 and int(af)<=12 and be!=""00"" and af!=""00"": + print(""AMBIGUOUS"") + +elif int(af)<=12: + if af==""00"" and int(be)<=12: + print(""MMYY"") + else: + print(""YYMM"") + +elif int(be)<=12: + if be==""00"": + print(""NA"") + else: + print(""MMYY"") + +else: + print(""NA"")" +p03042,s695826318,Wrong Answer,"s = int(input()) +a, b = s // 100, s % 100 + +if 1<=a<=12 and 1<=a<=12: + print('AMBIGUOUS') +elif 1<=a<=12: + print('MMYY') +elif 1<=b<=12: + print('YYMM') +else: + print('NA')" +p03042,s151626708,Wrong Answer,"import sys +import heapq +import math +import fractions +import bisect +import itertools +from collections import Counter +from collections import deque +from operator import itemgetter +def input(): return sys.stdin.readline().strip() +def mp(): return map(int,input().split()) +def lmp(): return list(map(int,input().split())) + +s=int(input()) +a=s//100 +b=s%100 +if a>12 and b>12: + print(""Na"") +elif a>12: + print(""YYMM"") +elif b>12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s928871569,Wrong Answer,"import sys + +S = input() + +if int(S[:2]) == 0 and 0 < int(S[2:]) <= 12: + print(""YYMM"") + sys.exit() + +if int(S[:2]) == 0 or int(S[2:]) == 0 or (int(S[:2]) > 12 and int(S[2:]) > 12): + print(""NA"") +elif int(S[:2]) > 12 and int(S[2:]) <= 12: + print(""YYMM"") +elif int(S[:2]) <= 12 and int(S[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s418197421,Wrong Answer,"text=input() +a=int(text) +f=a/100 +f=int(f) +l=int(text[2:]) +s=0 +if( f >0 and f<=12 and l>12): + print('MMYY') +if (l>0 and l<=12 and f>12): + print('YYMM') +if( ( f >0 and f<=12 and l>=0) or (l>0 and l<=12 and f>=0)): + print('AMBIGUOUS') +else: + print('NA') + + + + + + + + + +" +p03042,s653784653,Wrong Answer,"s=input() +be=s[:2] +af=s[2:] + +if int(be)>=13 and int(af)<=12: + if af==""00"": + print(""NA"") + else: + print(""YYMM"") +elif int(be)<=12 and int(af)>=13: + if be==""00"": + print(""NA"") + else: + print(""MMYY"") +elif int(be)<=12 and int(af)<=12: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s308871725,Wrong Answer,"s = [int(k) for k in list(input())] +s1 = 10*int(s[0])+int(s[1]) +s2 = 10*int(s[2])+int(s[3]) +if s2 == 0: + print(""NA"") +elif s1 > 12 and s2 <= 12: + print(""YYMM"") +elif s1 <= 12 and s2 > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s416290934,Wrong Answer,"n=int(input()) +a2=n%100 +a1=n//100 +if 012: + print(""YYMM"") + +elif 012: + print(""MMYY"") +elif 00: + print(""AMBIGUOUS"") + + + +else: + print(""NA"") +" +p03042,s322479464,Wrong Answer,"s = input() +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +if s1 == s2 == 0: + print('NA') +elif s1 <= 12: + if s2 <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +elif s2 <= 12: + print('YYMM') +else: + print('NA')" +p03042,s040802570,Wrong Answer,"S = input() +first_half = int(S[:2]) +second_half = int(S[2:]) +if 0 < first_half and first_half <= 12 and 0 < second_half and second_half <= 12: + print(""ambiguous"") +elif 0 < first_half and first_half <= 12: + print(""MMYY"") +elif 0 < second_half and second_half <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s300146560,Wrong Answer,"n=input() + +n1,n2=int(n[:2]),int(n[2:]) +if (n1>12 and n2>12) or n1==0 or n2==0: + print(""NA"") +elif (n1!=0 and n1<=12) and (n2!=0 and n2<=12): + print(""AMBIGUOUS"") +elif n1!=0 and n1<=12: + print(""MMYY"") +elif n2!=0 and n2<=12: + print(""YYMM"") +else: + print(""errer"") + + + + " +p03042,s153736898,Wrong Answer,"s = str (input()) +bflag = True +lflag = True +if not(s[0] + s[1] in ['01','02','03','04','05','06','07','08','09','10','11','12']): + bflag = False +if not(s[2] + s[3] in ['01','02','03','04','05','06','07','08','09','10','11','12']): + lflag = False +if bflag: + if lflag: + print('ANBIGUOUS') + else: + print('MMYY') +else: + if lflag: + print('YYMM') + else: + print('NA')" +p03042,s371551389,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) +if a <= 12: + if b <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if b <= 12: + print('YYMM') + else: + print('NA')" +p03042,s301537770,Wrong Answer,"S = input() +YY = int(S[0:2]) +MM = int(S[2: ]) + +if YY <= 12 and MM <= 12 and MM > 0: + print(""AMBIGUOUS"") +elif YY <= 12 and YY > 0 and MM >= 13: + print(""MMYY"") +elif YY >= 13 and MM <= 12 and MM > 0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s132308343,Wrong Answer,"S = list(input()) + +S = list(map(int, S)) + +if S[0] == S[1] == 0 or S[2] == S[3] == 0 or (S[0] > 2 and S[2] > 0): + print(""NA"") +elif S[2] > 1 or (S[2] == 1 and S[3] > 2): + print(""MMYY"") +elif S[0] > 1 or (S[0] == 1 and S[1] > 2): + print(""YYMM"") +else: + print(""AMBIGUOUS"") +" +p03042,s090414702,Wrong Answer,"s = input() +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +if s1 == s2 == 0: + print('NA') +elif s1 <= 12 and s2 <= 12 and s1 >= 1 and s2 >= 1: + print('AMBIGUOUS') +elif s1 <= 12 and s1 >= 0: + print('MMYY') +elif s2 <= 12 and s2 >= 0: + print('YYMM') +else: + print('NA')" +p03042,s123742783,Wrong Answer,"S = input() + + +if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + print(""AMBIGUOUS"") +elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 0 < int(S[2:]) <= 12: + print(""YYMM"") +elif 0 < int(S[:2]) <= 12 and (int(S[2:]) > 12 or int(S[:2]) == 0): + print(""MMYY"") +else: + print(""NA"")" +p03042,s542125225,Wrong Answer,"def main(): + S = input().rstrip() + v1 = int(S[:2]) + v2 = int(S[2:]) + if 1 <= v1 <= 12 and 1 <= v2 <= 12: + print(""AMBIGUOUS"") + elif 1 <= v1 <= 12 and v2 >= 13: + print(""MMYY"") + elif v1 >= 13 and 1 <= v2 <= 12: + print(""YYMM"") + else: + print(""NA"") + + +if __name__ == '__main__': + main() +" +p03042,s179228811,Wrong Answer,"s = input() +head = int(s[:2]) +teil = int(s[2:]) +if head>12 or head == 0: + if teil>12 or teil == 0: + print(""NA"") + else: + print(""YYMM"") +else: + if teil>12: + print(""MMYY"") + else: + print(""AMBIGUOUS"")" +p03042,s803977956,Wrong Answer,"s = list(input()) + +for i in range(4): + s[i] = int(s[i]) + +a = s[0]*10 + s[1] +b = s[2]*10 + s[3] + +if a == 0 or b == 0: + print(""NA"") +elif a >= 13 and b >= 13: + print(""NA"") +elif a >= 13 and b <= 12: + print(""YYMM"") +elif a <= 12 and b >= 13: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s684244796,Wrong Answer,"s = input() +s_f = int(s[0]+s[1]) +s_b = int(s[2]+s[3]) + +#print(s_f) +#print(s_b) +if s_f==0 or s_b==0: + print('NA') +elif 012: + print('MMYY') +elif s_f>12 and 012 and s_b>12: + print('NA') + + " +p03042,s532039316,Wrong Answer,"try: + s1=(input('')) + if len(s1)==4: + check=list((s1)) + assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12) + if int(check[0]+check[1])<=12: + print(""MMYY"") + elif int(check[2]+check[3])<=12: + print(""YYMM"") +except AssertionError: + if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12: + print(""AMBIGUOS"") + else: + print(""NA"") + +" +p03042,s380264764,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:4]) + +if (b>=13 or b==0)and f>=13 : + print('NA') +elif (b>=13 or b==0)and f<=12 : + print('MMYY') +elif b<=12 and f>=13 : + print('YYMM') +else: + print('AMBIGUOUS')" +p03042,s572646198,Wrong Answer,"def main(): + S=int(input()) + a=S//100 + b=S%100 + if 1<=a<=12 and 1<=b<=12: + print(""AMBIGUOUS "") + elif 1<=a<=12 and b==0 or 13<=b<=99: + print(""MMYY"") + elif 1<=b<=12 and a==0 or 13<=a<=99: + print(""YYMM"") + else: + print(""NA"") +main()" +p03042,s966537197,Wrong Answer,"S = input() +up = int(S[0:2]) +down = int(S[2:4]) + +if(up >= 13 and 0 < down < 13): + print(""YYMM"") +if(0 < up < 13 and down >= 13): + print(""MMYY"") +if(0 < up < 13 and 0 < down < 13): + print(""AMBIGUOUS"") +else: + print(""NA"") " +p03042,s839263613,Wrong Answer," +s = list(input()) + +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) + +if a > 12 and 1 <= b <= 12: + print(""YYMM"") +elif 1 <= a <= 12 and b > 12: + print(""MMDD"") +elif 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"") + + +" +p03042,s091394567,Wrong Answer,"s = input() +first = int(s[:2]) +second =int(s[2:]) + +if (first > 0 and first < 13) and (second > 0 and second < 13): + print(""AMBIGUOUS"") +elif (first > 0 and first < 13) and (second > 12): + print(""MMYY"") +elif (first > 12) and (second > 0 and second < 13): + print('YYMM') +else: + print('NA') + +" +p03042,s024246755,Wrong Answer,"s=str(input()) +a=""Y"" +b=""Y"" +if 0 12 and rear > 12) or (front > 12 and rear == 0) or (rear > 12 and front == 0) or (front == 0 and rear == 0): + print(""NA"") + exit() +elif 0 < rear <= 12 and front > 12: + print(""YYMM"") + exit() +elif 0 < front <= 12 and rear > 12: + print(""MMYY"") +elif 0 < front <= 12 and 0 < rear <= 12: + print(""AMBIGUOUS"") +" +p03042,s732009420,Wrong Answer,"s = input() + +if 1 <= int(s[0:3]) <= 12 and 1 <= int(s[2:5]) <= 12: + print('AMBIGUOUS') +elif 1 <= int(s[0:3]) <= 12: + print('MMYY') +elif 1 <= int(s[2:5]) <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s436360702,Wrong Answer,"s = str(input()) +num = ['01','02','03','04','05','06','07','08','09','10','11','12'] +if s[:2] == '00' or s[2:] == '00': + print(""NA"") +elif s[:2] in num and s[2:] in num: + print(""AMBIGUOUS"") +elif s[:2] in num: + print(""MMYY"") +else: + print(""YYMM"")" +p03042,s230973789,Wrong Answer," + +S = input() + +try: + first = int(S[:2]) +except ValueError: + first = -1 + +try: + end = int(S[2:]) +except ValueError: + end = -1 + +def judgeYM(num): + if num >= 1 and num <= 12: + return ""M"" + elif num >= 0 and num <=99: + return ""Y"" + else: + return ""N"" + +fj = judgeYM(first) +ej = judgeYM(end) + +if fj == ""N"" or ej == ""N"": + print(""NA"") +elif fj == ""M"" and ej == ""M"": + print(""AMBIGUOUS"") +elif fj == ""M"": + print(""MMYY"") +else: + print(""YYMM"")" +p03042,s240136466,Wrong Answer,"s=input() +if s[:2]=='00' or s[2:]=='00': + print('NA') +elif 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12: + print('AMBIGUOUS') +elif 0 < int(s[:2]) <= 12: + print('MMYY') +elif 0 < int(s[2:]) <= 12: + print('YYMM')" +p03042,s109999716,Wrong Answer,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if a>0 and a<13: + if b>0 and b<13: + print(""AMBIGUOUS"") + elif b!=0: + print(""MMYY"") + else: + print(""NA"") +elif a!=0: + if b>0 and b<13: + print(""YYMM"") + else: + print(""NA"") +else: + print(""NA"")" +p03042,s119168304,Wrong Answer,"s=str(input()) + +s1="""".join(s[:2]) +s1i=int(s1) +s2="""".join(s[2:]) +s2i=int(s2) + +if s1i <=12 and s2i <=12: + print(""AMBIGUOUS"") +elif s1i >12 and s2i >12: + print(""NA"") +elif s1i == 0 or s2i ==0: + print(""NA"") +elif s1i >12 and s2i <= 12: + print(""YYMM"") +elif s1i <= 12 and s2i > 12: + print(""MMYY"") + +" +p03042,s154488637,Wrong Answer,"S = input() +s1,s2 = int(S[0:2]),int(S[2:4]) + +def f(n): + if n >= 1 and n <= 12: + return True + else: + return False + +if f(s1) and f(s2): + print(""AMBIGUOUS"") +elif f(s1) and s2 > 12 or s2 ==0: + print(""MMYY"") +elif f(s2) and s1 > 12 or s1 ==0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s385141200,Wrong Answer,"s = input() +j = int(s[:2]) +k = int(s[2:]) +if j <= 12 and k <= 12 and j != 0 and k != 0: + print(""AMBIGUOUS"") +elif j > 12 and k != 0: + print(""YYMM"") +elif j <= 12 and k > 12: + print(""MMYY"") +else: + print(""NA"")" +p03042,s129379324,Wrong Answer,"s = input() +s1 = int(s[0:2]) +s2 = int(s[2:4]) +ans = [False, False] +if s1 != 0 and 1 <= s2 <= 12: + ans[0] = True +if s2 != 0 and 1 <= s1 <= 12: + ans[1] = True +if ans == [False, False]: + print(""NA"") +elif ans == [True, True]: + print(""AMBIGUOUS"") +elif ans == [True, False]: + print(""YYMM"") +elif ans == [False, True]: + print(""MMYY"") + +" +p03042,s207154707,Wrong Answer,"S=str(input()) + +Ans=[int(S[0]+S[1]),int(S[2]+S[3])] + +if Ans[0]==0 or Ans[1]==0: + print(""NA"") +elif Ans[0]>12 or Ans[0]<1: + if Ans[1]>12 or Ans[1]<1: + print(""NA"") + else: + print(""YYMM"") +else: + if Ans[1]>12 or Ans[1]<1: + print(""MMYY"") + else: + print(""AMBIGUOUS"")" +p03042,s712012414,Wrong Answer,"s = input() +ans = 'NA' +if 1 <= int(s[:2]) <= 12: + ans = 'MMYY' + if 1 <= int(s[2:]) <= 12: + ans = 'ANBIGUOUS' +elif 1 <= int(s[2:]) <= 12: + ans = 'YYMM' +print(ans)" +p03042,s145698898,Wrong Answer,"S = input() +a = int(S[0]+S[1]) +b = int(S[2]+S[3]) +if a > 12 and b >12: + print('NA') +if (a == 0 and b >12) or (b ==0 and a > 12): + print('NA') +elif a <= 12 and b <= 12: + print('AMBIGUOUS') +elif a <= 12 and b > 12: + print('MMYY') +elif a > 12 and b <= 12: + print('YYMM') +" +p03042,s155240156,Wrong Answer,"yymm = input() +if int(yymm[0:2]) == 0 and int(yymm[2:4]) >= 13: + print('NA') +elif int(yymm[0:2]) <= 12 and int(yymm[2:4]) <= 12: + print('AMBIGUOUS') +elif int(yymm[0:2]) <= 12 and int(yymm[2:4]) <= 99: + print('MMYY') +elif int(yymm[0:2]) <= 99 and int(yymm[2:4]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s109039052,Wrong Answer,"yymm = input() + +if 1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12 or 1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12: + print('AMBIGUOUS') +elif (1 <= int(yymm[0:2]) and int(yymm[0:2])) <= 12 and int(yymm[2:4]) <= 99: + print('YYMM') +elif int(yymm[0:2]) <= 99 and 1 <= (int(yymm[2:4]) and int(yymm[2:4]) <= 12): + print('MMYY') +else: + print('NA')" +p03042,s941048210,Wrong Answer,"x = int(input()) +a = x // 1000117 +b = x % 100 + +a_is_month = 0 < a & a <= 12 +b_is_month = 0 < b & b <= 12 + +if a_is_month: + if b_is_month: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if b_is_month: + print(""YYMM"") + else: + print(""NA"") +" +p03042,s172873195,Wrong Answer,"# #!/usr/bin/env python3 +# # -*- coding: utf-8 -*- + + +def main(): + S = input() + + first = int(S[:2]) + second = int(S[2:]) + + if first < 10 and second < 10: + print('NA') + elif first == 0 or second == 0: + print('NA') + elif first > 12 and second <= 12: + print('YYMM') + elif first <= 12 and second > 12: + print('MMYY') + else: + print('AMBIGUOUS') + + +if __name__ == ""__main__"": + main() +" +p03042,s887277711,Wrong Answer,"def is_month( n :int ): + return ( 1 <= n ) and ( n <= 12 ) + +def judge( first, second ): + if (first and second): + return ""AMBIGUOUS"" + elif (first and not(second)): + return ""YYMM"" + elif (not( first ) and second): + return ""MMYY"" + else: + return ""NA"" + +s = input() +first = is_month( int( s[0:2] )) +second = is_month( int( s[2:4] )) +print( judge( first, second ) )" +p03042,s468687204,Wrong Answer,"s=input() + +l=[] +for i in range(len(s)): + l.append(s[i]) +l1=[] +l1.append(int(l[0]+l[1])) +l1.append(int(l[2]+l[3])) + +if(l1[0] <= 0 or l1[1] <= 0) or (l1[0] > 12 and l1[0] > 12): + print('NA') +elif l1[0] > 12 and l1[1] > 0 and l1[1] <= 12: + print('YYMM') +elif l1[0] > 0 and l1[0] <= 12 and l1[1] > 12: + print('MMYY') +elif (l1[0] > 0 and l1[0] <= 12) and (l1[1] > 0 and l1[1] <= 12): + print('AMBIGUOUS')" +p03042,s374591696,Wrong Answer,"S = input() +if int(S[0]+S[1])<13: #MMかYY + if 0 12: + print('NA') +elif S[2:] == '00' and int(S[:2]) > 12: + print('NA') +elif S == '0000': + print('NA') +if S[:2] == '00' and int(S[2:]) <= 12: + print('YYMM') +elif S[2:] == '00' and int(S[:2]) <= 12: + print('MMYY') +elif int(S[:2]) <= 12 and int(S[2:]) <= 12: + print('AMBIGUOUS') +elif int(S[:2]) <= 12: + print('MMYY') +elif int(S[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s847983876,Wrong Answer,"s = input() +be = s[0:2] +af = s[2:4] +if int(be) <= 12 and int(af) <= 12: + print('AMBIGUOUS') +elif (int(be) > 12 and af == '00') or (be == '00' and int(af) > 12): + print('NA') +else: + if int(be) > 12: + print('MMYY') + elif int(af) > 12: + print('YYMM')" +p03042,s544906012,Wrong Answer,"s = input() +upper_input = int(s[:2]) +lower_input = int(s[2:]) + +if upper_input >= 0 and upper_input<= 12: + if lower_input >= 0 and lower_input <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if lower_input >= 0 and lower_input <= 12: + print('YYMM') + else: + print('NA')" +p03042,s071630040,Wrong Answer,"s=input() + +l=[] +for i in range(len(s)): + l.append(s[i]) +l1=[] +l1.append(int(l[0]+l[1])) +l1.append(int(l[2]+l[3])) + +if l1[0] <= 0 or l1[1] <= 0: + print('NA') +elif l1[0] > 12 and l1[1] > 0 and l1[1] <= 12: + print('YYMM') +elif l1[0] > 0 and l1[0] <= 12 and l1[1] > 12: + print('MMYY') +elif (l1[0] > 0 and l1[0] <= 12) and (l1[1] > 0 and l1[1] <= 12): + print('AMBIGUOUS')" +p03042,s514467877,Wrong Answer,"s=input() +a=(int(s[0])-0)*10+int(s[1]) +b=(int(s[2])-0)*10+int(s[3]) +if 1<=b<=12 and 12= 13 or int(S[:2]) == 0)) or \ + (int(S[2:]) == 0 and (int(S[:2]) >= 13 or int(S[:2]) == 0)) or \ + (int(S[2:]) >= 13 and int(S[:2]) >= 13): + print('NA') +elif (int(S[:2]) >= 13 and int(S[2:]) < 13) or \ + (int(S[:2]) == 0 and int(S[2:]) < 13): + print('YYMM') +elif (int(S[2:]) >= 13 and int(S[:2]) < 13) or \ + (int(S[2:]) == 0 and int(S[:2]) < 13): + print('MMYY') +else: + print('AMBIGUOUS') +" +p03042,s956012505,Wrong Answer,"ym = int(input()) + +ym1 = ym/100 +ym2 = ym%100 + +if ym1>=1 and ym1<=12 and ym2>=1 and ym2<=12: + print('AMBIGUOUS') +elif ym1<1 or ym1 >12 and ym2<1 or ym2>12: + print('NA') +elif ym2<1 or ym2>12: + print('MMYY') +else: + print('YYMM')" +p03042,s367285572,Wrong Answer,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +ans="""" +if s1>12: + if s2>12 or s2==0: + ans=""NA"" + else: + ans=""YYMM"" +elif s1==0: + ans=""NA"" +else: + if s2>12: + ans=""MMYY"" + else: + ans=""AMBIGUOUS"" + +print(ans) +" +p03042,s977769131,Wrong Answer,"s=input() +f1=int(s[:2])<=12 +f2=int(s[2:4])<=12 +if f1 and f2:print(""AMBIGUOUS"") +elif not f1 and not f2:print(""NA"") +elif f1:print(""MMYY"") +else:print(""YYMM"")" +p03042,s906377614,Wrong Answer,"s=input() +s1=int(s[0]+s[1]) +s2=int(s[2]+s[3]) +if (0= 13 or int(S[:2]) == 0)) or \ + (int(S[2:]) == 0 and (int(S[:2]) >= 13 or int(S[:2]) == 0)) or \ + (int(S[2:]) >= 13 and int(S[:2]) >= 13): + print('NA') +elif (int(S[:2]) >= 13 and int(S[2:]) < 13) or \ + (int(S[:2]) == 0 and int(S[2:]) < 13): + print('YYMM') +elif (int(S[2:]) >= 13 and int(S[:2]) < 13) or \ + (int(S[2:]) == 0 and int(S[:2]) < 13): + print('MMYY') +else: + print('AMBIGUOUS') +" +p03042,s113542817,Wrong Answer,"N = int(input()) + +if 199 <= N <= 1299: + if 9901 <= N <= 9912: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +elif 9901 <= N <= 9912: + print(""YYMM"") +else: + print(""NA"")" +p03042,s684021742,Wrong Answer,"S=list(input()) +def main(): + while True: + if int(S[0]+S[1])>12: + if int(S[2]+S[3])==0: + return 'NA' + if int(S[2]+S[3])>12: + return 'YYMM' + else: + return 'AMBIGUOUS' + else: + return 'MMYY' + +print(main())" +p03042,s796154504,Wrong Answer,"s=input() + +s1=s[0]+s[1] +s2=s[2]+s[3] + +if s1=='00' or s2=='00': + print('NA') + exit() + +if s1[0]=='0' or s1=='11' or s1=='12': + ans1='MM' +else: + ans1='YY' + +if s2[0]=='0' or s2=='11' or s2=='12': + ans2='MM' +else: + ans2='YY' + +if ans1==ans2=='MM': + print('AMBIGUOUS') +else: + print(ans1+ans2)" +p03042,s790372580,Wrong Answer,"s = int(input()) +s_1 = s // 100 #4桁の数字列の上2桁を取り出す +s_2 = s % 100 #4桁の数字列の下2桁を取り出す + +if 1 <= s_1 <=12 and 1 <= s_2 <= 12: + print(""AMBIGUOUS"") +elif 1 <= s_1 <= 12 and s_2 > 12 or s_2 == 0: + print(""MMYY"") +elif 1 <= s_2 <= 12 and s_1 > 12 or s_1 == 0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s166432996,Wrong Answer,"S = list(input()) + +fo = int(''.join(S[:2])) +la = int(''.join(S[2:])) + +if fo==0 or la==0: + print(""NA"") +elif fo <= 12 and la <= 12: + print(""AMBIGUOUS"") +elif fo <= 12 and la > 12: + print(""MMYY"") +elif fo > 12 and la <= 12: + print(""YYMM"") +elif fo > 12 and la > 13: + print(""NA"") + +" +p03042,s747334710,Wrong Answer,"s = input() + +if s[:2] == ""00"" or s[2:] == ""00"": + print(""NA"") + exit() + +if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12: + print(""AMBIGUOUS"") + exit() + +if int(s[2:]) > 13: + print(""MMYY"") +else: + print(""YYMM"") " +p03042,s117639515,Wrong Answer,"S = input() +S1 = int(S[:2]) +S2 = int(S[2:]) + +if S1 > 12 and 1<= S2 <= 12: + print('YYMM') +elif 1<= S1 <= 12 and S2 > 12: + print('MMYY') +elif 1<= S1 <= 12 and 1<= S2 <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s669994762,Wrong Answer,"s = input() + +a = int(s[:2]) +b = int(s[2:]) + +if a <= 12: + if b <= 12 and b != 0: + print(""AMBIGUOUS"") + elif b > 12 or b == 0: + print(""MMYY"") +else: + if b > 12 or b == 0: + print(""NA"") + elif b <= 12: + print(""YYMM"") + " +p03042,s413037636,Wrong Answer,"S = input() +S_a = int(S[0] + S[1]) +S_b = int(S[2] + S[3]) +if((S_a >= 1 and S_a <= 12) and (S_b < 1 or S_b > 12)): + print('MMYY') +elif((S_a < 1 or S_a > 12) and (S_b >= 1 and S_b <= 12)): + print('YYMM') +elif((S_a >= 1 and S_a <= 12) and (S_b >= 1 and S_b <= 12)): + print('AMBIGUOUS') +else: + print('NO')" +p03042,s373877851,Wrong Answer,"s = input() +a = int(s[0:2]) +b = int(s[2:]) +if 1 <= a: + if 13 <= a: + if 1 <= b and b <= 12: + print('YYMM') + else: + print('NA') + else: + if b == 0: + print('NA') + elif b <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + print('NA')" +p03042,s822323186,Wrong Answer,"A = 15 +B = 200 + +if A >= 13: + price = B +elif 6 <= A <= 12: + price = B/2 +else: + price = 0 + +print(price)" +p03042,s962006569,Wrong Answer,"#ABC126 B + +S = list(map(int,input())) +if 1 <= S[0]*10 + S[1] <= 12 and 1 <= S[2]*10 + S[3] <= 12: + print(""AMBIGUOUS"") +elif 1 <= S[0]*10 + S[1] <= 12 and S[2]*10 + S[3] > 12: + print(""MMYY"") +elif S[0]*10 + S[1] > 12 and 1 <= S[2]*10 + S[3] <= 12: + print(""YYMM"") +elif S[0]*10 + S[1] > 12 and S[2]*10 + S[3] > 12: + print(""NA"")" +p03042,s393240402,Wrong Answer,"import sys +input = lambda: sys.stdin.readline().rstrip() + +S = input() + +f = int(S[:2]) +s = int(S[2:]) + +if (f <= 0 and s > 12) or (f > 12 and s <= 0): + print(""NA"") +elif (f > 12 and s <= 12) or (f <= 0 and s <= 12): + print(""YYMM"") +elif f <= 12 and s > 12 or (f <= 12 and s <= 0): + print(""MMYY"") +elif f <= 12 and s <= 12: + print(""AMBIGUOUS"") " +p03042,s413020934,Wrong Answer,"#import sys +#import math +#import numpy as np +'''a,b= map(int,input().split())''' +#a, b, c = [list(map(int, input().split())) for _ in range(3)] +#li0= [int(x) for x in input().split()] +#n,l= map(int, input().split()) +#x = [list(map(int, input().split())) for _ in range(n)] +N=input() + +a=int(N[0:2]) +b=int(N[2:4]) + +if (a==0 or b==0): + print('NA') +elif (a<13 and b<13): + print(""AMBIGUOUS"") +elif (a<13): + print('MMYY') +elif b<13: + print('YYMM') +else: + print('NA')" +p03042,s867788221,Wrong Answer,"s = [int(k) for k in list(input())] +s1 = 10*int(s[0])+int(s[1]) +s2 = 10*int(s[2])+int(s[3]) +if s1 == 0 or s2 == 0: + print(""NA"") +elif s1 <= 12 and s2 <= 12: + print(""AMBIGUOUS"") +elif s1 <= 12 and s2 >= 12: + print(""MMYY"") +else: + print(""YYMM"")" +p03042,s860049695,Wrong Answer,"def main(): + S = input() + if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + return ""AMBIGUOUS"" + elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0: + return ""YYMM"" + elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0): + return ""MMYY"" + else: + return ""NA"" + + +if __name__ == '__main__': + main() +" +p03042,s579659117,Wrong Answer,"S = input() +if int(S[0]+S[1]) <= 12 and int(S[2]+S[3]) <= 12: + print('AMBIGUOUS') + +elif 0 < int(S[0]+S[1]) and int(S[0]+S[1]) <= 12 and int(S[2]+S[3]) >12: + print('MMYY') + +elif int(S[0]+S[1]) > 12 and 0 < int(S[2]+S[3]) and int(S[2]+S[3]) <= 12: + print('YYMM') + +else: + print('NA')" +p03042,s823655790,Wrong Answer,"s = input() +i = int(s[:2]) +j = int(s[2:]) +if 1 <= i and i <= 12: + if 1 <= j and j <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 1 <= i: + if 1 <= j and j <= 12: + print('YYMM') + else: + print('NA') + else: + print('NA') +" +p03042,s719405827,Wrong Answer," +n=int(input()) +n_1=n//100 +n_2=n%100 + +if 1<=n_1<=12 and 13<=n_1<=31: + print('MMYY') +elif 1<=n_1<=12 and 1<=n_2<=12: + print('AMBIGUOUS') +elif 13<=n_1<=31 and 1<=n_2<=12: + print('YYMM') +else: + print('NA') +" +p03042,s275009528,Wrong Answer,"def main(): + s = input() + #print(s[:2], s[2:4]) + if int(s[:2]) > 12 and (int(s[2:4]) >= 1 and int(s[2:4]) <= 12) : + print(""YYMM"") + elif int(s[2:4])>12 and (int(s[:2]) >=1 and int(s[:2]) <=12) : + print(""MMYY"") + elif (int(s[:2]) >= 1 and int(s[:2])) <= 12 and (int(s[2:4]) >=1 and int(s[2:4]) <= 12) : + print(""AMBIGUOUS"") + else: + print(""NA"") + +if __name__ == ""__main__"": + main() +" +p03042,s805549789,Wrong Answer,"S = int(input()) +a = S % 100 +b = (S- (S % 100))/100 +if b <= 12 and a<=12 and a!=0 and b!= 0: + print(""AMBIGUOUS"") +elif b <= 12 and a!=0 : + print(""MMYY"") +elif a<=12 and a!=0 : + print(""YYMM"") +else : + print(""NA"")" +p03042,s779766877,Wrong Answer,"S = list(input()) + +a = int("""".join(S[0:2])) +b = int("""".join(S[2:4])) + +if 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +elif 1 <= a <= 12 and b != 0: + print(""MMYY"") +elif 1 <= b <= 12 and a != 0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s504342759,Wrong Answer,"s = input() + +if int(s[:2])<=12 and int(s[2:])<=12: + print('AMBIGUOUS') +elif int(s[:2])<=12 and int(s[2:])>12: + print('MMYY') +elif int(s[:2])>12 and int(s[2:])<=12: + print('YYMM') +else: + print('NA')" +p03042,s095493534,Wrong Answer,"s=list(input()) +a=int("""".join(s[0:2])) +b=int("""".join(s[2:4])) +print(""NA"" if a==0 or b==0 else + ""NA"" if a >= 13 and b >= 13 else + ""YYMM"" if a > 12 else + ""MMYY"" if b > 12 else + ""AMBIGUOUS"")" +p03042,s142495313,Wrong Answer,"S = input() +if int(S[:2]) > 12 and int(S[2:]) > 12 or int(S[:2]) == 0 or int(S[2:]) == 0: + print(""NA"") +elif int(S[:2]) > 12: + print(""YYMM"") +elif int(S[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"") +" +p03042,s061088762,Wrong Answer,"S = input() +ls = list(S) +lsa = [ls[0],ls[1]] +lsb = [ls[2],ls[3]] + +a = int(''.join(lsa)) +b = int(''.join(lsb)) + +if (a >= 1 and a <= 12) and (b >= 1 and b <= 12): + print('AMBIGIOUS') +elif (a >= 1 and a <= 12) and (b >= 13 or b == 0): + print('MMYY') +elif (a >= 13 or a == 0) and (b >= 1 and b <= 12): + print('YYMM') +else: + print('NA')" +p03042,s993507056,Wrong Answer,"n=int(input()) +a2=n%100 +a1=n//100 +if 012: + print(""YYMM"") + +elif 012: + print(""MMYY"") +elif 00: + print(""AMBIGUOUS"") + + + +else: + print(""NA"") +" +p03042,s723373750,Wrong Answer,"s = input() + +a = s[0]+s[1] +b = s[2]+s[3] + +a = int(a) +b = int(b) + +if a == 0 or b == 0: + print('NA') + exit() + +if a <= 12: + if b <= 12: + print('AMBIGUOUS') + elif 12 < b: + print('MMYY') + +if 12 < a: + if b <= 12: + print('YYMM') + elif 12 < b: + print('NA') + +" +p03042,s888880477,Wrong Answer,"S = input() +AA = int(S[:2]) +BB = int(S[2:]) +if (1 <= AA <= 12) and (1 <= BB <= 12): + print('AMBIGUOUS') +elif (13 <= AA) and (1 <= BB <= 12): + print('YYMM') +elif (1 <= AA <= 12) and (13 <= BB): + print('MMYY') +else: + print('NA')" +p03042,s997677579,Wrong Answer,"S=input() +x=int(S[:2]) +y=int(S[2:]) +if x==0: + print(""NA"") +elif 0=13: + print(""MMYY"") + elif y==0: + print(""NA"") +elif x>=13: + if 0=13: + print(""NA"") + elif y==0: + print(""NA"")" +p03042,s202387571,Wrong Answer,"s=input() + +if 12=int(s[2:])>=1: + print(""YYMM"") + else: + print(""NA"") +else: + if 12>=int(s[2:])>=1: + print(""AMBIGUOUS"") + else: + print(""MMYY"") + + +" +p03042,s892983023,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if a >12 and b>12 or a > 31 or b > 31 or a==0 or b == 0: + print('NA') +elif 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif 1<=a<=12 and 1<=b<=31: + print('MMYY') +elif 1<=b<=12 and 1<=a<=31: + print('YYMM') +else: + print('NA')" +p03042,s090099891,Wrong Answer,"S=str(input()) + +Ans=[int(S[0]+S[1]),int(S[2]+S[3])] + +if Ans[0]==0 or Ans[1]==0: + print(""NA"") +elif Ans[0]>12 or Ans[0]<1: + if Ans[1]>12 or Ans[1]<1: + print(""NA"") + else: + print(""YYMM"") +else: + if Ans[1]>12 or Ans[1]<1: + print(""MMYY"") + else: + print(""AMBIGOUS"")" +p03042,s187734500,Wrong Answer,"n = input() +a = int(n[0:2]) +b = int(n[2:]) +if 1 <= a <= 12 and 1 <= b <= 12: + print('AMBIGUOUS') +elif 1 <= a <= 12 and b > 12: + print('MMYY') +elif 1 <= b <= 12 and a > 12: + print('YYMM') +else: + print('NA')" +p03042,s591580629,Wrong Answer,"S = str(input()) +year = S[0] + S[1] +month = S[2] + S[3] +if int(year) <= 12 and int(month) <= 12: + print('AMBIGUOUS') +elif int(year) > 0 and int(month) != 0: + print('YYMM') +elif int(month) > 0 and int(year) != 0: + print('MMYY') +else: + print('NA')" +p03042,s970409847,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:4]) + +if (f>=13 or f==00)and b>=13 : + print('NA') +if (f>=13 or f==00)and 1<=b<=12 : + print('YYMM') +elif 1<=f<=12 and (b>=13 or b==00) : + print('MMYY') +elif f<=13 and (b>=13 or b==00) : + print('AMBIGUOUS') " +p03042,s460365965,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:]) +if f<13 and b<13: + print('AMBIGUOUS') +elif 0 12 and c[1] < 13 and c[1] != 0: + g = ""YYMM"" +if c[0] < 13 and c[1] > 12 and c[0] != 0: + g = ""MMYY"" +if c[0] < 13 and c[1] < 13: + g = ""AMBIGUOUS"" +if c[0] < 1 or c[1] < 1 or c[1] > 12 and c[0] > 12: + g = ""NA"" +print(g)" +p03042,s719462655,Wrong Answer,"S = input() + +first_two = int(S[:2]) +last_two = int(S[-2:]) + +if first_two == 0 or first_two > 12: + if last_two == 0: + print('NA') + elif last_two <= 12: + print('YYMM') + else: + print('NA') +elif first_two <= 12: + if last_two == 0: + print('NA') + elif last_two <= 12: + print('AMBIGUOUS') + else: + print('MMYY') + " +p03042,s019513826,Wrong Answer,"s=list(input()) +s=list(map(int,s)) + +a=s[0]*10+s[1] +b=s[2]*10+s[3] + +if (a==0 and b==0) or (a>=13 and b>=13): + print(""NA"") +elif 0= 13 or s[:2] == '00') and (int(s[2:4]) >= 13 or s[2:4] == '00'): + print('NA') +elif int(s[:2]) <= 12 and int(s[2:4]) <= 12: + print('AMBIGUOUS') +elif int(s[:2]) <= 12: + print('MMYY') +elif int(s[:2]) >= 13: + print('YYMM') + +" +p03042,s486665253,Wrong Answer,"s = input() +mae = int(s[:2]) +ato = int(s[3:]) + +flag1 = 0 +flag2 = 0 +if 0 12 and int(n2) > 12: + out_print = 'NA' + +elif int(n1) <= 12 and int(n2) <= 12: + out_print = 'AMBIGUOUS' + +elif int(n1) <= 12 and int(n2) >12: + out_print = 'MMYY' + if int(n1) == 0: + out_print = 'NA' +elif int(n1) > 12 and int(n2) <= 12: + out_print = 'YYMM' + if int(n2) == 0: + out_print = 'NA' + +print(out_print)" +p03042,s578322031,Wrong Answer,"S = input() + +if 1 <= int(S[2] + S[3]) <= 12 and 1 <= int(S[0] + S[1]) <= 12: + print('AMBIGUOUS') +elif 1 <= int(S[2] + S[3]) <= 12 and not (1 <= int(S[0] + S[1]) <= 12): + print('YYMM') +elif 1 <= int(S[0] + S[1]) <= 12 and not (1 <= int(S[2] + S[3]) <= 12): + print('MMYY') +else: + print('NN')" +p03042,s246900616,Wrong Answer,"s = str(input()) +a = int(s[0])*10 + int(s[1]) +b = int(s[2])*10 + int(s[3]) +if a >= 13 and 1 <= b <= 12: + print(""YYMM"") +elif 1 <= a <= 12 and b >= 13: + print(""MMYY"") +elif 1 <= a <= 12 and 1 <= b <= 12: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s583902910,Wrong Answer,"S = int(input()) +a = S % 100 +b = (S- (S % 100))/100 +if a <= 31 and b <= 12 and b<=31 and a<=12 and a!=0 and b!= 0: + print(""AMBIGUOUS"") +elif a <= 31 and b <= 12 and a!=0 and b!= 0: + print(""MMYY"") +elif b<=31 and a<=12 and a!=0 and b!= 0 : + print(""YYMM"") +else : + print(""NA"")" +p03042,s379384019,Wrong Answer,"inp = input() +fst = int(inp[0:2]) +snd = int(inp[2:4]) + +if(fst!=0 and fst>0 and fst<=12 and snd!=0 and snd>0 and snd<=12): + print(""AMBIGUOUS"") +else: + if(fst!=0 and fst>0 and fst>=12 and snd>0 and snd!=0 and snd<=12): + print(""YYMM"") + elif(fst!=0 and fst>0 and snd>0 and fst<=12 and snd!=0 and snd>=12): + print(""MMYY"") + else: + print(""NA"") +" +p03042,s253024016,Wrong Answer,"str_MY = input() +int_f = int(str_MY[:2]) +int_b = int(str_MY[2:]) +if (12 12: + if int(num[2:]) > 12 or int(num[2:])== 0: + print('NA') + else: + print('YYMM') +else: + if int(num[2:]) > 12 and int(num[2:])== 0: + print('MMYY') + else: + print('AMBIGUOUS')" +p03042,s309504379,Wrong Answer,"S = input() +S1 = int(S[:2]) +S2 = int(S[2:]) + +if S1 == 0 or S2 == 0: + print('NA') +elif S1 >= 13 and S2 < 13: + print('YYMM') +elif S1 < 13 and S2 >= 13: + print('MMYY') +else: + print('AMBIGUOUS')" +p03042,s869728734,Wrong Answer,"n = input() +a = int(n[0:2]) +b = int(n[2:]) +if a > 12 and b > 12: + print('NA') +elif a > 12 and b <= 12: + print('YYMM') +elif a <= 12 and b > 12: + print('MMYY') +else: + print('AMBIGUOUS')" +p03042,s194990684,Wrong Answer,"x = list(input()) + +x12 = int(''.join(x[:2])) +x34 = int(''.join(x[2:])) + +is_12YYMM = True +is_34YYMM = None +is_12MMYY = None +is_34MMYY = True + +if (x12 > 12) or (x12 < 1): + is_12MMYY = False +else: + is_12MMYY = True + +if (x34 > 12) or (x34 < 1): + is_34YYMM = False +else: + is_34YYMM = True + +if (is_12YYMM and is_34YYMM) and (is_12MMYY and is_34YYMM): + print('AMBIGUOUS') +elif (is_12YYMM and is_34YYMM): + print('YYMM') +elif (is_12MMYY and is_34YYMM): + print('MMYY') +else: + print('NA')" +p03042,s725200015,Wrong Answer,"S = input() +YYMM = 0 +MMYY = 0 +start = S[0:2] +end = S[2:4] +tmp1 = int(start) +tmp2 = int(end) +if(tmp1 != 0 and tmp2 <= 12 and tmp2 != 0): + YYMM = 1 +if(tmp2 != 0 and tmp1 <= 12 and tmp1 != 0): + MMYY = 1 +if(YYMM == 1 and MMYY == 1): + print(""AMBIGUOUS"") +elif(YYMM == 1): + print(""YYMM"") +elif(MMYY == 1): + print(""MMYY"") +else: + print(""NA"")" +p03042,s562101099,Wrong Answer,"#!/usr/bin/env python3 + +n=input() + +n1,n2=int(n[:2]),int(n[2:]) +if n1>12 and n2>12 or n1==0 or n2==0: + print(""Na"") +elif n1<=12 and n2<=12: + print(""AMBIGUOUS"") +elif n1!=0 or n1<=12: + print(""MMYY"") +elif n2!=0 or n2<=12: + print(""YYMM"") +else: + print(""errer"") + +" +p03042,s919955652,Wrong Answer,"s = input() + +upper = int(s[:2]) +lower = int(s[2:4]) + +if upper == 0 or lower == 0: + print('NA') + exit() + +if upper > 12: + if lower > 31: print('NA') + else: print('YYMM') +else: + if lower > 31: print('MMYY') + else: print('AMBIGUOUS') + +" +p03042,s047225581,Wrong Answer,"S = input() +A = int(S[0:2]) +B = int(S[2:]) + +if (A<=12 and B>=13 and A>0):#A is between 0-12 and B is not month (=year) + strFormat = ""MMYY"" +elif (A>=13 and B<=12 and B>0):#B is between 0-12 and B is not month(=year) + strFormat = ""YYMM"" +elif (A<=12 and B<=12 and A>0 and B>0):#both are between 1-12 + strFormat = ""AMBIGUOUS"" +else: + strFormat = ""NA"" + +print(strFormat)" +p03042,s105410917,Wrong Answer,"n = input() +a = int(n[:2]) +b = int(n[2:]) + +if 0 < a <= 12 and b > 12: + print('MMYY') +elif a > 12 and 0 < b <= 12: + print('YYMM') +elif 0 < a <= 12 and 0 < b <= 12: + print('AMBIGUOUS') +else: + print('NA')" +p03042,s346704506,Wrong Answer,"S = list(input()) +if int(''.join(S[0:2])) == 0 or int(''.join(S[2:4])) == 0: + print('NA') +elif int(''.join(S[0:2])) > 12 and int(''.join(S[2:4])) > 12: + print('NA') +elif int(''.join(S[0:2])) <= 12 and int(''.join(S[2:4])) > 12: + print('MMYY') +elif int(''.join(S[0:2])) > 12 and int(''.join(S[2:4])) <= 12: + print('YYMM') +else: + print('AMBIGUOUS') + +" +p03042,s124665229,Wrong Answer,"s = input() +s1 = int(s[0]) +s2 = int(s[1]) +s3 = int(s[2]) +s4 = int(s[3]) +if(0 < (10 * s1 + s2) < 12 and 0 < (10 * s3 + s4) < 12): + print('AMBIGUOUS') +elif(0 < (10 * s1 + s2) < 12): + print('YYMM') +elif(0 < (10 * s3 + s4) < 12): + print('MMYY') +else: + print('NA') +" +p03042,s937348762,Wrong Answer,"import sys +input = lambda: sys.stdin.readline().rstrip() +input_nums = lambda: list(map(int, input().split())) + +def main(): + S = input() + isMM = lambda s: int(s) > 0 and int(s) <= 12 + if isMM(S[:2]) and int(S[2:]) > 12: print('MMYY') + elif int(S[:2]) > 12 and isMM(S[2:]): print('YYMM') + elif isMM(S[:2]) and isMM(S[2:]): print('AMBIGUOUS') + else: print('NA') + +if __name__ == '__main__': + main() +" +p03042,s808323303,Wrong Answer,"s = input() + +if int(s[2:]) > 12: #下2桁 + if int(s[:2]) == 0: #上2桁 + print('NA') + elif int(s[:2]) > 12: + print('NA') + elif int(s[:2]) <= 12: + print('MMYY') +elif int(s[2:]) <= 12 and int(s[2:]) > 0: + if int(s[:2]) == 0: + print('YYMM') + elif int(s[:2]) <= 12: + print('AMBIGUOUS') + else: + print('YYMM') +else: + print('NA')" +p03042,s568238650,Wrong Answer,"s= str(input()) +s1, s2, s3, s4 = [int(i) for i in s] +if (s1 == 0 and 1 <= s2 and s2 <= 9) or (s2 == 1 and 0 <= s2 and s2 <= 2): + if (s3 == 0 and 1 <= s4 and s4 <= 9) or (s3 == 1 and 0 <= s4 and s4 <= 2): + print(""AMBIGUOUS"") + + else: + print(""MMYY"") +else: + if (s3 == 0 and 1 <= s4 and s4 <= 9) or (s3 == 1 and 0 <= s4 and s4 <= 2): + print(""YYMM"") + else: + print(""AMBIGUOUS"") +" +p03042,s262229569,Wrong Answer,"s = input() + +if 1<=int(s[:2])<=12 and 1<=int(s[2:])<=12: + print('AMBIGUOUS') +elif 1<=int(s[:2])<=12 and int(s[2:])>12: + print('MMYY') +elif int(s[:2])>12 and 1<=int(s[2:])<=12: + print('YYMM') +else: + print('NA')" +p03042,s546332488,Wrong Answer,"def mmyy(): + S=input() + + former=S[:2] + later=S[2:] + + if(int(former)>0 and int(former)<13): + #前半:mm かも + if(int(later)>0 and int(later)<13): + print(""AMBIGUOUS"") + else: + print(""mmyy"") + + else: + if(int(later)>0 and int(later)<13): + print(""yymm"") + else: + print(""NA"") + +if __name__ ==""__main__"": + mmyy() + " +p03042,s176728567,Wrong Answer,"s=input() +be=s[:2] +af=s[2:] + +if s==""0000"": + print(""NA"") + +elif int(be)<=12 and int(af)<=12 and be!=""00"" and af!=""00"": + print(""AMBIGUOUS"") + +elif int(af)<=12: + if af==""00"": + print(""NA"") + else: + print(""YYMM"") + +elif int(be)<=12: + if be==""00"": + print(""NA"") + else: + print(""MMYY"") + +else: + print(""NA"")" +p03042,s755242948,Wrong Answer,"a,b,c,d=input() +x=int(a+b) +y=int(c+d) +if 1<=x<=12 and 1<=y<=12: + print('AMBIGUOUS') +elif 1<=x<=12 and 13<=y<=99: + print('MMYY') +elif 13<=x<=99 and 1<=x<12: + print('YYMM') +elif 1<=x<=12 and y==0: + print('MMYY') +elif x==0 and 1<=y<=12: + print('YYMM') +else: + print('NA')" +p03042,s125341249,Wrong Answer,"s = (input()) +a= s[0:2] +b= s[2:4] +a = int(a) +b= int(b) +if a == 0 or b == 0: + if b!= 0 and a<13: + print('YYMM') + elif a!= 0 and b<13: + print('MMYY') + else: + print('NA') +elif a<13 or b<13: + if a>12: + print('YYMM') + elif b>12: + print('MMYY') + else: + print('AMBIGUOUS')" +p03042,s181407019,Wrong Answer,"S = int(input()) + +f = S // 100 +b = S % 100 + +if 1 <= f and f <= 12: + if b <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= b and b <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s514370094,Wrong Answer,"n=input() +f=n[:2] +l=n[2:] +if f==""00"" or l==""00"" or (int(f)>12 and int(l)>12): + print(""NA"") +elif int(f)>12: + print(""YYMM"") +elif int(l)>12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s662377001,Wrong Answer," +s = input() +sa = int(s[:2]) +sb = int(s[3:]) + +if sa >= 1 and sa <= 12 and sb >= 1 and sb <= 12: + print('AMBIGUOUS') + exit() +else: + if sa >= 1 and sa <= 12: + print('MMYY') + exit() + if sb >= 1 and sb <= 12: + print('YYMM') + exit() + +print('NA')" +p03042,s046270719,Wrong Answer,"s = input() +a = int(s[0] + s[1]) +b = int(s[2] + s[3]) +if 0 < a <= 12 and 0 < b <= 12: + print(""AMBIGUOUS"") +elif 0 < a <= 12 and b > 12: + print(""MMYY"") +elif a > 12 and 0 < b <= 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s921567867,Wrong Answer,"s=input() +yy = [""%02d"" % i for i in range(100)] +mm = [""%02d"" % i for i in range(1, 13)] +print(mm) +yymm = s[:2] in yy and s[2:] in mm +mmyy = s[:2] in mm and s[2:] in yy +print([""NA"",""MMYY"",""YYMM"",""AMBIGUOUS""][yymm*2+mmyy]) +" +p03042,s612969891,Wrong Answer,"s = str(input()) +top = int(s[:2]) +bottom = int(s[2:]) + +if 1 <= top <= 12 and bottom <= 12: + print('AMBIGUOUS') +elif top > 12 and bottom > 12: + print('NA') +elif 1 <= top <= 12: + print('MMYY') +elif 1 <= bottom <= 12: + print('YYMM') +else: + print('NA')" +p03042,s000501767,Wrong Answer,"X = input() +A = int(X[0:2]) +B = int(X[2:]) + +if A == 0: + if B == 0: + print('NA') + elif B > 12: + print('NA') + else: + print('YYMM') +elif A > 12: + if B == 0: + print('NA') + elif B > 12: + print('NA') + else: + print('YYMM') +else: + print('MMYY')" +p03042,s841228017,Wrong Answer,"s = input() + +if s[:2] == ""00"" and s[2:] == ""00"": + print(""NA"") + exit() + +if int(s[:2]) >= 13 and int(s[2:]) >= 13: + print(""NA"") + exit() + +if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12: + print(""AMBIGUOUS"") + exit() + + +if int(s[2:]) > 13: + print(""MMYY"") +else: + print(""YYMM"") " +p03042,s196115932,Wrong Answer,"z = input() +x = int(z[:2]) +y = int(z[2:]) + +if ( x == 0 and y == 0) or ( x> 12 and y > 12): + print(""NA"") +elif (x <= 12): + if (y<= 12): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + print(""YYMM"") +" +p03042,s701634960,Wrong Answer,"S = input() +month_list = [""01"",""02"",""03"",""04"",""04"",""05"",""06"",""07"",""08"",""09"",""10"",""11"",""12""] + +if S[0:2] in month_list: + if S[2:4] in month_list: + print(""AMBIGUOUS"") + elif S[2:4] == ""00"": + print(""NA"") + else: + print(""MMYY"") + +else: + if S[2:4] in month_list: + print(""YYMM"") + else: + print(""NA"")" +p03042,s599363344,Wrong Answer,"S = input() +LL,RR = int(S[:2]), int(S[2:]) + +def v_month(x): + return 1<=x and x<=12 + +def v_year(x): + return 1<=x + +m1 = v_month(LL) +y1 = v_year(LL) + +m2 = v_month(RR) +y2 = v_year(RR) + +if (m1 and y1) and (m2 and y2): + print(""AMBIGUOUS"") +elif m1 and y2: + print(""MMYY"") +elif y1 and m2: + print(""YYMM"") +else: + print(""NA"") " +p03042,s957885640,Wrong Answer,"S=input() +A=int(S[0:2]) +B=int(S[2:4]) +if 1<=A<=12: + if 1<=B<=12: + ans=""AMBIGUOUS"" + elif 1212: + print('MMYY') +elif a>12 and 1<=b<=12: + print('YYMM') +else: + print('NA') +" +p03042,s945490018,Wrong Answer,"S=input() +a=int(S[0]+S[1]) +b=int(S[2]+S[3]) +if (a==0 or a>12) and 012): + print(""MMYY"") +else: + print(""NA"")" +p03042,s438599380,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if a <= 12 and b <= 12: + if a==0 or b==0: + print(""NA"") + else: + print(""AMBIGUOUS"") +elif a<=12 and b>12: + if a==0: + print(""NA"") + else: + print(""MMYY"") +elif a>12 and b<=12: + if b==0: + print(""NA"") + else: + print(""YYMM"") +else: + print(""NA"")" +p03042,s449096550,Wrong Answer,"s=input() + +first_two=int(''.join(s[:2])) +last_two=int(''.join(s[2:])) + +if 1<=first_two<=12 and 1<=last_two<=12: + print('AMBIGUOUS') +elif 1<=last_two<=12: + print('YYMM') +elif 13<=last_two and 1<=first_two<=12: + print('MMYY') +else: + print('NA')" +p03042,s656521040,Wrong Answer,"S = input() + +#print(int(S[:2]), int(S[2:])) + +if int(S[2:]) == 0 or int(S[:2]) == 0: + print('NA') +elif int(S[:2]) <= 12: + print('MMYY') +elif int(S[2:]) <= 12: + print('YYMM') +else: + print('AMBIGUOUS') +" +p03042,s400458176,Wrong Answer,"S = input() +ju1, ju2 = S[:2],S[2:] + +if (int(ju1) >= 0 and int(ju1) <= 12) or (int(ju2) >= 0 and int(ju2) <= 12): + if (int(ju1) > 0 and int(ju1) <= 12) and (int(ju2) > 0 and int(ju2) <= 12): + print('AMBIGUOUS') + elif (int(ju1) > 0 and int(ju1) <= 12) and int(ju2) > 0: + print('MMYY') + elif int(ju1) >= 0 and (int(ju2) > 0 and int(ju2) <= 12): + print('YYMM') +else: + print('NA')" +p03042,s699548673,Wrong Answer,"def main(): + s = input() + up = int(s[0:2]) + lo = int(s[-2:]) + if can_month(up): + if can_month(lo): + print('AMBIGUOUS') + else: + print('MMYY') + + else: + if can_month(lo): + print('YYMM') + else: + print('AMBIGUOUS') + + +def can_month(v): + if v > 0 and v <= 12: + return True + else: + return False + +if __name__ == '__main__': + main() + +" +p03042,s736627652,Wrong Answer,"S = input() +if 0 < int(S[0]+S[1]) and int(S[0]+S[1]) <= 12 and 0 < int(S[2]+S[3]) and int(S[2]+S[3]) <= 12: + print('AMBIGUOUS') + +elif 0 < int(S[0]+S[1]) and int(S[0]+S[1]) <= 12 and int(S[2]+S[3]) >12: + print('MMYY') + +elif int(S[0]+S[1]) > 12 and 0 < int(S[2]+S[3]) and int(S[2]+S[3]) <= 12: + print('YYMM') + +else: + print('NA')" +p03042,s669323039,Wrong Answer,"#!/usr/bin/env python + +S = input() + +yy = int(S[0:2]) +mm = int(S[2:]) + +if yy == 0 or mm == 0 : + print(""NA"") + exit(0) + +if yy < 13 and mm < 13 : + print(""AMBIGUOUS"") +elif yy < 13 and mm < 100: + print(""MMYY"") +elif yy < 100 and mm < 13: + print(""YYMM"") +else: + print(""NA"")" +p03042,s073739102,Wrong Answer,"s=int(input()) +a=s//100 +b=s%100 +if a<=12 and a>=1 and b<=12 and b>=1: + print(""AMBIGUOUS"") +elif a>=13 and b<=12: + print(""YYMM"") +elif a<=12 and b>=13: + print(""MMYY"") +else: + print(""NA"")" +p03042,s057217566,Wrong Answer,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if (a==0 or b==0) or (a>12 and b>12): + print(""NA"") +elif a<13 and b<13: + print(""AMBIGUOUS"") +elif a<13: + print(""MMYY"") +elif b<13: + print(""YYMM"")" +p03042,s915010714,Wrong Answer,"s = input() +start = int(s[0]+s[1]) +end = int(s[2]+s[3]) + +if 1 <= start <= 12 and 1 <= end <= 12: + print(""AMBIGUOUS"") +elif 1 <= start <= 12 and (end > 12 or end == 0): + print(""MMYY"") +elif (start > 12 or end == 0) and 1 <= end <= 12: + print(""YYMM"") +else: + print(""NA"") +" +p03042,s007094595,Wrong Answer,"s=list(input()) +fst=int(s[0])*10+int(s[1]) +scd=int(s[2])*10+int(s[3]) +if fst>12 and scd>12: + print(""NA"") +elif fst>12 and scd<=12: + print(""YYMM"") +elif fst<=12 and scd>12: + print(""MMYY"") +else: + print(""AMBIGOUS"")" +p03042,s438342690,Wrong Answer,"def main(): + S = str(input()) + front = int(S[0:2]) + latter = int(S[2:4]) + if front < 13 and latter < 13: + print('AMBIGUOUS') + elif front < 13 and latter < 100 and front > 0: + print('MMYY') + elif front < 100 and latter < 13 and latter > 0: + print('YYMM') + else: + print('NA') +main() +" +p03042,s023071420,Wrong Answer,"S = input() +f = int(S[:2]) +b = int(S[2:]) +if f > 12 and 0 < b <= 12: + print('YYMM') +elif b > 12 and 0 < f <= 12: + print('MMYY') +elif 0 < f <= 12 and 0 < b <= 12: + print('AMBIGUOUS') +else: + print('NA') +" +p03042,s631162189,Wrong Answer," +s = input() +s1 = int(s[:2]) +s2 = int(s[2:4]) + +if (s1 >= 13 or s1 <= 0) and (s2 >= 13 or s2 <= 0): + print(""NA"") +elif s1 <= 12 and s1 >= 1 and s2 >= 13: + print(""MMYY"") +elif s2 <= 12 and s2 >= 1 and s1 >= 13: + print(""YYMM"") +else: + print(""AMBIGUOUS"") + " +p03042,s603430184,Wrong Answer,"s = input() +x = int(s[:2]) +y = int(s[2:]) + +if 1 <= x <= 12 and 1 <= y <= 12: + print(""AMBIGUOUS"") +elif 1 <= x <= 12 and 1 <= y <= 99: + print(""MMYY"") +elif 1 <= y <= 12 and 1 <= x <= 99: + print(""YYMM"") +else: + print(""NA"")" +p03042,s886134577,Wrong Answer,"n=int(input()) +m=n%100 +y=n//100 +if 012: + print(""YYMM"") + +elif 012: + print(""MMYY"") +elif 012 or b==0: + if c>12 or c==0: + print(""Na"") + elif 1<=c<=12: + print(""YYMM"") +elif c>12 or c==0: + if b>12 or b==0: + print(""Na"") + elif 1<=b<=12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s346853653,Wrong Answer,"s=int(input()) +n1=s//100 +n2=s%100 +if 0 12 and 12 >= int(S[2:]) > 0: + print(""YYMM"") + elif int(S[2:]) > 12 and 12 >= int(S[:2]) > 0: + print(""MMYY"") + elif 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12: + print(""AMBIGUOUS"") + else: + print(""NA"") + + +if __name__ == '__main__': + main()" +p03042,s419905375,Wrong Answer,"def main(): + S = input() + + l = int(S[:2]) + r = int(S[2:]) + + if l > 12 and r > 12: + print(""NA"") + exit() + if l == 0 and r == 0: + print(""NA"") + exit() + + if l > 12 or l == 0: + print(""YYMM"") + exit() + + if r > 12 or r == 0: + print(""MMYY"") + exit() + + print(""AMBIGUOUS"") + + +main() +" +p03042,s891445354,Wrong Answer,"s = input() +if ""00"" in s: + print(""NA"") + exit(0) +ans = """" +s1 = int(s[:2]) +s2 = int(s[-2:]) +if s1 + s2 >= 26: + ans = ""NA"" +elif s1 <= 12 and s2 <= 12: + ans = ""AMBIGUOUS"" +elif s1 > 12: + ans = ""YYMM"" +else: + ans = ""MMYY"" +print(ans)" +p03042,s792645543,Wrong Answer,"# input +S = input() +x, y = S[:2], S[2:] + +# check +not_YY_x = (int(x) >= 13) +not_YY_y = (int(y) >= 13) +zero_x = (x == ""00"") +zero_y = (y == ""00"") +checker = [not_YY_x, not_YY_y, zero_x, zero_y] + +if checker == [True, False, False, False]: + print(""MMYY"") +elif checker == [False, True, False, False]: + print(""YYMM"") +elif checker == [False, False, False, False]: + print(""AMBIGUOUS"") +else: + print(""NA"")" +p03042,s537047191,Wrong Answer,"s = input() + +left = int(s[:2]) +right = int(s[2:]) + +if 0 < left <= 12 and 0 < right <= 12: + print('AMBIGUOUS') +elif 0 < left <= 12 < right: + print('MMYY') +elif left > 12 >= right > 0: + print('YYMM') +else: + print('NA') +" +p03042,s848857789,Wrong Answer,"S=input() +a,b=int(S[:2]),int(S[2:]) +if 0 12: + print(""MMYY"") +elif int(A) > 12 and int(B) <= 12: + print(""YYMM"") +else: + print(""AMBIGUOUS"") +" +p03042,s845169025,Wrong Answer,"n=input() +a=int(n[0:2]) +b=int(n[2:4]) +if a<13 and b<13: + print('AMBIGUOUS') +elif a>=1 and a<=12: + print('MMYY') +elif 1<=b and b<=12: + print('YYMM') +else: + print('NA')" +p03042,s320150703,Wrong Answer,"S = input() + +if int(S[:2]) > 12 and int(S[2:]) == 0: + print(""NA"") +elif int(S[2:]) > 12 and int(S[:2]) == 0: + porint(""NA"") +elif int(S[2:]) > 12 and int(S[:2]) > 12: + print(""NA"") +elif int(S[:2]) == int(S[2:]) == 0: + print(""NA"") +elif int(S[:2]) > 12: + print(""YYMM"") +elif int(S[2:]) > 12: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s435748109,Wrong Answer,"S = input() + +ans = 'NA' +L = int(S[ : 2]) +R = int(S[2 :]) + +if L > 12 and 13 > R > 0: + ans = 'YYMM' +elif 13 > L > 0 and R > 12: + ans = 'MMYY' +elif 13 > L > 0 and 13 > R > 0: + ans = 'AMBIGUOUS' + +print(ans) +" +p03042,s861309663,Wrong Answer,"def main(): + s = list(input()) + s12 = int(s[0]) * 10 + int(s[1]) * 1 + s34 = int(s[2]) * 10 + int(s[3]) * 1 + l = list() + for i in [s12, s34]: + if i >= 1 and i <= 12: + l.append(1) + else: + l.append(0) + if sum(l) == 0: + print('NA') + elif sum(l) == 1: + print('YYMM') + else: + print('AMBIGUOUS') + +if __name__ == '__main__': + main()" +p03042,s160898163,Wrong Answer,"s = list(input()) +s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])] + +if 1 <= s[0] <= 12: + if 1 <= s[1] <= 12: + print(""AMIGUOUS"") + else: + print(""MMYY"") +else: + if 1 <= s[1] <= 12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s592860129,Wrong Answer,"S = str(input()) +front = int(S[:2]) +back = int(S[2:]) +S_list = list(S) + +if front > 12 or front == 0: + if 0 < back <= 12 : + print(""YYMM"") + else: + print(""NA"") +elif front <= 12 and front == 0: + if 0 < back <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"")" +p03042,s434760220,Wrong Answer,"S=input() +S1=int(S[:2]) +S2=int(S[2:]) + +if ((0<=S1 and S1<=99) and (1<=S2 and S2<=12)): + if (0<=S1 and S1<=12) and (1<=S2 and S2<=99): + print(""AMBIGUOUS"") + else: + print(""YYMM"") +elif (1<=S1 and S1<=12) and (0<=S2 and S2<=99): + print(""MMYY"") + +else: + print(""NA"")" +p03042,s504845057,Wrong Answer," +s = input() +sa = int(s[:2]) +sb = int(s[3:]) + +if sa >= 1 and sa <= 12 and sb >= 1 and sb <= 12: + print('AMBIGUOUS') + exit() +if sa > 12 and sb > 12: + print('NA') + exit() +if sa >= 1 and sa <= 12 and sb > 12: + print('MMYY') + exit() +if sa > 12 and sb >= 1 and sb <= 12: + print('YYMM') + exit() +" +p03042,s810705308,Wrong Answer,"def main(): + S = input() + a = S[0:2] + b = S[2:4] + if (a == ""00"" or b == ""00"") or (int(a) >= 13 and int(b) >= 13): + ans = ""NA"" + elif int(a) >= 13: + ans = ""YYMM"" + elif int(b) >= 13: + ans = ""MMYY"" + else: + ans = ""AMBIGUOUS"" + print(ans) + + +if __name__ == ""__main__"": + main()" +p03042,s990526667,Wrong Answer,"s = input() +f, b = int(s[:2]), int(s[2:]) +if (f == 0 or b == 0): print(""NA"") +elif (f <= 12 and b <= 12): print(""AMBIGUOUS"") +elif (f > 12 and b > 12): print(""NA"") +elif (f > 12): print(""YYMM"") +elif(b > 12): print(""MMYY"") +" +p03042,s772204856,Wrong Answer,"s = input() + +if 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12: + print('AMBIGUOUS') +elif 0 < int(s[:2]) <= 12 and int(s[2:]) >= 12: + print('MMYY') +elif int(s[:2]) >= 12 > 0 and 0 < int(s[2:]) <= 12: + print('YYMM') +elif int(s[:2]) == 0 and 0 < int(s[2:]) <= 12: + print('YYMM') +else: + print('NA')" +p03042,s993080889,Wrong Answer,"s = list(input()) +a=int("""".join(s[0:2])) +b=int("""".join(s[2:4])) +print(""NA"" if a==0 or b==0 else + ""NA"" if a > 12 and b > 12 else + ""YYMM"" if a > 12 else + ""MMYY"" if b > 12 else + ""AMBIGUOUS"")" +p03042,s274711786,Wrong Answer,"s = list(input()) +a=int("""".join(s[0:2])) +b=int("""".join(s[2:4])) +print(""NA"" if a==0 or b==0 else + ""NA2"" if a > 12 and b > 12 else + ""YYMM"" if a > 12 else + ""MMYY"" if b > 12 else + ""AMBIGUOUS"")" +p03042,s441700142,Wrong Answer,"s=int(input()) +a=s//100 +b=s%100 +if a==0 or b==0: + print(""NA"") +elif a>=13 and b>=13: + print(""NA"") +elif a>=13 and b<=12: + print(""YYMM"") +elif a<=12 and b>=13: + print(""MMYY"") +else: + print(""AMBIGUOUS"")" +p03042,s665277158,Wrong Answer,"S = input() +a = int(S[0]+S[1]) +b = int(S[2]+S[3]) +if a > 12 and b >12: + print('NA') +if (a == 0 and b >12) or (b ==0 and a > 12) or (a==0 and b ==0): + print('NA') +elif a <= 12 and b <= 12: + print('AMBIGUOUS') +elif a <= 12 and b > 12: + print('MMYY') +elif a > 12 and b <= 12: + print('YYMM') +" +p03042,s207503300,Wrong Answer,"S = input() + +if int(S[:2]) > 13: + if int(S[2:]) > 13 or int(S[2:]) == 0: print('NA') + else: print('YYMM') +else: + if int(S[2:]) > 13: print('MMYY') + else: print('AMBIGUOUS') + " +p03042,s476031582,Wrong Answer,"s = input() +f, b = int(s[:2]), int(s[2:]) +if (f == 0 or b == 0): print(""NA"") +elif (f <= 12 and b <= 12): print(""AMBIGUOUS"") +elif (f > 12 and b > 12): print(""WA"") +elif (f > 12): print(""YYMM"") +elif(b > 12): print(""MMYY"")" +p03042,s875308133,Wrong Answer,"s = input() + +l = list(s) + +x = int(l[0]+l[1]) +y = int(l[2]+l[3]) + +if 0 < x < 13 and (y > 12 or y == 0): + print(""MMYY"") +elif (x > 12 or x == 0) and 0 < y < 13: + print(""YYMM"") +elif x > 12 or y > 12: + print(""NA"") +else: + print(""AMBIGUOUS"")" +p03042,s602992379,Wrong Answer,"S = list(input()) + +A = int(S[0]) + int(S[1]) +B = int(S[2]) + int(S[3]) + +if (1 <= A <= 12 and 1 <= B <= 12): + print(""AMBIGUOUS"") +elif (1 <= A <= 12 and 13 <= B <= 99): + print(""MMYY"") +elif (1 <= B <= 12 and 13 <= A <= 99): + print(""YYMM"") +else: + print(""NA"") + +" +p03042,s324240677,Wrong Answer,"s = input() + +a, b = int(s[:2]), int(s[2:]) +if 0 < a < 13 and 0 < b < 13: + print('AMBIGOUS') +elif 0 < a < 13: + print('MMYY') +elif 0 < b < 13: + print('YYMM') +else: + print(""NA"") +" +p03042,s272423841,Wrong Answer,"try: + s1=(input('')) + if len(s1)!=4: + raise ValueError + + check=list((s1)) + assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12) + if int(check[0]+check[1])<=12: + print(""MMYY"") + elif int(check[2]+check[3])<=12: + print(""YYMM"") +except AssertionError: + if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12: + print(""AMBIGUOUS"") + else: + print(""NA"") +except ValueError: + print(""More than four digits"") +" +p03042,s528200470,Wrong Answer,"def main(): + s = input() + a=s[:2] + b=s[2:] + if (a==""00"" or 12=13: + print('MMYY') +elif 1<=fs<=12 and 1<=ls<=12: + print('AMBIGUOUS') +elif fs>=13 and 1<=ls<=12: + print('YYMM') +else: + print('NO') +" +p03042,s855867281,Wrong Answer,"s = input() +head = int(s[0])*10 + int(s[1]) +back = int(s[2])*10 + int(s[3]) +if(1 <= head and head <= 12 and 1 <= back and back <= 12): + print('AMBIGUOUS') +elif(1 <= head and 1 <= back and back <= 12): + print('YYMM') +elif 1 <= back and 1 <= head and head <= 12: + print('MMYY') +else: + print('NA')" +p03042,s676217241,Wrong Answer,"a = input() +frm = int(a[:2]) +lat = int(a[2:]) + + +if frm >= 12 and lat >= 12: + print('NA') +elif frm <= 12 and lat > 12: + if 0 12 and lat <= 12: + if lat > 0: + print('YYMM') + else: + print('NA') +else: + print('AMBIGUOUS')" +p03042,s340798592,Wrong Answer,"def main(): + s=input() + s1=int(s[:2]) + s2=int(s[2:]) + yymm = 0 < s1 and 1 <= s2 <= 12 + mmyy = 1 <= s1 <= 12 and 0 < s2 + if yymm and mmyy: + print(""AMBIGUOUS"") + elif yymm: + print(""YYMM"") + elif mmyy: + print(""MMYY"") + else: + print(""NA"") + +if __name__ == ""__main__"": + main()" +p03042,s035961600,Wrong Answer,"S = input() +f,e = int(S[:2]),int(S[2:]) +if (f==0 and e>12) or (f>12 and e==0) or (f>12 and e>12): + print('NA') +if 1<=f<=12 and 1<=e<=12: + print('AMBIGUOUS') +if 1<=f<=12 and e>12: + print('MMYY') +if f>12 and 1<=e<=12: + print('YYMM') " +p03042,s707139462,Wrong Answer,"S=input() +x=int(S[:2]) +y=int(S[2:]) +if x*y==0: + print(""NA"") +elif 0=13: + if y<=12: + print(""YYMM"") + else: + print(""NA"")" +p03042,s342193387,Wrong Answer," +s = input() + +n1 = s[0:2] +n2 = s[2:4] + +if int(n1) > 12 and int(n2) > 12: + out_print = 'NA' + +elif int(n1) <= 12 and int(n2) <= 12: + out_print = 'AMBIGUOUS' + +elif int(n1) <= 12 and int(n2) >12: + out_print = 'MMYY' + if int(n1) == 0: + out_print = 'NA' +elif int(n1) > 12 and int(n2) <= 12: + out_print = 'YYMM' + print(n2) + if int(n2) == 0: + out_print = 'NA' + +print(out_print)" +p03042,s029982572,Wrong Answer,"s = input() +s1 = int(s[0]+s[1]) +s2 = int(s[2]+s[3]) +if s1 <= 12: + if s2 <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +elif s2 <= 12: + print('YYMM') +else: + print('NA') +" +p03042,s574447288,Wrong Answer,"S = list(input()) + +fo = int(''.join(S[:2])) +la = int(''.join(S[2:])) + +if fo==0 or la==0: + print(""NA"") +elif fo <= 12 and la <= 12: + print(""AMBIGUOUS"") +elif fo <= 12 and la > 12: + print(""MMYY"") +elif fo > 12 and la <= 12: + print(""YYMM"") +elif fo > 12 and la > 12: + print(""NA"") + +" +p03042,s777227721,Wrong Answer,"s = input() +t = int(s[:2]) +tt = int(s[2:]) +if t <= 12 and tt <= 12 and (t >= 1 or tt >= 1): + print(""AMBIGUOUS"") +elif t > 12 and tt <= 12 and tt >= 1: + print(""YYMM"") +elif t <= 12 and tt > 12 and t >= 1: + print(""MMYY"") +else: + print(""NA"")" +p03042,s162260072,Wrong Answer,"s=input() +a=int(s[:2]) +b=int(s[2:]) +if (a==0 or b==0) or (a>12 and b>12): + print(""NA"") +elif a<13 and b<13: + print(""AMBIGUOUS"") +elif a<13: + print(""MMYY"") +elif b<13: + print(""YYMM"")" +p03042,s895002545,Wrong Answer,"s = input() +sh = int(s[:2]) +se = int(s[2:]) +ans = ""YYMM"" if sh > 12 else (""MMYY"" if se > 12 else (""NA"" if (sh + se) == 0 else ""AMBIGUOUS"")) +if sh == 0 or se == 0: + ans = ""NA"" +print(ans)" +p03042,s905141579,Wrong Answer,"s = input() +a, b = int(s[:2]), int(s[2:]) +yymm, mmyy = 0, 0 + +if 1<=a<=12 and 1<=b<=12: + print('AMBIGUOUS') +elif a>12 and 1<=b<=12: + print('YYMM') +elif 1<=a<=12 and b>12: + print('MMYY') +else: + print('NA')" +p03042,s822270795,Wrong Answer,"S=str(input()) + +Ans=[int(S[0]+S[1]),int(S[2]+S[3])] + +if Ans[0]==0 or Ans[1]==0: + print(""NA"") +elif Ans[0]>12 or Ans[0]<1: + if Ans[1]>12 or Ans[1]<1: + print(""NA"") + else: + print(""YYMM"") +else: + if Ans[1]>12 or Ans[1]<1: + print(""MMYY"") + else: + print(""AMBIGUOS"") +" +p03042,s076897269,Wrong Answer,"S = str(input()) +front = int(S[:2]) +back = int(S[2:]) +S_list = list(S) + +if front > 12 or front == 0: + if 1 < back <= 12 : + print(""YYMM"") + else: + print(""NA"") +elif front <= 12 and front == 0: + if 1 < back <= 12: + print(""AMBIGUOUS"") + else: + print(""MMYY"")" +p03042,s899560182,Wrong Answer,"ym = int(input()) + +ym1 = int(ym/100) +ym2 = int(ym%100) + +print(ym1,ym2) + +if ym1 >= 1 and ym1 <= 12 and ym2 >= 1 and ym2 <=12: + print('AMBIGUOUS') +elif ym2>=1 and ym2<=12: + print('YYMM') +elif ym1>=1 and ym1<=12: + print('MMYY') +else: + print('NA') +" +p03042,s358966422,Wrong Answer,"#input +S = str(input()) + +#output +S1 = int(S[:2]) +S2 = int(S[2:]) + +if S1*S2 == 0: + print(""NA"") +elif 0 < S1 <= 12 and 0 < S2 <= 12: + print(""AMBIGUOUS"") +elif S1 > 12 and 0 < S2 <= 12: + print(""YYMM"") +elif 0 < S1 <= 12 and S2 > 12: + print(""MMYY"")" +p03042,s900349516,Wrong Answer,"def main(): + s = input() + first, second = int(s[:2]), int(s[2:]) + if 1 <= first <= 12: + if 1 <= second <= 12: + print(""AMBIGOUS"") + else: + print(""MMYY"") + elif 1 <= second <= 12: + if 1 <= first <= 12: + print(""AMBIGOUS"") + else: + print(""YYMM"") + else: + print(""NA"") + + +main()" +p03042,s297706227,Wrong Answer,"#126 b +def change(x): + if 1<=x<=12: + return 0 + else: + return 1 +ans=[""AMBIGOUS"",""NA"",""MMYY"",""YYMM""]#[00,11,01,10] +s=input() +a=change(int(s[:2])) +b=change(int(s[2:])) +if a==b: + print(ans[a]) +else: + print(ans[a+2])" +p03042,s013232443,Wrong Answer,"import sys +input = lambda: sys.stdin.readline().rstrip() + +S = input() + +f = int(S[:2]) +s = int(S[2:]) + +if (f <= 0 and s > 12) or (f > 12 and s <= 0): + print(""NA"") +elif f > 12 and s <= 12: + print(""YYMM"") +elif f <= 12 and s > 12: + print(""MMYY"") +elif f <= 12 and s <= 12: + print(""AMBIGUOUS"") " +p03042,s799137719,Wrong Answer,"from sys import stdin, setrecursionlimit + + +def main(): + input = stdin.buffer.readline + s = input()[:-1].decode() + l = int(s[:2]) + r = int(s[2:]) + if l >= 13 and 1 <= r <= 12: + print('YYMM') + elif 1 <= l <= 12 and r >= 13: + print('MMYY') + elif 1 <= l <= 12 and 1 <= r <= 12: + print('AMBIGUOUS') + else: + print('NA') + + +if __name__ == ""__main__"": + setrecursionlimit(10000) + main() +" +p03042,s098576493,Wrong Answer,"s = input() +if 0 < int(s[:2]) and int(s[2:]) < 13: + print(""AMBIGUOUS"") +elif 0 < int(s[:2]) < 13 and int(s[2:]) != 0: + print(""MMYY"") +elif 0 < int(s[2:]) < 13 and int(s[:2]) != 0: + print(""YYMM"") +else: + print(""NA"")" +p03042,s408574638,Wrong Answer,"#k = int(input()) +#s = input() +#a, b = map(int, input().split()) +#s, t = map(str, input().split()) +#l = list(map(int, input().split())) +#l = [list(map(int,input().split())) for i in range(n)] + +s = input() + +temp1 = int(s[0:2]) +temp2 = int(s[2:4]) + +if temp1 >= 1 and temp1 <= 12: + if (temp2 < 1 or temp2 > 12): + print(""MMYY"") + else: + print(""AMBIGUOUS"") +else: + if (temp2 >= 1 and temp2 < 12): + print(""YYMM"") + else: + print(""NA"") +" +p03042,s599141117,Wrong Answer,"def resolve(): + S = list(input()) + + front = int(''.join(S[:2])) + back = int(''.join(S[2:])) + + if (0 == front and 12 < back) or (0 == back and 12 < front): + print('NA') + return + + if (front <= 12 and back <= 12): + print('AMBIGUOUS') + return + + if (front > 12 and back <= 12): + print('YYMM') + return + + if (front <= 12 and back > 12): + print('MMYY') + return + + print('NA') + +resolve()" +p03042,s603694055,Wrong Answer,"s = int(input()) +f = s/100 +l = s%100 +if 1 <= f and f <= 12: + if 1 <= l and l <= 12: + print('AMBIGUOUS') + else: + print('MMYY') +else: + if 1 <= l and l <= 12: + print('AMBIGUOUS') + else: + print('NA')" +p03042,s558176452,Wrong Answer,"S = input() + +s1 = int(S[0] + S[1]) +s2 = int(S[2] + S[3]) + +if s1 > 12: #YY + if s2 > 12 or s2 == 0: + print('NA') + else: + print('YYMM') +elif s2 > 12: #YY + if s1 > 12: + print('NA') + else: + print('MMYY') +else: + print('AMBIGUOUS')" +p03042,s467486498,Wrong Answer,"S = input() +a = 0 +b = 0 +if (S[0] == '0' and S[1] != '0') or (S[0] == '1' and (S[1] == '1' or S[1] == '2')): + a = 1 +if (S[2] == '0' and S[1] != '0') or (S[2] == '1' and (S[3] == '1' or S[3] == '2')): + b = 1 +if a == 1 and b == 1: + print(""AMBIGUOUS"") +elif a == 1: + print(""MMYY"") +elif b == 1: + print(""YYMM"") +else: + print(""NA"")" +p03042,s399048510,Wrong Answer,"def solve(): + S = input() + l = int(S[:2]) + r = int(S[2:]) + + if l == 0 or r == 0: + return 'NA' + + if 12 < l <= 20 and r <= 12: + return 'YYMM' + elif l <= 12 and 12 < r <= 20: + return 'MMYY' + elif l <= 12 and r <= 12: + return 'AMBIGUOUS' + else: + return 'NA' + +print(solve())" +p03042,s193797772,Wrong Answer,"S = input() +S1 = int(S[:2]) +S2 = int(S[2:]) + +if S1 == 0 or S2 == 0: + print('NA') +elif S1 > 13 and S2 < 13: + print('YYMM') +elif S1 < 13 and S2 > 13: + print('MMYY') +else: + print('AMBIGUOUS')" +p03042,s401620396,Wrong Answer,"S = input() +s1,s2 = int(S[0:2]),int(S[2:4]) + +def f(s1): + if s1 >= 1 and s1 <= 12: + return True + else: + return False + +if f(s1) and f(s2): + print(""AMBIGUOUS"") +elif f(s1) and s2 > 12: + print(""MMYY"") +elif f(s2) and s1 > 12: + print(""YYMM"") +else: + print(""NA"")" +p03042,s518428460,Wrong Answer,"s = input() +s1 = int(s[:2]) +s2 = int(s[2:]) +if((s1 <= 99)and(s1 != 0))and((s2 <= 12)and(s2 != 0)): + if(((s1 <= 12)and(s1 != 0))and((s2 <= 99)and(s2 != 0))): + print(""AMBIGUOUS"") + else: + print(""YYMM"") +elif(((s1 <= 12)and(s1 != 0))and((s2 <= 99)and(s2 != 0))): + if((s1 <= 99)and(s1 != 0))and((s2 <= 12)and(s2 != 0)): + print(""AMBIGUOUS"") + else: + print(""MMYY"") +else: + print(""NA"")" +p03042,s824366764,Wrong Answer,"S = input() +YYMM = 0 +MMYY = 0 +start = S[0:2] +end = S[2:4] +tmp1 = int(start) +tmp2 = int(end) +print(tmp1,tmp2) +if(tmp2 <= 12 and tmp2 != 0): + YYMM = 1 +if(tmp1 <= 12 and tmp1 != 0): + MMYY = 1 +if(YYMM == 1 and MMYY == 1): + print(""AMBIGUOUS"") +elif(YYMM == 1): + print(""YYMM"") +elif(MMYY == 1): + print(""MMYY"") +else: + print(""NA"")" +p03042,s615342065,Wrong Answer,"s=input() +f=int(s[:2]) +b=int(s[2:4]) + +if (f>=13 or f==00)and b>=13 : + print('NA') +elif (f>=13 or f==00)and 1<=b<=12 : + print('YYMM') +elif 1<=f<=12 and (b>=13 or b==00) : + print('MMYY') +else: + print('AMBIGUOUS') " +p03042,s978716629,Wrong Answer,"s = input() +a = int(s[:2]) +b = int(s[2:]) + +if a > 12 and b > 12: + print(""NA"") +elif a > 12 or b > 12: + if a <= 12: + print(""MMYY"") + else: + print(""YYMM"") +else: + print(""AMBIGUOUS"")" +p03042,s804153887,Wrong Answer,"S=input() +A=int(S[0:2]) +B=int(S[2:4]) +if 1<=A<=12: + if 1<=B<=12: + ans=""AMBIGUOUS"" + elif 12<=B: + ans=""MMYY"" + else: + ans=""NA"" +elif 12<=A: + if 1<=B<=12: + ans=""YYMM"" + else: + ans=""NA"" +else: + ans=""NA"" +print(ans)" +p03042,s669771089,Wrong Answer,"s = str(input()) +A = int(s[0:2]); B = int(s[2:4]) +if 1 <= A <= 12 and 0 <= B <= 12: + print(""AMBIGUOUS"") +elif 1 <= A <= 12 and 0 <= B <= 99: + print(""MMYY"") +elif 1 <= B <= 12 and 0 <= A <= 99: + print(""YYMM"") +else: + print(""NA"")" +p03042,s500032397,Wrong Answer,"n=int(input()) +a2=n%100 +a1=n//100 + +if 00: + print(""AMBIGUOUS"") +elif a1<=12 and a2>0: + print(""YYMM"") + +elif a1<=12 and a1>0: + print(""MMYY"") + +else: + print(""NA"") +" +p03042,s772430132,Wrong Answer,"S = input() +F = int(S[:2]) +L = int(S[2:]) + +if (F >= 13 and L >= 13) or (F == 0) or (L == 0): + print('NA') +elif F >= 13: + print('YYMM') +elif L >= 13: + print('MMYY') +else: + print('AMBIGUOUS')" +p03042,s599523218,Wrong Answer,"num = input() +if int(num[:2]) > 12 or int(num[2:])==0: + if int(num[2:]) > 12 or int(num[2:])== 0: + print('NA') + else: + print('YYMM') +else: + if int(num[2:]) > 12 or int(num[2:])== 0: + print('MMYY') + else: + print('AMBIGUOUS')" +p03723,s700830100,Accepted,"a, b, c = map(int, input().split()) + +ans = 0 + +while True: + if ans > 999999: + print(-1) + break + elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(ans) + break + a, b, c = (b+c) // 2, (a+c) // 2, (a+b) // 2 + ans += 1 +" +p03723,s985360867,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 +while a%2==0 and b%2==0 and c%2==0: + if a==b==c: + print(-1) + exit() + a, b, c = b//2+c//2, a//2+c//2, a//2+b//2 + cnt += 1 +print(cnt)" +p03723,s832897909,Accepted,"A, B, C = list(map(int, input().split())) +cookies = set() +cookies.add((A, B, C)) + +a = A +b = B +c = C + +count = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + count += 1 + a = a // 2 + b = b // 2 + c = c // 2 + + a2 = b + c + b2 = a + c + c2 = b + c + if (a2, b2, c2) in cookies: + count = -1 + break + a = a2 + b = b2 + c = c2 + cookies.add((a, b, c)) +print(count)" +p03723,s784378897,Accepted,"A,B,C = map(int, input().split()) +n = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B == C: + print ('-1') + exit() + else: + a = B/2 + C/2 + b = A/2 + C/2 + c = A/2 + B/2 + A = a + B = b + C = c + n += 1 + + +print(n)" +p03723,s542280541,Accepted,"a, b, c = map(int, input().split()) + +if a == b == c and a % 2 == 0: + print(-1) +else: + cnt = 0 + for _ in range(10**5): + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(cnt) + break + else: + a, b, c = (b + c) / 2, (c + a) / 2, (a + b) / 2 + cnt += 1" +p03723,s124899924,Accepted,"A, B, C = map(int, input().split()) +if A == B == C: + print(0 if A%2 else -1) +else: + cnt = 0 + while A%2==0 and B%2==0 and C%2==0: + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + cnt += 1 + print(cnt) +" +p03723,s934396907,Accepted,"a, b, c = map(int, input().split()) + +i = 0 +while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(i) + break + elif a == b == c: + print(-1) + break + a_h = a / 2 + b_h = b / 2 + c_h = c / 2 + a = b_h + c_h + b = a_h + c_h + c = a_h + b_h + i += 1" +p03723,s871837411,Accepted,"A,B,C = map(int, input().split()) + +ans = 0 +for _ in range(10**6): + if A%2 == 1 or B%2 == 1 or C%2 == 1: + break + a = (B+C)//2 + b = (C+A)//2 + c = (A+B)//2 + A = a + B = b + C = c + ans += 1 + +if ans == 10**6: + ans = -1 +print(ans)" +p03723,s229218485,Accepted,"a,b,c=list(map(int,input().split())) +n=0 +H=[] +while True: + S=[a,b,c] + if S in H: + print(""-1"") + exit() + H.append(S) + if a%2!=0 or b%2!=0 or c%2!=0: + print(n) + exit() + else: + A=a/2 + B=b/2 + C=c/2 + a=int(B+C) + b=int(A+C) + c=int(A+B) + n+=1" +p03723,s473448490,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() +if a == b and b == c: + print(-1) + exit() +while cnt >= 0: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(cnt) + exit() + else: + a1 = (b + c) // 2 + b1 = (a + c) // 2 + c1 = (a + b) // 2 + a = a1 + b = b1 + c = c1 + cnt += 1 +print(cnt)" +p03723,s168785555,Accepted,"*a,=map(int,input().split()) +b=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)] +print((max(b) if b[0]*b[1]<0 else min(b))*(1-sum(a)%2))" +p03723,s914293707,Accepted,"A, B, C = map(int, input().split()) +res = 0 +while True: + if A%2 + B%2 + C%2 > 0: + break + A, B, C = B//2 + C//2, C//2 + A//2, A//2 + B//2 + if A == B and B == C: + res = -1 + break + res += 1 +print(res) +" +p03723,s401406443,Accepted,"#!/usr/bin/env python3 + +import sys +sys.setrecursionlimit(10**6) + +def solve(a,b,c,counter=0): + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + return counter + elif a == b == c: + return -1 + else: + return solve((b+c)//2,(c+a)//2,(a+b)//2,counter+1) + + +def main(): + A, B, C = map(int,input().split()) + print(solve(A,B,C)) + +if __name__ == '__main__': + main() +" +p03723,s479070897,Accepted,"a,b,c = map(int,input().split()) + +count=0 +while a%2==0 and b%2==0 and c%2==0: + if (b/2+c/2)==(a/2+c/2)==(a/2+b/2): + count=-1 + break + a,b,c = b/2+c/2,a/2+c/2,a/2+b/2 + count+=1 +print(count) +" +p03723,s537189239,Accepted,"a, b, c = map(int, input().split()) + +flag = 0 +ans = 0 + +if a == b == c and a%2 == 0: + ans = -1 + +else: + while flag == 0: + if a%2 == 0 and b%2 == 0 and c%2 == 0: + a_tmp = (b+c)/2 + b_tmp = (a+c)/2 + c_tmp = (a+b)/2 + + a = a_tmp + b = b_tmp + c = c_tmp + + ans += 1 + + else: + flag = 1 + +print(ans)" +p03723,s663340003,Accepted,"def exchg(a, b, c): + count = 0 + if (a == b == c) and ((a & 1) == 0 and (b & 1) == 0 and (c & 1) == 0): + return -1 + while((a & 1) == 0 and (b & 1) == 0 and (c & 1) == 0): + a, b, c = (a+b)//2, (b+c)//2, (c+a)//2 + # print(a, b, c) + count += 1 + return count +a, b, c = map(int, input().split()) +print(exchg(a, b, c))" +p03723,s990585350,Accepted,"a, b, c = map(int, input().split()) +if a == b and b == c: + if a % 2 == 0: + print(-1) + else: + print(0) +else: + count = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2 + count += 1 + print(count)" +p03723,s595005738,Accepted,"a, b, c = map(int, input().split()) +t = 0 + +if a == b == c: + if a % 2 == 1: + print(t) + else: + print(-1) + +else: + while (a % 2 + b % 2 + c % 2) == 0: + a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2 + t += 1 + + print(t)" +p03723,s125977353,Accepted,"A, B, C = map(int, input().split()) + +if A == B == C and A%2 == B%2 == C%2 == 0: + print(-1) +else: + ans = 0 + while A%2 == B%2 == C%2 == 0: + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + ans += 1 + print(ans) +" +p03723,s927439877,Accepted,"import sys +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +def f(a, b, c): + if (a%2 != 0) | (b%2 != 0) | (c%2 != 0): + return 0 + if (a == b) & (b == c): + return -1 + return f((b+c)//2, (a+c)//2, (a+b)//2) + 1 +def main(): + a, b, c = map(int, readline().split()) + print(f(a, b, c)) +if __name__ == '__main__': + main() +" +p03723,s030443583,Accepted,"import sys +a, b, c = map(int, input().split()) +var = 0 +for i in range(1000): + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(var) + sys.exit() + a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2 + var += 1 +print(-1)" +p03723,s517258017,Accepted,"A,B,C= map(int, input().split()) +cot = 0 +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + else: + tempA = (B + C)//2 + tempB = (A + C)//2 + tempC = (B + A)//2 + A = tempA + B = tempB + C = tempC + cot += 1 + + if cot > 1000000: + print(-1) + exit(0) + +print(cot)" +p03723,s172400523,Accepted,"cnt=0 +a,s,d=map(int,input().split()) +if a==s==d: + if a%2==0:print(-1) + else:print(0) + exit() +while a%2==s%2==d%2==0: + a,s,d=(s+d)//2,(a+d)//2,(a+s)//2 + cnt+=1 +print(cnt)" +p03723,s497702484,Accepted,"A, B, C = map(int, input().split()) +if A % 2 == 0 and A == B and B == C: + print(-1) + exit() + +count = 0 +while (A % 2, B % 2, C % 2) == (0, 0, 0): + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + count += 1 + +print(count) +" +p03723,s825917279,Accepted,"a, b, c = map(int, input().split()) +if a == b == c: + ans = 0 +else: + ans = 1 << 31 + for x in [a - b, b - c, c - a]: + if x != 0: + tmp = 0 + while x % 2 == 0: + tmp += 1 + x >>= 1 + ans = min(tmp, ans) + +if a == b == c and b % 2 == 0: + print(-1) +else: + print(ans)" +p03723,s197241736,Accepted,"A, B, C = map(int, input().split()) + +if any(map(lambda x: x % 2 == 1, (A, B, C))): + print(0) +elif A == B == C: + print(-1) +else: + count = 0 + while True: + A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2 + count += 1 + if any(map(lambda x: x % 2 == 1, (A, B, C))): + break + print(count) +" +p03723,s679806443,Accepted,"a, b, c = map(int, input().split()) +res = 0 +if a == b and a == c and a % 2 == 0: + print(-1) +else: + while 10 > 0: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + a1 = a//2 + b1 = b//2 + c1 = c//2 + a = b1+c1 + b = a1+c1 + c = a1+b1 + res += 1 + print(res) +" +p03723,s918778548,Accepted,"def is_no_odd(x, y, z): + return x % 2 == 0 and y % 2 == 0 and z % 2 == 0 + + +def exchange(x, y, z): + new_x = y / 2 + z / 2 + new_y = x / 2 + z / 2 + new_z = x / 2 + y / 2 + return new_x, new_y, new_z + + +a, b, c = map(int, input().split()) +cnt = 0 + +while is_no_odd(a, b, c): + if a == b == c: + cnt = -1 + break + + a, b, c = exchange(a, b, c) + cnt += 1 + +print(cnt) +" +p03723,s052950686,Accepted,"a,b,c = tuple(map(int,input().split())) + +ans = 0 +while True: + if len(set((a,b,c)))==1: + if a%2==1: + print(0) + exit() + print(-1) + exit() + if a%2==0 and b%2==0 and c%2==0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + else: + break +print(ans)" +p03723,s150785189,Accepted,"a,b,c=map(int,input().split()) +count=0 +if a==b==c and a%2==0: + print(-1) + exit() +while a%2==0 and b%2==0 and c%2==0: + A=a//2 + B=b//2 + C=c//2 + a=B+C + b=C+A + c=A+B + count+=1 +print(count)" +p03723,s533825730,Accepted,"def main(): + a, b, c = map(int, input().split()) + if a == b and b == c: + print(-1 if a % 2 == 0 else 0) + return + cnt = 0 + for i in range(10 ** 9): + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + cnt += 1 + print(cnt) + + +if __name__ == '__main__': + main() +" +p03723,s324064148,Accepted,"A, B, C = [int(i) for i in input().split()] +t, a, s = [A, B, C] +ans = 0 + + +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B == C: + ans = -1 + break + t = B / 2 + C / 2 + a = A / 2 + C / 2 + s = A / 2 + B / 2 + A = t + B = a + C = s + ans += 1 + +print(ans)" +p03723,s437619390,Accepted,"a = list(map(int,input().split())) +cna = cnb = 0 +a.sort() +x = a[2]-a[1] +y = a[1]-a[0] +if a[0]*a[1]*a[2]%2 != 0: + print(0) + exit() +while True: + if x%2 == 0 and x != 0: + cna += 1 + x //= 2 + else: + break +while True: + if y%2 == 0 and y != 0: + cnb += 1 + y //= 2 + else: + break +if cna == 0 and cnb == 0: + print(-1) +else: + print(min(cna,cnb))" +p03723,s165592092,Accepted,"a,b,c = map(int,input().split()) + +if (a%2!=0) or (b%2!=0) or (c%2!=0): + print(0) +elif (a == b ) and (b == c): + print(-1) +else: + def exchange(a,b,c): + return (b+c)/2,(c+a)/2,(a+b)/2 + num = 0 + ans = 0 + while num == 0: + a,b,c = exchange(a,b,c) + ans += 1 + for j in range(3): + if [a,b,c][j] % 2 ==1: + num = 1 + print(ans)" +p03723,s625091782,Accepted,"A, B, C = map(int, input().split()) +S = A+B+C + +k = 0 +flag = 0 +while k<100: + if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1: + flag = 1 + break + An = (B + C)//2 + Bn = (A + C)//2 + Cn = (B + A)//2 + A = An + B = Bn + C = Cn + k += 1 + +if not flag: + k = -1 + +print(k)" +p03723,s935527698,Accepted,"A,B,C=map(int,input().split()) +ans=0 + +if A%2!=0 or B%2!=0 or C%2!=0: + pass +elif A==B and B==C: + ans=-1 +else: + while True: + if A%2!=0 or B%2!=0 or C%2!=0: + break + + A,B,C=B/2+C/2,A/2+C/2,A/2+B/2 + ans+=1 + +print(ans)" +p03723,s045303917,Accepted,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0 and b%2==0 and c%2==0: + print(-1) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + A=a + B=b + C=c + a=B//2+C//2 + b=A//2+C//2 + c=B//2+A//2 + ans+=1 + if a==b==c: + ans=-1 + break + print(ans)" +p03723,s763898111,Accepted,"def func(A, B, C): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + return 0 + if A == B and B == C: + return -1 + return func((B+C)//2, (C+A)//2, (A+B)//2) + 1 + + +A, B, C = map(int, input().split()) + +ans = func(A, B, C) + +print(ans)" +p03723,s144090670,Accepted,"# 適当に10**5ぐらい回して無限に続けられたら-1でよくね? +A, B, C = map(int, input().split()) + + +def update(A, B, C): + return B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2 + + +for i in range(10 ** 5): + if A & 1 or B & 1 or C & 1: + print(i) + exit() + A, B, C = update(A, B, C) + +print(-1) +" +p03723,s841258475,Accepted,"A,B,C=map(int,input().split()) + +cnt=0 +lp=0 +ls=set() +a=A +b=B +c=C +ls.add((a,b,c)) +while not(a%2==1 or b%2==1 or c%2==1 or lp==1): + a=int((A+B+C-a)/2) + b=int((A+B+C-b)/2) + c=int((A+B+C-c)/2) + cnt+=1 + if ((a,b,c) in ls): + lp=1 +if lp==1: + print(-1) +else: + print(cnt)" +p03723,s290516311,Accepted,"import sys + +rr = lambda: sys.stdin.readline().rstrip() +rs = lambda: sys.stdin.readline().split() +ri = lambda: int(sys.stdin.readline()) +rm = lambda: map(int, sys.stdin.readline().split()) +rl = lambda: list(map(int, sys.stdin.readline().split())) + + +a, b, c = rm() +if a == b == c: + if a & 1: + print(0) + else: + print(-1) + exit() +cnt = 0 +while a & 1 == 0 and b & 1 == 0 and c & 1 == 0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 +print(cnt) + + + +" +p03723,s524831120,Accepted,"a,b,c = list(map(int, input().strip().split())) +f=0 +if a%2==1 or b%2==1 or c%2==1: + print(f) +elif a==b and b==c: + f=-1 + print(f) +else: + while a%2==0 and b%2==0 and c%2==0: + A=a + B=b + C=c + a=B//2+C//2 + b=A//2+C//2 + c=A//2+B//2 + f=f+1 + else: + print(f) + " +p03723,s459361288,Accepted,"a,b,c=map(int,input().split());o=0 +if a==b==c:print(a%2-1);exit() +while~-a*~-b*~-c%2:a,b,c=(b+c)//2,(c+a)//2,(a+b)//2;o+=1 +print(o)" +p03723,s603751223,Accepted,"a,b,c = map(int,input().split()) +if a % 2 == 0 and a == b == c: + print(-1) +else: + ans = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + ab,bc,ac = a//2+b//2,b//2+c//2,a//2+c//2 + a,b,c = bc,ac,ab + ans += 1 + print(ans)" +p03723,s650814152,Accepted,"import sys +input=sys.stdin.buffer.readline +A,B,C = map(int,input().split()) + +def F(A,B,C): + if any(x&1 for x in [A,B,C]): + return 0 + if A == B == C: + return -1 + return 1 + F((A+B)//2,(B+C)//2,(C+A)//2) + +answer = F(A,B,C) +print(answer)" +p03723,s861877212,Accepted,"a, b, c = map(int, input().split()) +count=0 +while a%2==0 and b%2==0 and c%2==0: + ah=a//2 + bh=b//2 + ch=c//2 + a=bh+ch + b=ch+ah + c=ah+bh + if a==b and a==c and a%2==0: + count=-1 + break + else: + count+=1 +print(count)" +p03723,s498680692,Accepted,"A, B, C = map(int, input().split()) + +cnt = 0 + +last = [A, B, C] + +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + a = A // 2 + b = B // 2 + c = C // 2 + cnt += 1 + A = b + c + B = a + c + C = a + b + if A in last and B in last and C in last: + print(-1) + exit() + + last = [A, B, C] + +print(cnt) + +" +p03723,s647369606,Accepted,"a,b,c = map(int,input().split()) +count = 0 +while(True): + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + a0 = a + b0 = b + c0 = c + a = (b0+c0)/2 + b = (c0+a0)/2 + c = (a0+b0)/2 + count += 1 + if a0 == a and b0 == b and c0 == c: + count = -1 + break +print(count)" +p03723,s761472728,Accepted,"l = list(map(int, input().split())) +ans = 0 +while( l[0]%2==0 and l[1]%2==0 and l[2]%2==0): + if l[0]==l[1]and l[1]==l[2]: + ans = -1 + break + else: + a = l[0] + b = l[1] + c = l[2] + l[0]=(b+c)/2 + l[1]=(a+c)/2 + l[2]=(a+b)/2 + ans+=1 +print(ans)" +p03723,s497578326,Accepted,"def main(): + A,B,C=map(int,input().split()) + ans=0 + tmp=set() + while A%2==0 and B%2==0 and C%2==0: + A,B,C=(B+C)//2,(C+A)//2,(A+B)//2 + if (A,B,C) in tmp: + print(-1) + exit() + else: + tmp.add((A,B,C)) + ans += 1 + print(ans) + +main()" +p03723,s655756283,Accepted,"a,b,c = map(int, input().split()) +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) +else: + for i in range(10**6): + temp1 = a + temp2 = b + temp3 = c + a = int((temp2+temp3)/2) + b = int((temp1+temp3)/2) + c = int((temp1+temp2)/2) + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + break + if i == 10**6 - 1: + print(-1) + else: + print(i+1)" +p03723,s744524969,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 +while(1): + if A%2!=0 or B%2!=0 or C%2!=0: + break + A_tmp = A + B_tmp = B + C_tmp = C + A = (B_tmp+C_tmp)/2 + B = (A_tmp+C_tmp)/2 + C = (A_tmp+C_tmp)/2 + cnt += 1 + if A_tmp==A and B_tmp==B and C_tmp==C: + cnt = -1 + break +print(cnt)" +p03723,s792307086,Accepted,"a,b,c=map(int,input().split()) +cnt=0 +if any((a%2==1,b%2==1,c%2==1)): + print(0) + exit() +if a==b==c and a%2==0: + print(-1) + exit() +while a%2==b%2==c%2==0: + a,b,c=(b+c)/2,(a+c)/2,(a+b)/2 + cnt+=1 +print(cnt) +" +p03723,s911228472,Accepted,"a,b,c= map(int,input().split()) +cnt = 0 +if a == b and b == c: + if a%2 == 0 and b%2 == 0 and c%2 == 0: + print(-1) + exit() + else: + print(0) + exit() +while a%2 == 0 and b%2 == 0 and c%2 == 0: + cnt +=1 + x =(b+c)//2 + y =(c+a)//2 + z =(b+a)//2 + a = x + b = y + c = z +print(cnt)" +p03723,s716399459,Accepted,"A,B,C = map(int, input().split()) + +ans = 0 +for ans in range(1000): + if A&1 or B&1 or C&1: + print(ans) + break + A,B,C = (B+C)//2, (C+A)//2, (A+B)//2 +else: + print(-1)" +p03723,s594228762,Accepted,"a ,b ,c = map(int,input().split()) +if a == b == c and a % 2 == 0: + ans = -1 +else: + ans = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + na = a + nb = b + nc = c + a = (nb + nc)//2 + b = (na + nc)//2 + c = (na + nb)//2 + ans += 1 +print(ans)" +p03723,s882656871,Accepted,"import sys + +a, b, c = map(int,input().split()) + +a1 = a +b1 = b +c1 = c +cnt = 0 +while (a1%2 ==0) and (b1%2 == 0) and (c1%2 == 0): + a1,b1,c1 = b1//2 + c1//2, c1//2 + a1//2, a1//2 + b1//2 + cnt += 1 + if (a1 == a) and (b1 == b) and (c1 == c): + print(-1) + sys.exit() + +print(cnt) +" +p03723,s207157050,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A,B,C = B//2+C//2, A//2+C//2, A//2+B//2 + cnt += 1 + if cnt >= 10 * 7: + print(-1) + break +else: + print(cnt) +" +p03723,s217923622,Accepted,"a, b, c = [int(i) for i in input().split()] + +cnt = 0 +history = set() +while True: + if (a, b, c) in history: + print(-1) + exit(0) + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(cnt) + exit(0) + a, b, c = sorted([a, b, c]) + history.add((a, b, c)) + na = b // 2 + c // 2 + nb = a // 2 + c // 2 + nc = a // 2 + b // 2 + a = na + b = nb + c = nc + cnt += 1" +p03723,s525021141,Accepted,"import sys +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +read = sys.stdin.buffer.read +sys.setrecursionlimit(10 ** 7) + +A, B, C = map(int, readline().split()) + +if A == B and B == C and A % 2 == 0: + print(-1) + exit() + +ans = 0 +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + half_A = A // 2 + half_B = B // 2 + half_C = C // 2 + + A = half_B + half_C + B = half_A + half_C + C = half_A + half_B + ans += 1 + +print(ans)" +p03723,s195013347,Accepted,"def resolve(): + ''' + code here + ''' + A, B, C = [int(item) for item in input().split()] + cnt = 0 + + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = B//2 + C//2, A//2 + C//2, A//2 + B//2 + cnt += 1 + + if A==B==C: + cnt = -1 + break + + print(cnt) + + +if __name__ == ""__main__"": + resolve() +" +p03723,s232533180,Accepted,"a,b,c = map(int,input().split()) +if a %2 == 1 or b %2 == 1 or c %2 == 1: + print(0) +elif a == b and b == c and c == a: + print(-1) +else: + cnt = 0 + while(True): + cnt += 1 + ta = b//2 + c //2 + tb = a//2 + c //2 + tc = a//2 + b //2 + if ta %2 == 1 or tb %2 == 1 or tc %2 == 1: + break + a,b,c = ta,tb,tc + print(cnt) +" +p03723,s167950020,Accepted,"a, b, c = map(int, input().split()) + + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit(0) +if a == b == c and a % 2 == 0: + print(-1) + exit(0) + +counter = 0 +while True: + counter += 1 + w_a = a / 2 + w_b = b / 2 + w_c = c / 2 + + a = w_b + w_c + b = w_a + w_c + c = w_b + w_a + + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(counter) + exit(0) +" +p03723,s475455719,Accepted,"# -*- coding: utf-8 -*- + +a,b,c=map(int,input().split()) + +ans=0 +while True: + if a%2==1 or b%2==1 or c%2==1: + break + if a==b==c: + ans=-1 + break + ans+=1 + na=(b+c)/2 + nb=(c+a)/2 + nc=(a+b)/2 + a=na + b=nb + c=nc +print(ans) +" +p03723,s625011737,Accepted,"a, b, c = map(int, input().split()) +ans = 0 +if a == b == c and a % 2 == 0: + print(-1) +else: + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + total = a + b + c + a = (total - a) / 2 + b = (total - b) / 2 + c = (total - c) / 2 + ans += 1 + print(ans)" +p03723,s549055589,Accepted,"a, b, c = map(int, input().split()) + +ans = 0 +for i in range(10000): + if (a + 1) * (b + 1) * (c + 1) % 2 == 0: + print(ans) + break + if a == b == c: + print(-1) + break + ans += 1 + a, b, c = a // 2, b // 2, c // 2 + a, b, c = b + c, a + c, b + c + +" +p03723,s994113622,Accepted,"l = list(map(int,input().split())) +ans = 0 +if l[0] == l[1] == l[2] and all(i % 2 == 0 for i in l): + print(-1) + exit() +while all(i % 2 == 0 for i in l): + a = l[0]//2; b = l[1]//2; c = l[2]//2; + l[0] = b + c + l[1] = a + c + l[2] = a + b + ans += 1 +print(ans)" +p03723,s031470468,Accepted,"a,b,c = map(int,input().split(' ')) +ans = 0 +if a % 2 == 0 and a == b and a == c: + ans = -1 +elif (a+1)*(b+1)*(c+1)%2 == 0: + ans = 0 +else: + A = [a,b,c] + A.sort() + a1 = A[2]-A[1] + a2 = A[1]-A[0] + ans = 0 + while a1%2 == 0 and a2%2 == 0: + ans += 1 + a1 /= 2 + a2 /= 2 +print(ans)" +p03723,s407458751,Accepted,"#!/usr/bin/env python + +a, b, c = map(int, input().split()) + +if a%2 == 0 and a == b == c: + print(-1) + exit() + +ans = 0 +while True: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(ans) + exit() + ta = a + tb = b + tc = c + a = (tb+tc)//2 + b = (tc+ta)//2 + c = (ta+tb)//2 + ans += 1 +" +p03723,s215386586,Accepted,"a,b,c = map(int, input().split()) +original = [a,b,c] +flag = 0 +i = 0 +while a%2 == b%2 == c%2 == 0: + a_ = (b+c)//2 + b_ = (c+a)//2 + c_ = (a+b)//2 + a = a_ + b = b_ + c = c_ + if [a,b,c] == original: + flag = 1 + break + i += 1 +if flag: + print(-1) +else: + print(i) +" +p03723,s399911746,Accepted,"A,B,C=map(int,input().split()) +count=0 +if A==B==C and A%2==0: + print(-1) + exit() +while A%2==0 and B%2==0 and C%2==0: + A,B,C=B//2+C//2,A//2+C//2,B//2+C//2 + count+=1 +print(count) +" +p03723,s311386702,Accepted,"import sys +sys.setrecursionlimit(10**9) + +a,b,c = map(int,input().split()) + +if a%2==0 and b%2==0 and c%2==0 and (a == b == c): + print(-1) + sys.exit() +cnt = 0 +while True: + if a%2==1 or b%2==1 or c%2==1: + break + a,b,c = (b+c)//2,(a+c)//2,(b+c)//2 + cnt += 1 + +print(cnt)" +p03723,s223056573,Accepted,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print((e!=0|b%2)*(e^~-e).bit_length()-1)" +p03723,s369958270,Accepted,"A,B,C = list(map(int,input().split())) +if A == B == C and A%2 == 0 : + print(-1) +elif A == B == C and A%2 == 1 : + print(0) +else : + cnt=0 + while A%2==B%2==C%2==0: + total=A+B+C + A=total//2-A//2 + B=total//2-B//2 + C=total//2-C//2 + cnt+=1 + print(cnt) +" +p03723,s736799441,Accepted,"a, b, c = map(int, input().split()) + +cnt = 0 +while True: + # print(a, b, c) + x, y, z = a, b, c + + if x % 2 == 1 or y % 2 == 1 or z % 2 == 1: + break + + if x == y and y == z and z == x: + cnt = -1 + break + + x, y, z = a/2, b/2, c/2 + a, b, c = y+z, z+x, x+y + cnt += 1 +print(cnt) +" +p03723,s781207186,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +if a == b == c: + print(-1) + exit() + +cnt = 0 +while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + +print(cnt)" +p03723,s108995735,Accepted,"a, b, c=map(int, input().split()) +if a==b and b==c: + if a%2==1: + print(0) + else: + print(-1) +else: + cnt=0 + while(1): + if a%2==1 or b%2==1 or c%2==1: + print(cnt) + break + cnt+=1 + ha=a/2 + hb=b/2 + hc=c/2 + a=hb+hc + b=ha+hc + c=ha+hb" +p03723,s487079370,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +for i in range(10000001): + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + if i == 1000000: + print(-1) + exit() + m = a + n = b + l = c + a = (b+c)//2 + b = (c+m)//2 + c = (m+n)//2 + ans += 1 +print(ans)" +p03723,s917241061,Accepted,"A, B, C = map(int, input().split()) +count = 0 + +while A%2 == 0 and B%2 == 0 and C%2 == 0: + if A == B and B == C: + print(-1) + exit() + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + count += 1 +print(count) + +" +p03723,s914819827,Accepted,"a,b,c=map(int,input().split()) + +ans = 0 + +while a%2 == b%2 == c%2 == 0: + ans += 1 + newa=b//2+c//2 + newb=a//2+c//2 + newc=a//2+b//2 + a=newa + b=newb + c=newc + if a == b == c: + print(""-1"") + break +else: + print(ans)" +p03723,s436926631,Accepted,"import numpy as np +p = np.array(list(map(int, input().split()))) + +cnt = 0 +mem = [] +flag = True +while (p % 2).sum() == 0: + a = p[1] // 2 + p[2] // 2 + b = p[0] // 2 + p[2] // 2 + c = p[1] // 2 + p[0] // 2 + + p = np.array([a, b, c]) + if (a,b,c) in mem: + flag = False + break + else: + mem.append((a,b,c)) + + cnt += 1 + +print(cnt if flag else -1) +" +p03723,s690355574,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +for i in range(10000001): + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + if i == 1000000: + print(-1) + exit() + m = a + n = b + l = c + a = (b+c)//2 + b = (c+m)//2 + c = (m+n)//2 + ans += 1 +print(ans)" +p03723,s207861192,Accepted,"a,b,c=map(int,input().split()) +cnt=0 +while a%2==b%2==c%2==0: + a1=a//2 + b1=b//2 + c1=c//2 + a=b1+c1 + b=c1+a1 + c=a1+b1 + cnt+=1 + if a==2*a1 and b==2*b1 and c==2*c1: + cnt=-1 + break +print(cnt)" +p03723,s065732515,Accepted,"a, b, c = map(int, input().split()) + +counter = 0 +while a%2==b%2==c%2==0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + counter += 1 + if counter > 31: + counter = -1 + break +print(counter)" +p03723,s902398463,Accepted,"A, B, C = map(int, input().split()) + + +def func(x): + cnt = 0 + while x % 2 == 0: + x //= 2 + cnt += 1 + + return cnt + + +if A % 2 or B % 2 or C % 2: + print(0) +elif A == B == C: + print(-1) +else: + m = min(func(A + B), func(B + C), func(C + A)) + print(m) +" +p03723,s040223040,Accepted,"import sys +A, B, C = list(map(int, input().split())) +if A % 2 != 0 or B % 2 != 0 or B % 2 != 0: + print('0') + sys.exit() +if A == B == C: + print('-1') + sys.exit() +cnt = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + _A = A + _B = B + _C = C + A = _B // 2 + _C // 2 + B = _A // 2 + _C // 2 + C = _A // 2 + _B // 2 + cnt += 1 +print(cnt) +" +p03723,s234538318,Accepted,"A,B,C = map(int, input().split()) +ctr = 0 +if A == B == C and A%2 == 0 and B%2 == 0 and C%2 == 0: + print(-1) +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = int((B+C)/2), int((A+C)/2), int((A+B)/2) + ctr += 1 + print(ctr)" +p03723,s867170172,Accepted,"A, B, C = map(int, input().split()) + +if A == B == C and A%2 == 1: + print('0') +elif A == B == C: + print('-1') +else: + ans = 0 + while A%2 == B%2 == C%2 == 0: + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + ans += 1 + print(ans) +" +p03723,s026623963,Accepted,"a, b, c = map(int, input().split()) + +if(a == b and b == c and a % 2 == 0): + print(-1) +else : + cnt = 0 + while True: + if(a % 2 != 0 or b % 2 != 0 or c % 2 != 0): + break + A = b//2 + c//2 + B = c//2 + a//2 + C = a//2 + b//2 + a = A + b = B + c = C + cnt += 1 + print(cnt) +" +p03723,s636215735,Accepted,"A = list(map(int, input().split())) +ans = 0 +while A[0] % 2 == 0 and A[1] % 2 == 0 and A[2] % 2 == 0: + if A[0] == A[1] and A[0] == A[2]: + ans = -1 + break + A[0], A[1], A[2] = ( A[1] + A[2] ) / 2, ( A[2] + A[0] ) / 2, ( A[0] + A[1] ) / 2 + ans += 1 +print(ans) +" +p03723,s706157492,Accepted,"a, b, c = map(int, input().split()) + +total = a + b + c + +if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b == c: + print(-1) +elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) +else: + count = 1 + while True: + a, b = (total - a) / 2, (total - b) / 2 + if a % 2 != 0 or b % 2 != 0: + print(count) + break + else: + count += 1 +" +p03723,s804149055,Accepted,"a = list(map(int, input().split())) +A = [a] +ans = 0 +while True: + if (A[-1][0] & 1)or(A[-1][1] & 1)or(A[-1][2] & 1): + print(ans) + break + tmp = [A[-1][1]//2+A[-1][2]//2, A[-1][0]//2 + + A[-1][2]//2, A[-1][0]//2+A[-1][1]//2] + if tmp in A: + print(-1) + break + A.append(tmp) + ans += 1 +" +p03723,s453018508,Accepted,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(bin(e&-e))-3or-(e==b&1))" +p03723,s088401741,Accepted,"A,B,C = list(map(int, input().split())) +count=0 +while True: + if A%2 ==1or B%2 ==1 or C%2 ==1: + print(count) + break + elif A==B and B==C and C==A: + print(-1) + break + elif A%2==0 and B%2==0 and C%2 == 0: + A2 = 0.5*A + B2 = 0.5*B + C2 = 0.5*C + A = B2+C2 + B = C2+A2 + C = A2+B2 + count=count+1" +p03723,s969085147,Accepted,"import sys +import heapq, math +from itertools import zip_longest, permutations, combinations, combinations_with_replacement +from itertools import accumulate, dropwhile, takewhile, groupby +from functools import lru_cache +from copy import deepcopy + +A, B, C = map(int, input().split()) + +s = set() + +cnt = 0 +while A % 2 == B % 2 == C % 2 == 0: + if (A, B, C) in s: + cnt = -1 + break + s.add((A, B, C)) + A, B, C = B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2 + cnt += 1 + +print(cnt)" +p03723,s354663561,Accepted,"a,b,c=map(int,input().split()) +if any([a%2==1,b%2==1,c%2==1])==True: + print(0) +else: + if len(set({a,b,c}))==1: + print(-1) + else: + res=0 + while all([a%2==0,b%2==0,c%2==0]): + a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 + res+=1 + print(res)" +p03723,s216789423,Accepted,"a,b,c = map(int,input().split()) +if a == b == c: + if a % 2 == 0: + print(-1) + exit(0) + else: + print(0) + exit(0) +ans = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + al = b // 2 + c // 2 + bl = a // 2 + c // 2 + cl = a // 2 + b // 2 + a = al + b = bl + c = cl + ans += 1 +print(ans)" +p03723,s030740887,Accepted,"a,b,c=map(int,input().split()) +tmpa=0 +ampb=0 +tmpc=0 + +if a%2==1 or b%2==1 or c%2==1: + print(0) + exit() + +for i in range(10**5): + tmpa=(b+c)/2 + tmpb=(a+c)/2 + tmpc=(b+a)/2 + a=tmpa + b=tmpb + c=tmpc + if a%2==1 or b%2==1 or c%2==1: + print(i+1) + exit() +print(-1)" +p03723,s701409070,Accepted,"A, B, C = list(map(int, input().split())) +if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + print(-1) + exit() +ans = 0 +while True: + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + else: + break +print(ans) +" +p03723,s327033700,Accepted,"# agc014_a.py] +A, B, C = map(int,input().split()) +cnt = 0 +inf = 10**6 +for i in range(inf): + if A%2==0 and B%2==0 and C%2==0: + a = (B+C)//2 + b = (A+C)//2 + c = (B+A)//2 + A = a + B = b + C = c + cnt += 1 + else: + break +if cnt == inf: + cnt = -1 +print(cnt)" +p03723,s256969169,Accepted,"A, B, C = list(map(int, input().split())) +[A, B, C].sort() #smaller~bigger +if A==B and B==C: + if A%2==0: + print(-1) + else: + print(0) +elif (A%2==1) or (B%2==1) or (C%2==1): + print(0) +else: + cnt = 0 + while ((A%2==0) and (B%2==0) and (C%2==0)): + [A, B, C] = [(A+B)/2, (A+C)/2, (B+C)/2] + cnt += 1 + print(cnt) +" +p03723,s239565522,Accepted,"l = [list(map(int, input().split()))] +i = 0 +while (1): + a, b, c = map(int,l[i]) + if (a % 2 == 1 or b % 2 == 1 or c % 2 == 1): + print(i) + break + t = [b / 2 + c / 2, c / 2 + a / 2, a / 2 + b / 2] + if (t in l): + print(-1) + break + l.append(t) + i+=1 +" +p03723,s291943779,Accepted,"a, b, c = map(int,input().split()) + +if a%2!=0 or b%2!=0 or c%2!=0: + print(0) + exit() + +if a==b==c: + print(-1) + exit() + +times=0 +while a%2==0 and b%2==0 and c%2==0: + times+=1 + a_=a//2 + b_=b//2 + c_=c//2 + a=b_+c_ + b=a_+c_ + c=a_+b_ + +print(times)" +p03723,s140253199,Accepted,"def main(): + a, b, c = map(int, input().split()) + if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(""0"") + else: + if a == b == c: + print(""-1"") + else: + ans = 0 + while a%2 == 0 and b%2 == 0 and c%2 == 0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + ans += 1 + print(ans) + +if __name__ == ""__main__"": + main()" +p03723,s384110706,Accepted,"def mapint_inp(): + return map(int, input().split()) + +A, B, C = mapint_inp() + +ans = 0 +while(1): + if A%2==1 or B%2==1 or C%2==1: + break + if A == B and B == C: + ans = -1 + break + halvedA = A//2 + halvedB = B//2 + halvedC = C//2 + A = halvedB+halvedC + B = halvedA+halvedC + C = halvedA+halvedB + ans+=1 + +print(ans)" +p03723,s783067238,Accepted,"a, b, c = map(int, input().split()) + +cnt = 0 + +while True: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + break + if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b and b == c and c == a: + cnt = -1 + break + + a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2 + cnt += 1 + +print(cnt) +" +p03723,s323402822,Accepted,"a,b,c=map(int,input().split()) +ans=0 +average=int((a+b+c)/3) +while True: + if a%2==1 or b%2==1 or c%2==1: + print(ans) + exit() + else: + tb=int(b/2) + tc=int(c/2) + ta=int(a/2) + a=tb+tc + b=ta+tc + c=ta+tb + + ans+=1 + if a==average and b==average and c==average: + print(-1) + exit() +" +p03723,s985543185,Accepted,"a,b,c=map(int,input().split()) +if a == b == c and a%2==0: + print(-1) +else: + na,nb,nc = 0,0,0 + cnt = 0 + while a%2==0 and b%2==0 and c%2==0: + na = (b+c)//2 + nb = (c+a)//2 + nc = (a+b)//2 + cnt += 1 + a,b,c = na,nb,nc + print(cnt)" +p03723,s262394274,Accepted,"a,b,c = map(int,input().split("" "")) +n = 0 +if a % 2 == 1: + print(0) + exit() +if b % 2 == 1: + print(0) + exit() +if c % 2 == 1: + print(0) + exit() +if a == b == c: + print(-1) + exit() +for i in range(10**9): + aa = a//2 + bb = b//2 + cc = c//2 + a = bb + cc + b = aa + cc + c = aa + bb + n += 1 + if a % 2 == 1: + break + if b % 2 == 1: + break + if c % 2 == 1: + break +print(n) +" +p03723,s805175233,Accepted,"a, b, c = map(int, input().split()) +if a == b == c and a%2 == 0: + print(-1) +elif a%2 or b%2 or c%2: + print(0) +else: + ans = 0 + while a%2 == b%2 == c%2 == 0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + ans += 1 + print(ans)" +p03723,s359962914,Accepted,"a, b, c = list(map(int, input().split(' '))) + +if a % 2 == 0 and a == b == c: + print(-1) +else: + count = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(count) + break + a, b, c, = (b + c) // 2, (c + a) // 2, (a + b) // 2 + count += 1 +" +p03723,s523069571,Accepted,"# A - Cookie Exchanges +a,b,c = map(int,input().split()) + +if a==b==c and c%2==0: + print(-1) +else: + ans = 0 + while a%2==b%2==c%2==0: + ans += 1 + a,b,c = (b+c)//2,(c+a)//2,(a+b)//2 + print(ans)" +p03723,s657148229,Accepted,"A,B,C = map(int, input().split()) +cnt = 0 +if A%2 or B%2 or C%2: + print(cnt) + exit() +if A == B and B == C: + print(-1) + exit() +while True: + if A%2 or B%2 or C%2: + print(cnt) + break + temp_a = A//2 + temp_b = B//2 + temp_c = C//2 + A += 2*temp_a + temp_b + temp_c + B += 2*temp_b + temp_a + temp_c + C += 2*temp_c + temp_a + temp_b + cnt += 1" +p03723,s763625704,Accepted,"a, b, c = map(int, input().split()) +count = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + if a == b and b == c and c == a: + count = -1 + break + a_tmp = a + b_tmp = b + c_tmp = c + a = (b_tmp + c_tmp) / 2 + b = (c_tmp + a_tmp) / 2 + c = (a_tmp + b_tmp) / 2 + count += 1 +print(count) +" +p03723,s233665466,Accepted,"a,b,c = map(int,input().split()) +count = 0 +flag = True +while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + aa = a//2 + bb = b//2 + cc = c//2 + a = bb + cc + b = aa + cc + c = aa + bb + if(a == b == c): + flag = False + break + count += 1 + +if flag: + print(count) +else: + print(-1) +" +p03723,s773466785,Accepted,"a,b,c=map(int,input().split()) +cnt=0 + +if a==b==c and a%2==0: + print(-1) + +else: + while a%2==0 and b%2==0 and c%2==0: + a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 + cnt+=1 + print(cnt) + + + +" +p03723,s129515084,Accepted,"#!/usr/local/bin/python3 +# https://atcoder.jp/contests/agc014/tasks/agc014_a + +A, B, C = map(int, input().split()) + +if A == B == C and A % 2 == 0: + print(-1) + exit() + +def check(A, B, C): + return A%2 == 1 or B%2 == 1 or C%2 == 1 + +ans = 0 +while check(A, B, C) == False: + nA = (B + C) / 2 + nB = (A + C) / 2 + nC = (A + B) / 2 + A, B, C = nA, nB, nC + ans += 1 + +print(ans) +" +p03723,s030587358,Accepted,"A,B,C = map(int,input().split()) +cou = 0 +if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(""0"") + exit() +while(cou < 10**6): + cou += 1 + a = A + b = B + c = C + A = b/2 + c/2 + B = a/2 + c/2 + C = a/2 + b/2 + if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(str(cou)) + exit() + else: + pass +print(""-1"")" +p03723,s576152778,Accepted,"# coding: utf-8 + +def main(): + a, b, c = map(int, input().split()) + ans = 0 + + if a == b and b == c and a % 2 == 0: + ans = -1 + else: + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + d = b / 2 + c / 2 + e = c / 2 + a / 2 + f = a / 2 + b / 2 + a, b, c = d, e, f + ans += 1 + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p03723,s026575556,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 + +while cnt <= 10**6: + if (a%2 != 0 or b%2 != 0 or c%2 != 0): + print(cnt) + exit() + + if a==b==c: + print(-1) + exit() + + a_ = b//2 + c//2 + b_ = a//2 + c//2 + c_ = a//2 + b//2 + + a = a_ + b = b_ + c = c_ + + cnt += 1" +p03723,s160352287,Accepted,"a, b, c = [int(i) for i in input().split()] +if a == b == c and a % 2 == 0: + print(-1) + exit() +if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(0) + exit() +cnt = 0 +while True: + ta, tb, tc = a, b, c + ta = (b + c) // 2 + tb = (a + c) // 2 + tc = (a + b) // 2 + cnt += 1 + if ta % 2 == 1 or tb % 2 == 1 or tc % 2 == 1: + print(cnt) + break + a, b, c = ta, tb ,tc" +p03723,s168966155,Accepted,"a, b, c = map(int, input().split()) +ans = 0 + +while True: + if a%2==1 or b%2==1 or c%2==1: + print(ans) + break + if a == b == c: + print(-1) + break + s = a // 2 + t = b // 2 + u = c // 2 + a, b, c = t+u, s+u, s+t + ans += 1 +else: + print(ans)" +p03723,s908403691,Accepted,"a,b,c=map(int,input().split()) +e=a-b|c-b +print(len(bin(e&-e))-3or~c%-2)" +p03723,s834998532,Accepted,"A,B,C = map(int,input().split()) +count = 0 + +if A == B and B == C and A%2 == 0: + print(-1) + +else: + while True: + if A%2 == 1 or B%2 == 1 or C%2 == 1: + break + else: + A2 = A + B2 = B + C2 = C + A = B2/2 + C2/2 + B = A2/2 + C2/2 + C = A2/2 + B2/2 + count += 1 + print(count)" +p03723,s306575649,Accepted,"a, b, c = map(int, input().split()) + +if a == b and a == c: + if a % 2 == 1: + print(0) + exit() + else: + print(-1) + exit() + +ans = 0 +s, t, u = 0, 0, 0 +while a%2==0 and b%2==0 and c%2==0: + s = b//2 + c//2 + t = a//2 + c//2 + u = a//2 + b//2 + a, b, c = s, t, u + ans += 1 + +print(ans)" +p03723,s130792564,Accepted,"List=list(map(int,input().split())) +cnt=0 +while(all(i%2==0 for i in List)): + if List[0]==List[1]==List[2]: + print(-1) + exit() + old_list=[List[0]//2,List[1]//2,List[2]//2] + List[0]=old_list[1]+old_list[2] + List[1]=old_list[0]+old_list[2] + List[2]=old_list[0]+old_list[1] + cnt+=1 +print(cnt)" +p03723,s464724667,Accepted,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print((e!=0|b%2)*(e^~-e).bit_length()-1)" +p03723,s443339472,Accepted,"a,b,c=map(int,input().split()) +for i in range(500000): + if a%2==1 or b%2==1 or c%2==1: + print(i);exit() + + else: + p=(b+c)//2 ;q=(a+c)//2 ; r=(a+b)//2 + a=p ; b=q;c=r +else: + print(-1)" +p03723,s183963731,Accepted,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print((e!=0|b%2)*(e^~-e).bit_length()-1) +" +p03723,s545467453,Accepted,"A,B,C = map(int, input().split()) +result = 0 + +if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + result = 0 +elif A == B == C: + result = -1 +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + result += 1 + a = A/2 + b = B/2 + c = C/2 + A = b + c + B = a + c + C = b + a + +print(result)" +p03723,s585286085,Accepted,"a,b,c=map(int,input().split()) + +if a%2==1 or b%2==1 or c%2==1: + print(""0"") + exit() + +for i in range(1,1000000): + a2=(b//2)+(c//2) + b2=(a//2)+(c//2) + c2=(a//2)+(b//2) + + a,b,c=a2,b2,c2 + + if a%2==1 or b%2==1 or c%2==1: + print(i) + exit() + +print(""-1"")" +p03723,s085795097,Accepted,"A, B, C = map(int, input().split()) +ans = 0 +while True: + # print(A, B, C) + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B == C: + print(-1) + exit() + ans += 1 + tA = A + tB = B + tC = C + A = tB//2 + tC//2 + B = tA//2 + tC//2 + C = tB//2 + tA//2 + else: + print(ans) + exit() + +" +p03723,s782630288,Accepted,"a, b, c=map(int,input().split()) +A,B,C = a,b,c +ans = 0 +if(a%2 or b%2 or c%2): + print(0) + exit(0) +while(a%2==0 and b%2==0 and c%2==0): + if(A==B==C): + ans = -1 + break + A,B,C = a,b,c + a = B//2 + C//2 + b = A//2 + C//2 + c = A//2 + B//2 + ans += 1 +print(ans) + +" +p03723,s352732045,Accepted,"A, B, C = map(int, input().split()) + + +def F(a, b, c): + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + return 0 + if a == b == c: + return -1 + return F((a + b) // 2, (b + c) // 2, (c + a) // 2) + 1 + + +print(F(A, B, C)) + +" +p03723,s751923175,Accepted,"a,b,c = map(lambda x:int(x),input().split()) +reps = 0 +while a%2==0 and b%2==0 and c%2==0: + if (a==b==c): + reps = -1 + break + at=a + bt=b + ct=c + a = int(bt/2+ct/2) + b = int(at/2+ct/2) + c = int(at/2+bt/2) + reps += 1 +print(reps)" +p03723,s865770719,Accepted,"#13A - Cookie Exchanges +A,B,C = map(int, input().split()) +cnt = 0 +while (A%2 + B%2 + C%2) == 0: + if A == B == C: + print (-1) + exit() + else: + a = B/2 + C/2 + b = A/2 + C/2 + c = A/2 + B/2 + A = a + B = b + C = c + cnt += 1 + +print (cnt)" +p03723,s816131967,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(0) +elif a == b == c: + print(-1) +else: + count = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b+c)/2, (a+c)/2, (a+b)/2 + count += 1 + print(count) +" +p03723,s356173658,Accepted,"a, b, c = map(int, input().split()) + +ans = 0 +while (a % 2 == 0) & (b % 2 == 0) & (c % 2 == 0): + a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2 + ans += 1 + if ans>1000000: + ans = -1 + break +print(ans) +" +p03723,s541304142,Accepted,"a,b,c=map(int,input().split()) + +if a==b and a==c and a%2==0: + print(-1) + +else: + cnt=0 + while a%2==0 and b%2==0 and c%2==0: + cnt+=1 + i=a + j=b + a=(b+c)//2 + b=(i+c)//2 + c=(i+j)//2 + print(cnt)" +p03723,s378337044,Accepted,"import numpy as np +cookies = np.array([int(x) for x in input().split()]) + +if any(cookies%2): + ans = 0 +elif cookies[0] == cookies[1] == cookies[2]: + ans = -1 +else: + ans = 0 + while True: + if not any(cookies%2): + cookies = cookies//2 + ans += 1 + continue + if all(cookies%2): + ans += 1 + break +print(ans)" +p03723,s333451941,Accepted,"A,B,C = map(int,input().split()) +if A%2 != 0 or B%2 != 0 or C%2 != 0: + print(0) + exit() +if A*2 == B+C and B*2 == A+C and C*2 == A+B: + print(-1) + exit() +ans = 0 +for i in range(10000): + a = A//2 + b = B//2 + c = C//2 + if A%2 == 0 and B%2 == 0 and C%2 == 0: + ans += 1 + A = b+c + B = a+c + C = a+b + else: + print(ans) + exit()" +p03723,s597127588,Accepted,"a, b, c = map(int, input().split()) +count = 0 +if a % 2 == 0 and a == b == c: + print(-1) + exit() + +while a % 2 == 0 | b % 2 == 0 | c % 2 == 0: + A = int((b + c) / 2) + B = int((c + a) / 2) + C = int((a + b) / 2) + a = A + b = B + c = C + count += 1 +print(count)" +p03723,s151275594,Accepted,"A,B,C=map(int,input().split()) +cnt=0 +while True: + if A % 2 == B % 2 == C % 2 == 1: + break + elif A==B==C: + cnt-=1 + break + elif A%2==B%2==C%2==0: + hA=A//2 + hB=B//2 + hC=C//2 + A=hB+hC + B=hA+hC + C=hA+hB + cnt+=1 + else: + break + +print(cnt)" +p03723,s441086527,Accepted,"a,b,c=map(int,input().split()) +if a==b and b==c and a%2==0 and b%2==0 and c%2==0: + print(-1) +else: + k=0 + while a%2==0 and b%2==0 and c%2==0: + A=a + B=b + C=c + a=B//2+C//2 + b=A//2+C//2 + c=A//2+B//2 + k+=1 + print(k)" +p03723,s896711329,Accepted,"a, b, c = map(int,input().split()) + +count = 0 +if a==b==c and a%2==b%2==c%2==0: + print(-1) +else: + while a%2 == 0 and b%2 == 0 and c%2 == 0: + a, b, c = b//2+c//2, c//2+a//2, a//2+b//2 + count += 1 + print(count)" +p03723,s066475267,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(0) +elif a == b == c: + print(-1) +else: + num = 0 + while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)/2, (a+c)/2, (a+b)/2 + num += 1 + print(num)" +p03723,s298966641,Accepted,"a,b,c = tuple(map(int,input().split())) +if len(set((a,b,c)))==1 and a%2==1: + print(0) + exit() +ans = 0 +while True: + if len(set((a,b,c)))==1: + print(-1) + exit() + if a%2==0 and b%2==0 and c%2==0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + else: + break +print(ans) +" +p03723,s158291949,Accepted,"a, b, c = map(int, input().split()) +ans = 0 + +for i in range(10000): + if a%2 == 0 and b%2 == 0 and c%2 == 0: + A = (b + c)/2 + B = (a + c)/2 + C = (a + b)/2 + a = A + b = B + c = C + ans += 1 + else: + break + +if ans >= 10000: + print(-1) +else: + print(ans)" +p03723,s617677337,Accepted,"a, b, c = map(int, input().split()) + +a1 = (b + c) / 2 +b1 = (a + c) / 2 +c1 = (a + b) / 2 + +diffs = [abs(a-a1), abs(b-b1), abs(c-c1)] + +ans = [] +for tmpdiff in diffs: + count = 1 + while tmpdiff % 2 == 0: + tmpdiff = tmpdiff / 2 + count += 1 + if tmpdiff == 0: + count = -1 + break + + ans.append(count) + +if not (a%2 ==0 and b%2 ==0 and c%2 ==0): + print(0) +elif ans == [-1 for _ in range(len(ans))]: + print(-1) +else: + print(min([i for i in ans if i >0]))" +p03723,s142188796,Accepted,"A, B, C = list(map(int, input().split())) + +ListA = [A]*10000 +ListB = [B]*10000 +ListC = [C]*10000 + +if A%2==1 or B%2==1 or C%2==1: + print(0) + exit() + +for i in range (1, 10000): + ListA[i]= ListB[i-1]/2+ListC[i-1]/2 + ListB[i]= ListA[i-1]/2+ListC[i-1]/2 + ListC[i]= ListA[i-1]/2+ListB[i-1]/2 + if ListA[i]%2==1 or ListB[i]%2==1 or ListC[i]%2==1: + print(i) + exit() + +print(-1)" +p03723,s951192349,Accepted,"a = list(map(int, input().split())) + +if a[0] % 2 == 1 or a[1] % 2 == 1 or a[2] % 2 == 1: + print(0) + exit() + +cnt = 0 +for _ in range(1000): + for i in a: + if i % 2 == 1: + print(cnt) + exit() + a[0], a[1], a[2] = a[1] // 2 + a[2] // 2, a[0] // 2 + a[2] // 2, a[0] // 2 + a[1] // 2 + cnt += 1 +else: + print(-1)" +p03723,s928979734,Accepted,"import sys + +input = sys.stdin.readline + + +def main(): + A, B, C = map(int, input().split()) + + if A == B == C and A % 2 == 0: + print(-1) + exit() + + ans = 0 + while True: + if (A % 2 == 1) or (B % 2 == 1) or (C % 2 == 1): + break + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p03723,s294220422,Accepted,"a,b,c=map(int,input().split()) +num1=0 +num2=0 +num3=0 +if a==b and b==c and a%2==0: + print(-1) +else: + for i in range(a*b*c): + if a%2==1 or b%2==1 or c%2==1: + break + num1=a//2 + num2=b//2 + num3=c//2 + a=num2+num3 + b=num3+num1 + c=num1+num2 + print(i) +" +p03723,s634973286,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 +while A % 2 == B % 2 == C % 2 == 0: + # print(A, B, C) + if A == B == C: + print(-1) + break + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + cnt += 1 +else: + print(cnt) +" +p03723,s524766801,Accepted,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e!=b&1)*len(f'{e&-e:b}')-1)" +p03723,s668691781,Accepted,"A,B,C = map(int,input().split()) +cnt=0 + +if A==B==C: + if A%2==0: + cnt=-1 + else: + cnt=0 +else: + while A%2==0 and B%2==0 and C%2==0: + s=A//2 + t=B//2 + u=C//2 + A=t+u + B=u+s + C=s+t + cnt +=1 + +print(cnt)" +p03723,s635238809,Accepted,"a, b, c = map(int, input().split()) +if a % 2 or b % 2 or c % 2: + print(0) + exit() +if a == b == c: + print(-1) + exit() + +cnt = 0 +while True: + if a % 2 or b % 2 or c % 2: + break + cnt += 1 + next_a = b // 2 + c // 2 + next_b = a // 2 + c // 2 + next_c = a // 2 + b // 2 + a = next_a; b = next_b; c = next_c +print(cnt)" +p03723,s309243417,Accepted,"import sys +def rs(): return sys.stdin.readline().rstrip() +def ri(): return int(rs()) +def rs_(): return [_ for _ in rs().split()] +def ri_(): return [int(_) for _ in rs().split()] + +import numpy as np +a = np.array(ri_()) +ans = 0 +while True: + if np.any(a % 2 == 1): + break + if a[0] == a[1] and a[1] == a[2]: + ans = -1 + break + a = (sum(a) - a) // 2 + ans += 1 +print(ans)" +p03723,s616980721,Accepted,"A,B,C=map(int,input().split()) +count=0 +if A%2==0 and A==B and A==C: + print(""-1"") + exit() +while True: + if A%2==1 or B%2==1 or C%2==1: + break + a,b,c=A/2,B/2,C/2 + A,B,C=b+c,a+c,a+b + count+=1 +print(count)" +p03723,s953920893,Accepted,"a, b, c = map(int, input().split()) + +cnt = 0 + +while True: + if a % 2 == 1: + print(cnt) + exit() + if b % 2 == 1: + print(cnt) + exit() + if c % 2 == 1: + print(cnt) + exit() + if a == b and a == c: + print(-1) + exit() + lis = [] + lis.append((b+c)/2) + lis.append((a+c)/2) + lis.append((a+b)/2) + a, b, c = lis + + cnt += 1" +p03723,s278255722,Accepted,"A,B,C = map(int,input().split()) + +def F(A,B,C): + if any(x&1 for x in [A,B,C]): + return 0 + if A == B == C: + return -1 + return 1 + F((A+B)//2,(B+C)//2,(C+A)//2) + +answer = F(A,B,C) +print(answer) +" +p03723,s539254952,Accepted,"A, B, C = map(int,input().split()) +ans = 0 +while True: + if A & 1 or B & 1 or C & 1: break + elif A == B and B == C: + ans = -1 + break + else: + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 +print(ans)" +p03723,s012708150,Accepted,"def solve(a, b, c): + if any(i % 2 == 1 for i in [a, b, c]): + return 0 + if a == b == c: + return -1 + a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2 + return solve(a, b, c) + 1 + +a, b, c = map(int, input().split()) + +print(solve(a, b, c))" +p03723,s284121688,Accepted,"a,b,c=map(int,input().split()) +d=0 +while a%2==0 and b%2==0 and c%2==0: + if a==b==c: + print(-1) + break + d+=1 + ha=a//2 + hb=b//2 + hc=c//2 + a=hb+hc + b=ha+hc + c=ha+hb +else:print(d)" +p03723,s908365588,Accepted,"A,B,C=list(map(int,input().split())) +if A == B == C: + if A%2==1 or B%2==1 or C%2==1: + print(0) + exit() + else: + print(-1) + exit() +for i in range(10**9): + if A%2==1 or B%2==1 or C%2==1: + print(i) + exit() + A,B,C=(B+C)//2,(A+C)//2,(A+B)//2" +p03723,s138000031,Accepted,"A, B, C = map(int, input().split()) + +for i in range(36): + if A % 2 or B % 2 or C % 2: + break + + tA = (B + C) // 2 + tB = (A + C) // 2 + tC = (B + A) // 2 + A = tA + B = tB + C = tC +else: + i = -1 + +print(i) +" +p03723,s402595747,Accepted,"a, b, c = map(int, input().split()) + +if ( a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b == c): + print(-1) + quit() + +count = 0 +while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + _a = b / 2 + c /2 + _b = a / 2 + c /2 + _c = a / 2 + b /2 + a = _a + b = _b + c = _c + count += 1 +print(count)" +p03723,s233710484,Accepted,"a,b,c = map(int,input().split()) +res = 0 +while a%2==0 and b%2==0 and c%2==0: # 値が偶数の間 + if a==b==c: #無限ループ + print(-1) + exit() + tmpa = b//2+c//2 + tmpb = a//2+c//2 + tmpc = a//2+b//2 + a = tmpa + b = tmpb + c = tmpc + res += 1 +print(res)" +p03723,s506005028,Accepted,"A,B,C = map(int,input().split()) +if A == B and B == C and C == A: + print(-1 if A%2==0 else 0 ) +else: + count = 0 + while(A%2==0 and B%2 == 0 and C%2==0): + A_ = A + B_ = B + A = (B+C)/2 + B = (A_+C)/2 + C = (A_+B_)/2 + count+=1 + print(count) +" +p03723,s129334687,Accepted,"def solve(): + A, B, C = map(int, input().split()) + if A == B == C and A % 2 == 0: + return -1 + + cnt = 0 + while True: + if A % 2 or B % 2 or C % 2: + return cnt + A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2 + cnt += 1 + + +print(solve())" +p03723,s664004406,Accepted,"A,B,C=map(int, input().split()) +for i in range(1000000): + if A&1 or B&1 or C&1: + print(i) + break + A,B,C=B//2+C//2,A//2+C//2,A//2+B//2 +else: + print(-1)" +p03723,s779717192,Accepted,"a, b, c = map(int, input().strip().split()) + +count = 0 + +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + if a == b and b == c: + count = -1 + break + + count += 1 + a1 = b // 2 + c // 2 + b1 = c // 2 + a // 2 + c1 = a // 2 + b // 2 + + a, b, c = a1, b1, c1 + +print(count) +" +p03723,s390020030,Accepted,"a, b, c = map(int, input().split()) + +times = 0 +if a == b and b == c and a % 2 == 0: + print(-1) +else: + while 1: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + a, b, c = int((b + c)/2), int((c + a)/2), int((a + b)/2) + times += 1 + + print(times)" +p03723,s008540336,Accepted,"a,b,c=map(int,open(0).read().split()) +e=(a-b)|(b-c) +print(bool(e|(a|b|c)%2)*(e^~-e).bit_length()-1)" +p03723,s473866878,Accepted,"A, B, C = map(int, input().split()) + +if A==B==C: + if A%2==0: + print(-1) + else: + print(0) + +else: + for i in range(1000000000): + if A %2==0 and B%2==0 and C%2==0: + a = A/2 + b = B/2 + c = C/2 + A = b+c + B = a+c + C = a+b + else: + print(i) + exit() + +" +p03723,s135755843,Accepted,"A, B, C = map(int, input().split()) +sum = 0 +before = set() +while True: + if str(A)+' '+str(B)+' '+str(C) in before: + print(-1) + exit() + else: + before.add(str(A)+' '+str(B)+' '+str(C)) + if A%2==1 or B%2==1 or C%2==1: + print(sum) + exit() + temp1 = int(B/2)+int(C/2) + temp2 = int(A/2)+int(C/2) + temp3 = int(A/2)+int(B/2) + A, B, C = temp1, temp2, temp3 + sum += 1" +p03723,s380549963,Accepted,"l = list(map(int, input().split())) +ans = 0 +while( l[0]%2==0 and l[1]%2==0 and l[2]%2==0): + if l[0]==l[1]and l[1]==l[2]: + ans = -1 + break + else: + a = l[0] + b = l[1] + c = l[2] + l[0]=(b+c)/2 + l[1]=(a+c)/2 + l[2]=(a+b)/2 + ans+=1 +print(ans)" +p03723,s998848904,Accepted,"a,b,c = map(int, input().split("" "")) +pr=True +count=0 +while(a%2==0 and b%2==0 and c%2==0): + ta,tb,tc=a,b,c + a=tb/2+tc/2 + b=ta/2+tc/2 + c=ta/2+tb/2 + count += 1 + if ta == a and tb == b and tc == c: + print(-1) + pr=False + break +if pr: + print(count)" +p03723,s439708697,Accepted,"a, b, c = map(int, input().split()) + +if a%2 == 0 and a==b==c: + print(-1) + exit() + +i = 0 +a_, b_, c_ = a, b, c + +while a%2 == 0 and b%2 == 0 and c%2 == 0: + i += 1 + a = b_//2 + c_//2 + b = a_//2 + c_//2 + c = a_//2 + b_//2 + a_, b_, c_ = a, b, c + +print(i)" +p03723,s871562343,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +p = 0 + +for i in range(c): + if int(a/2)*2==a and int(b/2)*2==b and int(c/2)*2==c: + if a == b and b == c: + break + ans += 1 + x = b / 2 + c / 2 + y = a / 2 + c / 2 + z = b / 2 + a / 2 + a = x + b = y + c = z + + else: + p = 1 + print(ans) + break + + + +if p == 0: + print(-1)" +p03723,s540988328,Accepted,"import math +A,B,C = map(int,input().split()) + +ans = 0 +while(1): + tmp_A,tmp_B,tmp_C = A,B,C + if((tmp_A%2 == 1)or(tmp_B%2 == 1)or(tmp_C%2 == 1)): + break + A,B,C = (tmp_B+tmp_C)//2, (tmp_C+tmp_A)//2, (tmp_A+tmp_B)//2 + if((tmp_A == A)and(tmp_B == B)and(tmp_C == C)): + ans = -1 + break + ans += 1 + +print(ans) " +p03723,s460211923,Accepted,"nums = map(int, input().split()) +nums = sorted(nums) +A, B, C = nums + +if A == B and B == C and A % 2 == 0: + print(-1) + exit() + +count = 0 +while True: + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(count) + exit() + + nA = (B + C) // 2 + nB = (A + C) // 2 + nC = (A + B) // 2 + count += 1 + A, B, C = nA, nB, nC" +p03723,s415704989,Accepted,"import sys + +input = sys.stdin.readline + +def main(): + ans = 0 + a, b, c = map(int, input().split()) + while a%2 == b%2 == c%2 == 0: + ans += 1 + ta = a//2 + tb = b//2 + tc = c//2 + a = tb + tc + b = ta + tc + c = ta + tb + if a == b == c: + ans = -1 + break + print(ans) + +if __name__ == '__main__': + main()" +p03723,s473342783,Accepted,"a,b,c=map(int,input().split());print(len(bin((e:=a-b|c-b)&-e))-3or~c%-2)" +p03723,s424436729,Accepted,"import numpy as np +import sys + +input = sys.stdin.readline + +A,B,C = map(int,input().split()) + + +if A == B == C and A%2 == 0 and B%2 == 0 and C%2 == 0: + ans = -1 +else: + ans = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + next_a = C/2 + B/2 + next_b = A/2 + C/2 + next_c = A/2 + B/2 + A = next_a + B = next_b + C = next_c + ans += 1 + +print(ans) +" +p03723,s023807028,Accepted,"import re +A,B,C = map(int,input().split()) +#N = str(input()) +#K = int(input()) +#A = list(map(int,input().split())) +if A==B==C and A%2==0 and B%2==0 and C%2==0: + print(-1) + exit() +flag=True +co=0 +if A%2!=0 or B%2!=0 or C%2!=0: + flag=False +while flag==True: + co+=1 + + a=B/2 + C/2 + b=A/2 + C/2 + c=B/2 + A/2 + if a%2!=0 or b%2!=0 or c%2!=0: + flag=False + A=a + B=b + C=c + +print(co) +" +p03723,s498389749,Accepted,"a, b, c = map(int, input().split()) +ans = 0 +if a == b == c: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + pass + else: + ans = -1 +else: + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + ans += 1 + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 +print(ans) +" +p03723,s294497692,Accepted,"import sys +A, B, C = [int(x) for x in input().split()] +ans = 0 +if(A==B==C)and(A%2==0)and(B%2==0)and(C%2==0): + print(-1) + sys.exit() +while (A%2==0)and(B%2==0)and(C%2==0): + a = B/2 + C/2 + b = C/2 + A/2 + c = A/2 + B/2 + A, B, C = a, b, c + ans += 1 +print(ans)" +p03723,s660203468,Accepted,"#!/usr/bin/env python3 +a, b, c = map(int, input().split()) +o = 0 +if a == b == c:print(a%2-1);exit() +while 1-any([a%2, b%2, c%2]): + a, b, c = (b+c)//2, (c+a)//2, (a+b)//2 + o += 1 +print(o) " +p03723,s448728116,Accepted,"def calculate(A, B, C): + for i in range(1000): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + return i + else: + _A = (B + C) // 2 + _B = (A + C) // 2 + _C = (A + B) // 2 + A, B, C = _A, _B, _C + return -1 + +A, B, C = map(int, input().split()) +print(calculate(A, B, C))" +p03723,s867440487,Accepted,"A, B, C = [int(x) for x in input().split()] +ans = 0 +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + elif A == B == C: + ans = -1 + break + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + +print(ans)" +p03723,s333788462,Accepted,"A,B,C=map(int,input().split()) +ans=0 +while A%2==0 and B%2==0 and C%2==0: + if A == B == C: + print(-1) + exit() + A1=A + B1=B + C1=C + A = B1/2+C1/2 + B = A1/2+C1/2 + C = A1/2+B1/2 + ans +=1 +print(ans)" +p03723,s287906579,Accepted,"A,B,C = map(int,input().split()) + +if A%2==B%2==C%2==0 and A==B==C: + print(-1) + exit() + +cnt=0 +while(A%2==B%2==C%2==0): + _A=A;_B=B;_C=C + A=_B//2+_C//2 + B=_A//2+_C//2 + C=_B//2+_A//2 + cnt+=1 + #print(cnt,A,B,C) +print(cnt)" +p03723,s237547175,Accepted,"A, B, C = map(int,input().split()) + +if B %2 != 0: + print(0) + exit() +if A == B == C: + print(-1) + exit() + +x = B/2 +cnt = 0 +while A % 2 == 0 and C % 2 == 0: + tmp_a = A + tmp_c = C + A = tmp_c/2 + x + C = tmp_a/2 + x + cnt += 1 +print(cnt)" +p03723,s431627543,Accepted,"a, b, c = map(int, input().split()) +ans = 0 +if a == b == c and a != 1: + ans = -1 +else: + while a % 2 == b % 2 == c % 2 == 0: + x = a // 2 + y = b // 2 + z = c // 2 + if x % 2 == y % 2 == z % 2: + a = y + z + b = z + x + c = z + x + ans += 1 + else: + ans += 1 + break +print(ans)" +p03723,s240818906,Accepted,"def resolve(): + A, B, C = map(int, input().split()) + cnt = 0 + while True: + if A%2 == 1 or B%2 == 1 or C%2 == 1: + break + elif A==B and B==C: + cnt = -1 + break + Atmp = A + Btmp = B + Ctmp = C + A = (Btmp+Ctmp)/2 + B = (Atmp+Ctmp)/2 + C = (Atmp+Btmp)/2 + cnt += 1 + print(cnt) +resolve() +" +p03723,s567312636,Accepted,"a,b,c = map(int,input().split()) +if a%2==1 or b%2==1 or c%2==1: + print(0) +elif a == b == c: + print(-1) +else: + ans = 0 + while a%2==b%2==c%2==0: + a,b,c = (b+c)//2,(c+a)//2,(a+b)//2 + ans += 1 + print(ans)" +p03723,s515219094,Accepted,"A,B,C = map(int,input().split()) +ans = 0 + +if not (A % 2 == 0 and B % 2 == 0 and C % 2 == 0): + print(0) + exit() + +if A == B and B == C: + print(-1) + exit() + +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A,B,C = (B+C)//2,(C+A)//2,(A+B)//2 + ans += 1 + + if A == B and B == C: + print(-1) + exit() + +print(ans) +" +p03723,s870700435,Accepted,"## A - Cookie Exchanges +A, B, C = map(int, input().split()) +if not (A%2 == B%2 == C%2 == 0): + ans = 0 +elif A == B == C: + ans = -1 +else: + ans = 0 + while A%2 == B%2 == C%2 == 0: + a = (B+C) // 2 + b = (C+A) // 2 + c = (A+B) // 2 + A = a + B = b + C = c + ans += 1 +print(ans) + +" +p03723,s208381412,Accepted,"A, B, C = map(int, input().split()) + +i = 0 +Ap = A +Bp = B +Cp = C +while A%2 == 0 and B%2 == 0 and C%2 == 0: + A = Bp//2 + Cp//2 + B = Ap//2 + Cp//2 + C = Bp//2 + Ap//2 + i += 1 + Ap = A + Bp = B + Cp = C + if A == B == C: + i = -1 + break + + +print(i)" +p03723,s659270807,Accepted,"import sys +A, B, C = map(int, input().split()) + +def isodd(x): + if x % 2 == 1: + return True + else: + return False + +if isodd(A) or isodd(B) or isodd(C): + print(0) + sys.exit() +res = 0 +while not isodd(A) and not isodd(B) and not isodd(C): + if A == B == C: + print(-1) + sys.exit() + tA, tB, tC = A, B, C + A = tB//2 + tC//2 + B = tA//2 + tC//2 + C = tA//2 + tB//2 + res += 1 +print(res)" +p03723,s076090408,Accepted,"A, B, C = map(int,input().split()) +c = 0 + +while (A % 2 == 0) and (B % 2 == 0) and (C % 2 == 0): + A, B, C = B/2+C/2, C/2+A/2, A/2+B/2 + c += 1 + + if A == B == C: + c = -1 + break + +print(c)" +p03723,s602291239,Accepted,"A, B, C = map(int, input().split()) + +cnt = 0 +if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(cnt) +elif A == B == C: + cnt = -1 + print(cnt) +else: + while True: + a, b, c = A, B, C + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A, B, C = (b + c) / 2, (a + c) / 2, (a + b) / 2 + cnt += 1 + + print(cnt)" +p03723,s915518962,Accepted,"A,B,C = list(map(int,input().split())) +count = 0 +if A%2 == 1 or B%2 == 1 or C%2 == 1: + print(0) + exit() +if A == B == C: + print(-1) + exit() +while True: + if A%2 == 1 or B%2 == 1 or C%2 == 1: + break + A_half = A//2 + B_half = B//2 + C_half = C//2 + A = B_half+C_half + B = A_half+C_half + C = A_half+B_half + count += 1 +print(count)" +p03723,s701640583,Accepted,"A, B, C = map(int, input().split()) + + +count = 0 +while True: + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(count) + break + if A == B == C: + print(-1) + break + A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2 + count += 1 +" +p03723,s050530297,Accepted,"a, b, c = map(int, input().split()) +if a == b and b == c: + if a % 2 == 0: + print(-1) + else: + print(0) +else: + count = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2 + count += 1 + print(count)" +p03723,s423118390,Accepted,"A,B,C=map(int,input().split()) + +k=0 +if A%2==B%2==C%2==0 and A==B==C: + k=-1 +else: + while A%2==B%2==C%2==0: + a=A + b=B + c=C + A=(b+c)/2 + B=(a+c)/2 + C=(a+b)/2 + k+=1 + +print(k)" +p03723,s882972647,Accepted,"A, B, C = map(int, input().split()) + +if A%2 == 0 and A == B and A == C: + print(-1) +else: + N = 0 + while A%2 == B%2 == C%2 == 0: + N += 1 + A, B, C = (B + C)/2, (C + A)/2, (A + B)/2 + print(N) +" +p03723,s220421647,Accepted,"A,B,C=map(int,input().split()) + +a=0 +D=set() +while True: + if A%2!=0 or B%2!=0 or C%2!=0: + break + if (A,B,C) in D: + a=-1 + break + else: + D.add((A,B,C)) + p=(B+C)/2 + q=(A+C)/2 + r=(A+B)/2 + A=p;B=q;C=r + a+=1 +print(a)" +p03723,s451986622,Accepted,"A,B,C = map(int, input().split()) + +def even(a): + if a % 2 == 0: + return True + else: + return False + +cnt = 0 + +while even(A) and even(B) and even(C): + if A == B and B == C: + cnt = -1 + break + else: + tmp1, tmp2, tmp3 = A,B,C + A = (tmp2+tmp3) // 2 + B = (tmp3+tmp1) // 2 + C = (tmp1+tmp2) // 2 + cnt += 1 + +print(cnt) + +" +p03723,s396376457,Accepted,"def existOdd(lst): + for i in lst: + if i%2==1: + return False + return True + +cookie=list(map(int,input().split())) +seen=[] +res=0 +while existOdd(cookie): + seen.append(cookie) + cookie=[cookie[1]/2+cookie[2]/2,cookie[0]/2+cookie[2]/2,cookie[0]/2+cookie[1]/2] + if cookie in seen: + res=-1 + break + res+=1 + +print(res) +" +p03723,s734327370,Accepted,"a,b,c = map(int, input().split()) +INF = 10**4 +cnt = 0 +while a%2==0 and b%2==0 and c%2==0: + # print(cnt) + if cnt == INF: + print(-1) + exit() + x = a + (b+c)//2 + y = b + (c+a)//2 + z = c + (a+b)//2 + a,b,c = x,y,z + cnt+=1 +print(cnt)" +p03723,s179477879,Accepted,"a, b, c = map(int, input().split()) + +a0, b0, c0 = a, b, c +a1, b1, c1 = 0, 0, 0 + +cnt = 0 +while True: + if a0%2==1 or b0%2==1 or c0%2==1: + print(cnt) + exit() + + a1 = b0//2 + c0//2 + b1 = a0//2 + c0//2 + c1 = a0//2 + c0//2 + + a0 = a1 + b0 = b1 + c0 = c1 + + cnt += 1 + + if a1 == a and b1 == b and c1 == c: + print(-1) + exit() + +" +p03723,s366319723,Accepted,"l = list(map(int,input().split())) +ans = 0 +if l[0] == l[1] == l[2] and all(i % 2 == 0 for i in l): + print(-1) + exit() +while all(i % 2 == 0 for i in l): + l[0], l[1], l[2] = l[1]//2 + l[2]//2, l[0]//2 + l[2]//2, l[0]//2 + l[1]//2 + ans += 1 +print(ans)" +p03723,s378083537,Accepted,"import sys +A,B,C = map(int,input().split()) +result = 0 +if A * B * C % 2 == 1: + print(0) + sys.exit() +elif A == B and B == C: + print(-1) + sys.exit() +else: + while A % 2 == B % 2 and B % 2 == C % 2 and C % 2 == 0: + a = (B + C) // 2 + b = (C + A) // 2 + c = (A + B) // 2 + A,B,C = a,b,c + result += 1 +print(result) +" +p03723,s520006499,Accepted,"a,b,c = map(int,input().split()) +cou = 0 +if a%2==0 and a==b and b==c and c==a : + print(-1) + exit() +while a%2==0 and b%2==0 and c%2==0: + j=int(a//2) + k=int(b//2) + m=int(c//2) + a += k+m + b += j+m + c += j+k + cou += 1 +print(cou)" +p03723,s560575433,Accepted,"from time import time +t = time() +count = 0 +a,b,c = map(int,input().split()) +while True: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(count) + exit() + count += 1 + a1 = b//2+c//2 + b1 = c//2+a//2 + c1 = a//2+b//2 + a = a1 + b = b1 + c = c1 + if time()-t >= 1.8: + print(-1) + exit()" +p03723,s102868411,Accepted,"A,B,C=map(int,input().split()) + +count=0 +while True: + if A==B and B==C: + if A%2 == 0: + count=-1 + break + elif A%2==1 or B%2==1 or C%2==1: + break + else: + A,B,C=(B+C)//2,(A+C)//2,(A+B)//2 + count+=1 + pass +print(count)" +p03723,s327527539,Accepted,"a,b,c=map(int,input().split()) + +if a==b==c and a%2==0: + print(-1) +else: + num=0 + while True: + if a%2==1 or b%2==1 or c%2==1: + break + num+=1 + l0=(b+c)/2 + l1=(c+a)/2 + l2=(a+b)/2 + a,b,c=l0,l1,l2 + print(num)" +p03723,s338766389,Accepted,"a,b,c = map(int, input().split()) +val = 0 +if a == b == c and a%2 == 0 and b%2 == 0 and c%2 == 0: + print(-1) +else: + while a%2 == 0 and b%2 == 0 and c%2 == 0: + a,b,c = int((b+c)/2), int((a+c)/2), int((a+b)/2) + val += 1 + print(val)" +p03723,s754286681,Accepted,"a, b, c = map(int, input().split()) +if a == b == c: + if a % 2: + print(0) + else: + print(-1) +else: + ans = 0 + while a % 2 == b % 2 == c % 2 == 0: + ans += 1 + a, b, c = b // 2 + c // 2, a // 2 + c // 2, a // 2 + b // 2 + print(ans) +" +p03723,s894142098,Accepted,"a,b,c = map(int,input().split()) +cnt = 0 + +if a == b and a== c and a%2 == 0: + print(-1) + exit() + +while a%2 == 0 and b%2 == 0 and c%2 == 0: + cnt+=1 + i=a + j=b + a=(b+c)//2 + b=(i+c)//2 + c=(i+j)//2 + +print(cnt)" +p03723,s753739703,Accepted,"a,b,c = map(int,(input().split())) +cnt = 0 + +while a%2==0 and b%2==0 and c%2==0: + if a == b == c : + cnt = -1 + break + ta,tb,tc = a,b,c + a = tb/2 + tc/2 + b = ta/2 + tc/2 + c = ta/2 + tb/2 + cnt += 1 + +print(cnt) +" +p03723,s824830975,Accepted,"A, B, C = map(int, input().split()) +for i in range(100): + if A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = B+C>>1, C+A>>1, A+B>>1 + else: + print(i) + break +else: + print(-1)" +p03723,s084554307,Accepted,"A, B, C = map(int, input().split()) +if A == B == C and A % 2 == 0: + print(-1) +else: + count = 0 + while 0 == A % 2 == B % 2 == C % 2: + _A = (B + C) // 2 + _B = (C + A) // 2 + _C = (A + B) // 2 + A = _A + B = _B + C = _C + count += 1 + # print(""A: {}, B: {}, C: {}"".format(A, B, C)) + print(count) + +" +p03723,s412883894,Accepted,"A,B,C = map(int,input().split()) +cnt = 0 + +while(cnt<=10**6): + if A%2==0 and B%2==0 and C%2==0: + mm1 = (B//2+C//2) + mm2 = (A//2+C//2) + mm3 = (A//2+B//2) + A,B,C = mm1,mm2,mm3 + cnt += 1 + else: + break + +if cnt==10**6+1: + print(-1) +else: + print(cnt)" +p03723,s701582516,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +for i in range(10 ** 5): + if (a % 2 == 1) or (b % 2 == 1) or (c % 2 == 1): + print(ans) + exit() + tmpa = a + tmpb = b + tmpc = c + a = (tmpb // 2) + (tmpc // 2) + b = (tmpc // 2) + (tmpa // 2) + c = (tmpa // 2) + (tmpb // 2) + ans += 1 +print(-1) +" +p03723,s452274181,Accepted,"A, B, C = map(int,input().split()) + +if A == 1 and B == 1 and C == 1: + print(0) + exit() + +elif A == B == C: + print(-1) + exit() + +LA = [] +LB = [] +LC = [] +LA.append(A) +LB.append(B) +LC.append(C) +i = 0 +cnt = 0 + +while LA[i] % 2 == 0 and LB[i] % 2 == 0 and LC[i] % 2 == 0: + LA.append((LB[i]+LC[i])/2) + LB.append((LC[i]+LA[i])/2) + LC.append((LA[i]+LB[i])/2) + i += 1 + cnt += 1 + +print(cnt)" +p03723,s178130825,Accepted,"a, b, c = list(map(int, input().split())) +l = [a, b, c] + + +time_of_exchange = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + + if a == b == c: + time_of_exchange = -1 + break + + a = (l[1] + l[2]) / 2 + b = (l[0] + l[2]) / 2 + c = (l[0] + l[1]) / 2 + l = [a, b, c] + + time_of_exchange += 1 + +print(time_of_exchange) + +" +p03723,s340373423,Accepted,"import sys +a,b,c=map(int,input().split()) +ans=0 +if a%2==1 or b%2==1 or c%2==1: + print(0) + sys.exit() +if a%2==0 and a==b==c: + print(-1) + sys.exit() +while a%2==0 and b%2==0 and c%2==0: + ta=a/2 + tb=b/2 + tc=c/2 + a=tb+tc + b=ta+tc + c=ta+tb + ans+=1 +print(ans)" +p03723,s390257732,Accepted,"A, B, C = map(int, input().split()) +T = [A, B, C] +T.sort() +count = 0 + +def trade(T, count): + Ts = [0]*3 + if T[0] == T[1] == T[2] and T[0]%2==0: + return -1 + elif T[0]%2 != 0 or T[1]%2 != 0 or T[2]%2 != 0: + return count + else: + count += 1 + Ts[0] = (T[1]+T[2])/2 + Ts[1] = (T[0]+T[2])/2 + Ts[2] = (T[0]+T[1])/2 + return trade(Ts, count) + +print(trade(T, count)) + +" +p03723,s528454349,Accepted,"# coding: utf-8 +A, B, C = map(int, input().split()) +count = 0 + +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B == C: + print(-1) + exit() + count += 1 + A1 = A + B1 = B + C1 = C + A = B1//2 + C1//2 + B = A1//2 + C1//2 + C = A1//2 + B1//2 + +print(count)" +p03723,s836775518,Accepted,"a,b,c = map(int,input().split()) + +if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(0) + exit() + +if a == b == c: + print(-1) + exit() + +count = 0 + +while True: + count += 1 + a,b,c = b//2+c//2,a//2+c//2,a//2+b//2 + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + +print(count)" +p03723,s223865179,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 +while True: + if A%2!=0 or B%2!=0 or C%2!=0: + print(cnt) + break + elif A == B and B == C and A == C: + print(-1) + break + else: + temp_A = A + temp_B = B + A = B/2 + C/2 + B = temp_A/2 + C/2 + C = temp_A/2 + temp_B/2 + cnt += 1" +p03723,s509737389,Accepted,"a,b,c=map(int,input().split()) + +if a%2==1 or b%2==1 or c%2==1: + print(0) + exit() +if a==b==c: + print(-1) + exit() +ans=0 +while a%2==0 and b%2==0 and c%2==0: + a,b,c=(b+c)//2,(c+a)//2,(a+b)//2 + ans+=1 +print(ans)" +p03723,s299912241,Accepted,"a, b, c = map(int, input().split()) + +ba = a +bb = b +bc = c +ans = 0 +while True: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + break + + if a==b==c: + ans=-1 + break + ta = a//2 + tb = b//2 + tc = c//2 + a = tb+tc + b = ta+tc + c = ta+tb + ans += 1 + + # if a == ba and b == bb and c == bc: + # ans = -1 + # break + +print(ans) +" +p03723,s613531442,Accepted,"a, b, c = map(int, input().split()) + +if a == b == c and a % 2 == 0: + print(-1) +else: + count = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + count += 1 + temp_a = b // 2 + c // 2 + temp_b = a // 2 + c // 2 + temp_c = a // 2 + b // 2 + a, b, c = temp_a, temp_b, temp_c + print(count) + " +p03723,s242525194,Accepted,"a,b,c=map(int,input().split()) +d=0 +if a==b==c and a%2==0: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 + d+=1 + print(d)" +p03723,s830172152,Accepted,"A,B,C = [int(i) for i in input().split()] + +if A==B==C and A%2==0: + print(-1) +else: + ans = 0 + while 1: + if A%2==1 or B%2==1 or C%2 ==1: + print(ans) + break + tempA = A//2 + tempB = B//2 + A = tempB + C//2 + B = tempA + C//2 + C = tempA + tempB + ans+=1 +" +p03723,s666698766,Accepted,"l = list(map(int,input().split())) +count = 0 +while True: + if l[0] == l[1] == l[2]: + if l[1]%2 == 0: + print(-1) + exit() + for i in range(3): + if l[i]%2 == 1: + print(count) + exit() + count += 1 + l[0],l[1],l[2] = (l[1]+l[2])//2,(l[0]+l[2])//2,(l[1]+l[0])//2 + + +" +p03723,s573164152,Accepted,"A, B, C = map(int, input().split()) +count = 0 +ABC = [] +while True: + if A % 2 ==0 and B % 2 == 0 and C % 2 == 0: + nA = B/2 + C/2 + nB = A/2 + C/2 + nC = A/2 + B/2 + A, B, C = nA, nB, nC + count += 1 + if [A, B, C] in ABC: + count = -1 + break + ABC.append([A, B, C]) + else: + break +print(count)" +p03723,s518760887,Accepted,"a,b,c = map(int,input().split()) +r = 0 +if a == b == c: + if a%2 == 1: + print(r) + exit() + else: + print(-1) + exit() + +while True: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + r += 1 + aa = (b+c)//2 + bb = (a+c)//2 + cc = (a+b)//2 + a,b,c = aa,bb,cc + +print(r)" +p03723,s158153961,Accepted,"A,B,C=map(int,input().split()) +if A==B==C and A%2==B%2==C%2==0: + print('-1') +elif A%2!=0 or B%2!=0 or C%2!=0: + print('0') +else: + ans=0 + while A%2==0 and B%2==0 and C%2==0: + a=A + b=B + c=C + A=int((b+c)/2) + B=int((c+a)/2) + C=int((a+b)/2) + ans+=1 + print(ans) + " +p03723,s333080118,Accepted,"a, b, c = map(int, input().split()) + +if a == b == c: + if a % 2: + print(0) + else: + print(-1) +else: + cnt = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + na = (b+c)//2 + nb = (a+c)//2 + nc = (a+b)//2 + cnt += 1 + a = na; b = nb; c = nc + print(cnt)" +p03723,s428038338,Accepted,"A,B,C=map(int,input().split()) + +Q=0 +if A==B and B==C and C==A: + if A%2==1 or B%2==1 or C%2==1: + print(0) + elif A%2==0 or B%2==0 or C%2==0: + print(-1) +else: + for i in range(100): + if A%2==1 or B%2==1 or C%2==1: + print(Q) + break + else: + A,B,C=(B+C)//2,(C+A)//2,(A+B)//2 + Q+=1 + + +" +p03723,s651245095,Accepted,"A,B,C = list(map(int,input().split())) +if A==B==C: + if A%2 == 0: + print(-1) + else: + print(0) +else: + count = 0 + while not A%2 and not B%2 and not C%2: + if (B+C)%2 or (A+C)%2 or (A+B)%2: + break + A,B,C = (B+C)//2,(A+C)//2,(A+B)//2 + count += 1 + print(count)" +p03723,s330356878,Accepted,"import sys +from collections import defaultdict + +A, B, C = map(int, input().split()) + +cnt = 0 +memo = defaultdict(int) + +while (A % 2 != 1) & (C % 2 != 1) & (C % 2 != 1): + if memo[(A, B, C)]==1: + print(-1) + sys.exit() + tmp_a = A // 2 + tmp_b = B // 2 + tmp_c = C // 2 + memo[(A, B, C)] = 1 + A = tmp_b + tmp_c + B = tmp_c + tmp_a + C = tmp_a + tmp_b + cnt += 1 + +print(cnt)" +p03723,s520401973,Accepted,"def exchange(a, b, c): + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + return 0 + + if a == b == c: + return -1 + + return exchange((b + c) / 2, (c + a) / 2, (a + b) / 2) + 1 + + +def main(): + a, b, c = map(int, input().split()) + + ans = exchange(a, b, c) + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p03723,s938439422,Accepted,"A,B,C=map(int,input().split()) +if A==B and B==C and A%2==0: + print(-1) +elif A%2==1 or B%2==1 or C%2==1: + print(0) +else: + ans=0 + flag=0 + d=0 + while flag==0: + if (A>>d &1)==(B>>d &1) and (C>>d &1)==(B>>d &1): + d+=1 + else: + ans=d + break + print(ans) +" +p03723,s296961549,Accepted,"a, b, c = map(int,input().split()) +ans = 0 + +if a == b == c and a%2 == 0: + print(-1) #無限 + exit() + +while a%2 == 0 and b%2 == 0 and c%2 == 0: + ans += 1 + + x = b//2 + c//2 + y = a//2 + c//2 + z = a//2 + b//2 + + a = x + b = y + c = z + +print(ans) +" +p03723,s932003938,Accepted,"def solve(): + A, B, C = map(int, input().split()) + + cnt = 0 + while True: + if A % 2 or B % 2 or C % 2: + return cnt + ta = B // 2 + C // 2 + tb = A // 2 + C // 2 + tc = A // 2 + B // 2 + if ta == A and tb == B and tc == C: + return -1 + A, B, C = ta, tb, tc + cnt += 1 + + +print(solve())" +p03723,s558403555,Accepted,"*l, = map(int, input().split()) + +ans = 0 +while True: + if l[0]%2 or l[1]%2 or l[2]%2: + break + a = (l[1] + l[2]) // 2 + b = (l[0] + l[2]) // 2 + c = (l[0] + l[1]) // 2 + if l == [a, b, c]: + ans = -1 + break + l = [a, b, c] + ans += 1 + +print(ans)" +p03723,s641752027,Accepted,"A, B, C = map(int, input().split()) +X = (A|B|C)^(A&B&C) +ans = (X&-X).bit_length()-1 +print(0 if (A|B|C)&1 else ans) +" +p03723,s585311359,Accepted,"# n , m , l = map(int , input().split()) + +# list_n = list(map(int , inpuut().split())) + +# n = input() +# list = [input() for i in range(N) + +# list = [[i for i in range(N)] for _ in range(M)] + + +A, B, C = map(int, input().split()) + +n = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B and B == C: + n = -1 + break + + An = (B + C) // 2 + Bn = (A + C) // 2 + Cn = (A + B) // 2 + + A = An + B = Bn + C = Cn + n += 1 + +print(n) +" +p03723,s882812339,Accepted,"li = list(map(int,input().split())) +nx = [0,0,0] +ans = 0 +if all(x&1 == 0 for x in li) and li[0] == li[1] == li[2]: + print(-1) +else: + while 1: + if(li[0]%2!=0 or li[1]%2!=0 or li[2]%2!=0): + break + nx[0] = (li[1] + li[2])/2 + nx[1] = (li[0] + li[2])/2 + nx[2] = (li[0] + li[1])/2 + li = nx.copy() + ans += 1 + print(ans) + + + + + +" +p03723,s787952561,Accepted,"import sys +A,B,C=map(int,input().split()) +cnt=0 +A_old=B_old=C_old=0 +for i in range(100000000): + if A%2==1 or B%2==1 or C%2==1: + print(cnt) + sys.exit() + elif A==A_old and B==B_old and C==C_old: + print(-1) + sys.exit() + + A_old=A + B_old=B + C_old=C + A=C_old/2+B_old/2 + B=A_old/2+C_old/2 + C=A_old/2+B_old/2 + cnt+=1 +" +p03723,s125104737,Accepted,"a, b, c = map(int, input().split()) + +count = 0 + +for _ in range(1000000): + + _a, _am = divmod(a, 2) + _b, _bm = divmod(b, 2) + _c, _cm = divmod(c, 2) + + if _am or _bm or _cm: + print(count) + break + elif a == b == c: + print(-1) + break + else: + a = _b + _c + b = _a + _c + c = _a + _b + count += 1 +else: + print(-1)" +p03723,s582964885,Accepted,"A,B,C =map(int,input().split()) +con = 0 +if A % 2 == 1 or B % 2 == 1 or C % 1 == 1: + print(0) + exit() +if A == B and B == C: + print(-1) + exit() +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + con += 1 + D = A / 2 + E = B / 2 + F = C / 2 + A = E + F + B = D + F + C = D + E +print(con)" +p03723,s349991182,Accepted,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e!=b%2)*len(f'{(e&-e):b}')-1)" +p03723,s175123917,Accepted,"import sys + +sys.setrecursionlimit(10 ** 8) + +input = sys.stdin.readline + + +def main(): + A, B, C = [int(x) for x in input().split()] + + cnt = 0 + while True: + if cnt > 10 ** 5: + print(-1) + return + + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(cnt) + return + + A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2 + cnt += 1 + + +if __name__ == '__main__': + main() +" +p03723,s638129225,Accepted,"a,b,c = map(int, input().split()) +if a==b==c and a%2 ==0: + print(-1) +else: + res = 0 + while True: + if a%2 != 0 or b%2 != 0 or c%2 != 0: + break + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + res += 1 + print(res)" +p03723,s065685121,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(0) +elif a == b == c: + print(-1) +else: + num = 0 + while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)/2, (a+c)/2, (a+b)/2 + num += 1 + print(num)" +p03723,s093596053,Accepted,"a,b,c = map(int,input().split()) + +cnt = 0 + +if a==b==c and a%2==0: + print(""-1"") + exit() + +for i in range(10**6): + if a%2==0 and b%2==0 and c%2==0: + tmpA = b/2 + c/2 + tmpB = a/2 + c/2 + tmpC = a/2 + b/2 + a = tmpA + b = tmpB + c = tmpC + cnt +=1 + else: + print(cnt) + break + " +p03723,s926117047,Accepted,"A, B, C = map(int, input().split()) +if A == B and B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + print(-1) +else: + ans = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + a = A // 2 + b = B // 2 + c = C // 2 + A = b + c + B = c + a + C = a + b + ans += 1 + if ans > 10**5: + print(-1) + exit() + print(ans)" +p03723,s306906054,Accepted,"a, b, c = map(int, input().split()) + +count = 0 + +while True: + if a%2 == b%2 == c%2 == 0: + if a == b == c: + print(-1) + exit() + a, b, c = (b+c)/2, (a+c)/2, (a+b)/2 + count += 1 + else: + break + +print(count)" +p03723,s868791764,Accepted,"x = list(map(int,input().split())) +point = 0 +def count(x,point): + if x[0]%2 == 1 or x[1]%2 == 1 or x[2]%2 == 1: + return(point) + else: + point += 1 + x = [(x[0]+x[1])/2,(x[0]+x[2])/2, (x[1]+x[2])/2] + return(count(x,point)) + +if x[0] == x[1] == x[2] and x[0]%2==0: + print(-1) +else: + print(count(x,point))" +p03723,s663291826,Accepted,"def f(a,b,c): + if a%2+b%2+c%2>0: + return 0 + if a==b==c: + return -1 + return f((b+c)//2,(c+a)//2,(a+b)//2)+1 + +a,b,c=map(int,input().split()) +print(f(a,b,c)) +" +p03723,s032037601,Accepted,"a, b, c = list(map(int, input().split())) +if a == b == c and a % 2 == 0: + print(-1) + exit() +count = 0 +while True: + if sum([a % 2, b % 2, c % 2]) > 0: + print(count) + exit() + else: + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + count += 1" +p03723,s794063832,Accepted,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print(bool(e|b%2)*(e^~-e).bit_length()-1)" +p03723,s854610872,Accepted,"a,b,c = map(int,input().split()) +if a == b == c and a%2 == 0: + print(-1) + exit() +for i in range(10**8): + if a%2 != 0 or b%2 != 0 or c%2 != 0: + break + a_o,b_o,c_o = a,b,c + a = b_o//2 + c_o//2 + b = a_o//2 + c_o//2 + c = a_o//2 + b_o//2 +print(i)" +p03723,s206876257,Accepted,"import sys +def input(): return sys.stdin.readline().rstrip() +def main(): + a,b,c=map(int,input().split()) + cunt=0 + if a==b and b==c and a%2==0: + print(-1) + sys.exit() + while True: + if a%2 or b%2 or c%2: + print(cunt) + break + cunt+=1 + a1,b1,c1=a,b,c + a=(b1+c1)//2 + b=(a1+c1)//2 + c=(a1+b1)//2 + +if __name__=='__main__': + main()" +p03723,s137896376,Accepted,"X=[int(x) for x in input().split()] +count=0 +if ((X[0]%2-1)*(X[1]%2-1)*(X[2]%2-1)!=0 and X[0]==X[1] and X[1]==X[2]): + count=-1 +else: + while((X[0]%2-1)*(X[1]%2-1)*(X[2]%2-1)!=0): + Y=[0,0,0] + Y[0]=(X[1]+X[2])/2 + Y[1]=(X[0]+X[2])/2 + Y[2]=(X[1]+X[0])/2 + X=Y + count =count+1 +print(count) " +p03723,s568861783,Accepted,"a,b,c=map(int,input().split()) +ans=0 +while a%2==0 and b%2==0 and c%2==0: + d,e,f=0,0,0 + d=(b+c)//2 + e=(a+c)//2 + f=(a+b)//2 + a,b,c=d,e,f + ans+=1 + if ans==100000: + ans=(-1) + break +print(ans) +" +p03723,s875684155,Accepted,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0 and b%2==0 and c%2==0: + print(-1) +else: + p=0 + while a%2==0 and b%2==0 and c%2==0: + aa=(b+c)//2 + bb=(c+a)//2 + cc=(b+c)//2 + a,b,c=aa,bb,cc + p+=1 + print(p)" +p03723,s117754261,Accepted,"a, b, c = map(int, input().split()) + +count = 0 +while True: + if a == b == c and a%2 == 0: + count = -1 + break + + if a%2 == 0 and b%2 == 0 and c%2 == 0: + count += 1 + a, b, c = (b + c)//2, (a + c)//2, (a + b)//2 + else: + break + +print(count) +" +p03723,s397187024,Accepted,"#13 +a,b,c = map(int,input().split()) +cnt = 0 +if a%2 == 1 or b%2 == 1 or c%2 == 1: + print('0') + +elif a==b==c and a%2==0: + print('-1') + +elif not a==b==c: + while a%2 == b%2 == c%2 == 0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + cnt+=1 + print(cnt)" +p03723,s578129917,Accepted,"A = list(map(int, input().split())) +ans = 0 +if A[0] == A[1] == A[2]: + if A[0] % 2 == 0: ans = -1 + else: ans = 0 +else: + ans = 0 + ok = True + a = b = c = 0 + while ok: + if A[0] % 2 != 0 or A[1] % 2 != 0 or A[2] % 2 != 0: + ok = False + a = (A[1] + A[2]) / 2 + b = (A[0] + A[2]) / 2 + c = (A[0] + A[1]) / 2 + if ok: + A = [a, b, c] + ans += 1 +print(ans)" +p03723,s407177771,Accepted,"#!/usr/bin/env python3 + +A,B,C = [int(x) for x in input().split("" "")] + +ans = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ans += 1 + A_new = B / 2 + C / 2 + B_new = A / 2 + C / 2 + C_new = A / 2 + B / 2 + if A == A_new and B == B_new and C == C_new: + ans = -1 + break + A = A_new + B = B_new + C = C_new + +print(ans) +" +p03723,s096491190,Accepted,"a, b, c = map(int, input().split()) + +if a%2==0 and b%2==0 and c%2==0 and a==b==c: + print(-1) +else: + res = 0 + while True: + if a%2==1 or b%2==1 or c%2==1: + break + else: + a, b, c = b//2+c//2, a//2+c//2, a//2+b//2 + res += 1 + print(res) +" +p03723,s715028605,Accepted,"import sys +a,b,c=map(int,input().split()) +if a%2==1 or b%2==1 or c%2==1: + print(0) + sys.exit(0) +elif a==b and b==c: + print(-1) + sys.exit(0) +ans=0 +for i in range(1,10000): + x=a//2 + y=b//2 + z=c//2 + a=y+z + b=x+z + c=x+y + if a%2==1 or b%2==1 or c%2==1: + ans=i + break +print(ans)" +p03723,s046486391,Accepted,"A,B,C = map(int,input().split()) +cnt = 0 +if A == B and B == C and A % 2 == 0: + print(-1) + exit() +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + a = A / 2 + b = B / 2 + c = C / 2 + A = b + c + B = a + c + C = a + b + cnt+=1 +print(cnt)" +p03723,s117819099,Accepted,"A, B, C = list(map(int, input().split())) + +if not (A % 2 == 0 and B % 2 == 0 and C % 2 == 0): + print(0) +elif A == B == C: + print(-1) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + c += 1 + A2 = (B + C) // 2 + B2 = (A + C) // 2 + C2 = (A + B) // 2 + + A = A2 + B = B2 + C = C2 + # print(A, B, C) + print(c)" +p03723,s953390080,Accepted,"from sys import exit +a,b,c = map(int,input().split()) +cnt = 0 +while ~a&1 and ~b&1 and ~c&1: + newa = b//2+c//2 + newb = a//2+c//2 + newc = a//2+b//2 + a,b,c = newa,newb,newc + cnt += 1 + if cnt >= 10**5: + exit(print(-1)) +print(cnt)" +p03723,s821588749,Accepted,"a, b, c = map(int, input().split()) + +if a == b and b == c and a % 2 == 0: + print(-1) + exit() + +OK = True +count = 0 + +while OK: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + OK = False + break + diva = a//2 + divb = b//2 + divc = c//2 + a = divb + divc + b = divc + diva + c = diva + divb + count += 1 + +print(count)" +p03723,s380159766,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +while a%2==b%2==c%2==0: + a,b,c = (b+c)//2, (a+c)//2, (a+b)//2 + ans += 1 + if ans > 100: + ans = -1 + break +print(ans)" +p03723,s250346229,Accepted,"x,y,z=list(map(int, input().split())) +a=x +b=y +c=z +cnt=0 +for i in range(100): + if a%2==0 and b%2==0 and c%2==0: + x=b//2+c//2 + y=a//2+c//2 + z=a//2+b//2 + a=x + b=y + c=z + cnt=cnt+1 +if cnt>30: + cnt=-1 +print(cnt)" +p03723,s357813340,Accepted,"l = list(map(int,input().split())) +ans = 0 +if l[0] == l[1] == l[2] and l[0] % 2 == 0: + print(-1) + exit() +while all(i % 2 == 0 for i in l): + l[0], l[1], l[2] = l[1]//2 + l[2]//2, l[0]//2 + l[2]//2, l[0]//2 + l[1]//2 + ans += 1 +print(ans)" +p03723,s171479024,Accepted,"a,b,c=map(int,input().split()) +ta,ao,su=a,b,c +cnt=0 +f=True +while f: + if ta%2!=0 or ao%2!=0 or su%2!=0: + f=False + elif ta==ao==su: + f=False + cnt=-1 + else: + ta=(b+c)/2 + ao=(a+c)/2 + su=(a+b)/2 + cnt+=1 + a=ta + b=ao + c=su +print(cnt)" +p03723,s882816812,Accepted,"a, b, c = map(int, input().split()) + +count = 0 +while all([a % 2 == 0, b % 2 == 0, c % 2 == 0]): + if a == b and b == c: + print(-1) + exit() + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + count += 1 + +print(count)" +p03723,s361619672,Accepted,"a,b,c = map(int, input().split()) +if a == b == c: + if a % 2 == 1: + print(0) + else: + print(-1) +else: + ans = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + next_a = b//2 + c//2 + next_b = a//2 + c//2 + next_c = a//2 + b//2 + a = next_a + b = next_b + c = next_c + ans += 1 + print(ans) + " +p03723,s409850923,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +if a == b == c and a%2 == 0: + print(-1) + exit() +while a%2 == b%2 == c%2 == 0: + x,y,z = a//2, b//2, c//2 + a = y + z + b = x + z + c = x + y + ans += 1 +print(ans) +" +p03723,s690786784,Accepted,"import sys + +input = sys.stdin.readline + +def main(): + ans = 0 + a, b, c = map(int, input().split()) + while a%2 == b%2 == c%2 == 0: + ans += 1 + a, b, c = (b//2 + c//2), (a//2 + c//2), (a//2 + b//2) + if a == b == c: + ans = -1 + break + + print(ans) + +if __name__ == '__main__': + main()" +p03723,s517244972,Accepted,"a,b,c = map(int,input().split()) +s = [a,b,c] +ans = 0 + +while a%2 + b%2 + c%2 == 0: + na = (b + c) // 2 + nb = (a + c) // 2 + nc = (a + b) // 2 + + if [na,nb,nc] == s: + ans = -1 + break + + else: + a = na + b = nb + c = nc + ans += 1 + +print(ans)" +p03723,s842347099,Accepted,"A,B,C = [int(i) for i in input().split()] +if A == B == C and not A&1: + print(-1) + exit() +c = 0 +while not (A&1 or B&1 or C&1): + A,B,C = (B+C)//2, (A+C)//2, (A+B)//2 + c += 1 +print(c)" +p03723,s630420935,Accepted,"a,b,c = map(int,input().split()) +cnt = 0 +def f(a,b,c): + return b//2 + c//2, a//2 + c//2, a//2 + b//2 + +while (a%2==0 and b%2==0 and c%2==0): + if a==b and b==c and c==a: + print('-1') + exit() + else: + cnt += 1 + a,b,c = f(a,b,c) +print(cnt)" +p03723,s734129537,Accepted,"a,b,c=map(int,input().split()) +if a%2==1 or b%2==1 or c%2==1: + print(0) +elif a==b==c: + print(-1) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + ans+=1 + a1=(b+c)//2 + b1=(c+a)//2 + c1=(a+b)//2 + a=a1 + b=b1 + c=c1 + print(ans)" +p03723,s454414681,Accepted,"a,b,c=map(int,input().split()) + +if a%2!=0 or b%2!=0 or c%2!=0: + print(0) + exit() +elif a==b==c: + print(-1) + exit() + +ans=0 + +while a%2==0 and b%2==0 and c%2==0: + num_a,num_b,num_c=a/2,b/2,c/2 + a=num_b+num_c + b=num_a+num_c + c=num_a+num_b + ans+=1 +print(ans) +" +p03723,s390747235,Accepted,"a,b,c=map(int,input().split()) +# 奇数があったら0回 +if any([q%2==1 for q in (a,b,c)]): + print(0) + exit() +# 全部偶数で等しいと終わらない +if a==b==c: + print(-1) + exit() +# ではなければシミュレーションでOK +cnt=0 +while all([q%2==0 for q in (a,b,c)]): + cnt+=1 + s=a+b+c + a=s-a + a//=2 + b=s-b + b//=2 + c=s-c + c//=2 +print(cnt) +" +p03723,s474906666,Accepted,"a,b,c=map(int,input().split()) +count=0 + +if a==b==c and(a%2==0 and b%2==0 and c%2==0): + print(-1) +else: + while True: + a1=a//2 + b1=b//2 + c1=c//2 + if (a%2==0 and b%2==0 and c%2==0): + count+=1 + a=b1+c1 + b=a1+c1 + c=a1+b1 + else: + print(count) + break" +p03723,s360348138,Accepted,"# A - Cookie Exchanges + +A, B, C = map(int, input().split()) +ans = 0 + +if A==B and B==C and C%2==0: + ans = -1 +else: + while A%2==B%2==C%2==0: + ans += 1 + A, B, C = (B+C)/2, (C+A)/2, (A+B)/2 + +print(ans)" +p03723,s019407501,Accepted,"A,B,C= map(int,input().split()) + +cnt = 0 +if A%2==1 or B%2==1 or C%2==1: + print(cnt) +elif A==B==C: + print('-1') +else: + flag = True + while flag: + A, B, C = (B+C)//2, (A+C)//2, (A+B)//2 + cnt += 1 + if A%2==0 and B%2==0 and C%2==0: + continue + else: + flag = False + + print(cnt)" +p03723,s017275362,Accepted,"A,B,C=map(int,input().split()) +cnt=0 +if(A==B==C): + if A%2!=0: + print(0) + else: + print(-1) + exit() +while(A%2==B%2==C%2==0): + a,b,c=A,B,C + A=b//2+c//2;B=a//2+c//2;C=a//2+b//2 + cnt+=1 +print(cnt)" +p03723,s317495516,Accepted,"def solve(): + A, B, C = map(int, input().split()) + if A == B == C and A % 2 == 0: + return -1 + + cnt = 0 + while True: + if A % 2 or B % 2 or C % 2: + return cnt + A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2 + cnt += 1 + + +print(solve())" +p03723,s333095535,Accepted,"A,B,C = map(int,input().split()) + +if A == B == C: + print(-1 if A%2==0 else 0) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ba = A + bb = B + bc = C + A = (bb + bc)//2 + B = (ba + bc)//2 + C = (ba + bb)//2 + c+=1 + print(c) +" +p03723,s135830992,Accepted,"a,b,c=map(int,input().split()) + +A=[a]+[0]*10**5 +B=[b]+[0]*10**5 +C=[c]+[0]*10**5 + +i=0 +while A[i]%2+B[i]%2+C[i]%2==0: + i+=1 + A[i]=B[i-1]//2+C[i-1]//2 + B[i]=C[i-1]//2+A[i-1]//2 + C[i]=A[i-1]//2+B[i-1]//2 + if A[i]==B[i]==C[i]: + i=-1 + break +print(i)" +p03723,s659093943,Accepted,"a, b, c = map(int, input().split()) +za = 0 +zb = 0 +zc = 0 + +d = 0 + +if a == b == c and a % 2 == 0: + print(-1) + exit() +elif not(a % 2 == 0 and b % 2 == 0 and c % 2 ==0): + print(0) + exit() + + +while a % 2 == 0 and b % 2 == 0 and b % 2 == 0: + + za = a + zb = b + zc = c + + a = zb // 2 + zc // 2 + b = za // 2 + zc // 2 + c = za // 2 + zb // 2 + + d += 1 + +print(d)" +p03723,s667438851,Accepted,"A,B,C =map(int,input().split()) +con = 0 +if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(0) + exit() +if A == B and B == C: + print(-1) + exit() +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + con += 1 + D = A / 2 + E = B / 2 + F = C / 2 + A = E + F + B = D + F + C = D + E + +print(con)" +p03723,s032623544,Accepted,"A,B,C = map(int,input().split(' ')) +num = 0 +if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(0) +elif A == B == C: + print(-1) +elif A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A_c = A + B_c = B + C_c = C + A = B_c /2 + C_c / 2 + B = A_c / 2 + C_c /2 + C = A_c /2 + B_c / 2 + num += 1 + print(num)" +p03723,s861565837,Accepted,"A, B, C = map(int, input().split()) + +count = 0 + +while True: + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B == C: + print(-1) + break + + a = B / 2 + C / 2 + b = A / 2 + C / 2 + c = A / 2 + B / 2 + A = a + B = b + C = c + count += 1 + else: + print(count) + break" +p03723,s738358454,Accepted,"import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines + +A, B, C = map(int, read().split()) + +for t in range(1000): + if A & 1 or B & 1 or C & 1: + break + A, B, C = A // 2, B // 2, C // 2 + A, B, C = B + C, C + A, A + B + +t = -1 if t > 100 else t +print(t)" +p03723,s247999299,Accepted,"cookie = list(map(int,input().split())) + +if len(set(cookie)) == 1 and all([i % 2 == 0 for i in cookie]): + print(-1) +else: + con = 0 + while all([i % 2 == 0 for i in cookie]): + a = cookie[0] // 2 + b = cookie[1] // 2 + c = cookie[2] // 2 + cookie[0] = b + c + cookie[1] = c + a + cookie[2] = a + b + con += 1 + print(con)" +p03723,s087089777,Accepted,"def main(): + a=tuple(map(int,input().split())) + e=set() + while a not in e: + for x in a: + if x % 2 != 0: + print(len(e)) + return + e.add(a) + a=((a[1]+a[2])//2,(a[0]+a[2])//2,(a[0]+a[1])//2) + else: + print(-1) + +if __name__ == ""__main__"": + main()" +p03723,s970533962,Accepted,"A, B, C = map(int, input().split()) + +cnt = 0 +if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + a = A + b = B + c = C + cnt += 1 + A = (b+c) // 2 + B = (c+a) // 2 + C = (a+b) // 2 + print(cnt) +" +p03723,s824934813,Accepted,"a,b,c=map(int,input().split());e=a-b|c-b;print(len(bin(e&-e))-3or~c%-2)" +p03723,s878861578,Accepted,"A, B, C = map(int, input().split()) + +ans = 0 +if A == B == C and A % 2 == 0: + ans = -1 +else: + count = 0 + while (A % 2 == B % 2 == C % 2 == 0): + wA = (B/2 + C/2) + wB = (A/2 + C/2) + wC = (A/2 + B/2) + A = wA + B = wB + C = wC + count += 1 + ans = count + +print(ans) +" +p03723,s354198921,Accepted,"A, B, C = map(int, input().split()) +ans = 0 +if A == B == C and A % 2 == 0: + ans = -1 +else: + while A % 2 == B % 2 == C % 2 == 0: + a = (B + C) / 2 + b = (C + A) / 2 + c = (A + B) / 2 + A, B, C = a, b, c + ans += 1 +print(ans) +" +p03723,s425191446,Accepted,"import sys +a,b,c = map(int,input().split("" "")) +li = [[a,b,c]] +count=0 + +for i in range(10**9): + if (a % 2)==1 or (b % 2)==1 or (c % 2)==1: + break + else: + a2 = a/2 + b2 = b/2 + c2 = c/2 + a = b2+c2 + b = c2+a2 + c = a2+b2 + count += 1 + if [a,b,c] in li: + print(-1) + sys.exit() + else: + li.append([a,b,c]) + +print(count)" +p03723,s539901169,Accepted,"a, b, c = [int(i) for i in input().split()] + +cnt = 0 + +f_a = a +f_b = b +f_c = c + +while(a%2==0 and b%2==0 and c%2==0): + t_a = a + t_b = b + t_c = c + a = (t_b+t_c)/2 + b = (t_c+t_a)/2 + c = (t_a+t_b)/2 + cnt += 1 + if (a == f_a and b == f_b and c == f_c): + cnt = -1 + break + + +print(cnt) +" +p03723,s848300578,Accepted,"A, B, C = map(int, input().split()) + +if A == B and B == C and A % 2 == 0: + print(""-1"") +else: + ans = 0 + while True: + if A%2==1 or B%2==1 or C%2==1: + break + a = B/2 + C/2 + b = A/2 + C/2 + c = A/2 + B/2 + A, B, C = a, b, c + ans += 1 + print(ans) + " +p03723,s848233977,Accepted,"# 13 +A, B, C = input().split(' ') +count = 0 +A = int(A) +B = int(B) +C = int(C) +a = A +b = B +c = C + +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + N=[] + N.append(B/2 + C/2) + N.append(A/2 + C/2) + N.append(A/2 + B/2) + A = N[0] + B = N[1] + C = N[2] + count += 1 + if A == a and B == b and C == c: + print(-1) + break +else: + print(count) +" +p03723,s528871482,Accepted,"a, b, c = map(int, input().split()) + +def f(a, b, c): + if a%2==1 or b%2==1 or c%2==1: + return 0 + if a==b==c: + return -1 + return f((b+c)/2, (c+a)/2, (a+b)/2)+1 +ans = f(a, b, c) +print(ans)" +p03723,s786108791,Accepted,"def main(): + A, B, C = map(int, input().split()) + cnt = 0; flag = False + for _ in range(pow(10,6)): + if A%2 == 1 or B%2 == 1 or C%2 == 1: + flag = True + break + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + cnt += 1 + ans = flag*cnt + (not flag)*(-1) + print(ans) + +if __name__ == ""__main__"": + main() +" +p03723,s728514470,Accepted,"A,B,C=map(int,input().split()) +a=0 +for i in range(10**3): + if A%2==0 and B%2==0 and C%2==0: + a+=1 + A,B,C=(B+C)//2,(A+C)//2,(A+B)//2 + else: + print(a) + break +else: + print(-1) +" +p03723,s400517317,Accepted,"a,b,c=map(int,input().split()) +if a==b and b==c and a%2==0: + print(-1) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + a0,b0,c0=(b+c)//2,(c+a)//2,(a+b)//2 + a,b,c=a0,b0,c0 + ans+=1 + print(ans)" +p03723,s768822751,Accepted,"a,b,c = map(int, input().split()) +ans = 0 +while(a%2==0 and b%2==0 and c%2==0): + if(a==b and b==c and c==a): + ans = -1 + break + else: + a1 = b+c + b1 = a+c + c1 = b+a + a = a1/2 + b = b1/2 + c = c1/2 + ans+=1 + +print(ans)" +p03723,s792386523,Accepted,"A,B,C = map(int, input().split()) +ans = 0 +while 1: + if (A%2,B%2,C%2) == (0,0,0): + if A == B == C: + print(-1) + break + else: + ans += 1 + A,B,C = (B+C)//2,(C+A)//2,(A+B)//2 + else: + print(ans) + break" +p03723,s237412611,Accepted,"import sys +a,b,c = map(int,input().split("" "")) +li = [[a,b,c]] +count=0 + +for i in range(10**2): + if (a % 2)==1 or (b % 2)==1 or (c % 2)==1: + break + else: + a2 = a/2 + b2 = b/2 + c2 = c/2 + a = b2+c2 + b = c2+a2 + c = a2+b2 + count += 1 + if [a,b,c] in li: + print(-1) + sys.exit() + else: + li.append([a,b,c]) + +print(count) +" +p03723,s261091863,Accepted,"a, b, c = map(int, input().split()) +dic = [] +count = 0 + +while all([a%2 == 0, b%2 == 0, c%2 == 0]): + a, b, c = int((b+c)/2), int((a+c)/2), int((c+a)/2) + if (a, b, c) in dic: + count = -1 + break + else: + dic.append((a, b, c)) + count += 1 + +print(count)" +p03723,s396211377,Accepted," +a,b,c = map(int,input().split()) + +count = 0 +for i in range(100): + if a%2==1 or b%2==1 or c%2==1: + break + + count = count + 1 + a_new = (b+c)/2 + b_new = (a + c) / 2 + c_new = (a + b) / 2 + + a = a_new + b = b_new + c = c_new + if i == 99: + count = -1 +print(count)" +p03723,s513640212,Accepted,"A, B, C = map(int, input().split()) +x, y = abs(A-B), abs(B-C) +ans = 0 +if x == 0 and y == 0 and A % 2 == 0: + print(-1) + exit() + +if x == 0 and y == 0 and A % 2 == 1: + print(0) + exit() + +while x % 2 == 0 and y % 2 == 0: + x, y = x // 2, y // 2 + ans += 1 +print(ans)" +p03723,s032528681,Accepted,"a,b,c=map(int,input().split()) +temp=1000 +i=0 +while i 1000: + counter = -1 + break +print(counter)" +p03723,s859728755,Accepted,"A, B, C = input().split("" "") +A, B, C = int(A), int(B), int(C) +ans = 0 +while True: + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(ans) + break + if A == B and B == C: + print(-1) + break + A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2 + ans += 1" +p03723,s129507482,Accepted,"a,b,c=map(int,input().split()) +ans=0 +for i in range(10000): + if a%2==0 and b%2==0 and c%2==0: + tmp1=b//2+c//2 + tmp2=a//2+c//2 + tmp3=a//2+b//2 + a,b,c=tmp1,tmp2,tmp3 + ans+=1 + else: + break + +if ans==10000: + print(-1) +else: + print(ans)" +p03723,s162275469,Accepted,"#!/usr/bin/env python3 +a, b, c = map(int, input().split()) +if True: + cnt = 0 + while True: + if a % 2 or b % 2 or c % 2: + break + if cnt > 10 ** 3: + break + cnt += 1 + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + if cnt < 10 ** 3: + print(cnt) + else: + print(-1) +" +p03723,s957051023,Accepted,"a,b,c = map(int,input().split()) +count = 0 +if a==b and b==c: + if a%2==1: + count = 0 + else: + count = -1 +else: + while True: + if a%2==1 or b%2==1 or c%2==1: + break + d = a;e = b + a = b//2 + c//2 + b = d//2 + c//2 + c = d//2 + e//2 + count += 1 +print(count)" +p03723,s613914207,Accepted,"A, B, C = map(int, input().split()) +ans = 0 + +while 1: + if A % 2 == 1: + break + if B % 2 == 1: + break + if C % 2 == 1: + break + a = B / 2 + C / 2 + b = A / 2 + C / 2 + c = A / 2 + B / 2 + ans += 1 + if a == A and b == B and C == c: + ans = -1 + break + else: + A = a + B = b + C = c +print(ans)" +p03723,s767289035,Accepted,"A,B,C = map(int,input().split()) + +ans = 0 + +while (A%2 == 0) & (B%2 == 0) & (C%2 == 0): + if (A==B) & (B==C) : + ans = -1 + break + + a = (B+C)/2 + b = (A+C)/2 + c = (A+B)/2 + A = a + B = b + C = c + ans += 1 + +print(ans)" +p03723,s830949665,Accepted,"a,b,c = map(int,input().split()) +flag = 1 +cnt = 0 + +if a == b == c and a % 2 == 0: + print(""-1"") +else: + while flag: + if a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a,b,c = a/2 + b/2, b/2 + c/2, c/2 + a/2 + cnt += 1 + else: + flag = 0 + print(cnt)" +p03723,s460877617,Accepted,"a,b,c=map(int,input().split()) + +ans=0 +while a%2==0 and b%2==0 and c%2==0: + if a==b==c: + print(-1) + exit(0) + aa=a/2 + bb=b/2 + cc=c/2 + a=bb+cc + b=aa+cc + c=bb+aa + ans+=1 +print(ans)" +p03723,s741017275,Accepted,"import sys +a,b,c = map(int,input().split()) + +if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(0) + sys.exit() +if a==b==c: + print(-1) + sys.exit() + +C = 1 +while 1: + a, b, c = b//2 + c//2 , a//2 + c//2 , b//2 + a//2 + if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(C) + sys.exit() + else: + C += 1" +p03723,s216532807,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 +while True: + if A == B == C and not (A % 2 != 0 or B % 2 != 0 or C % 2 != 0): + print(-1) + break + elif A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(cnt) + break + cnt += 1 + A, B, C = int(B/2 + C/2), int(A/2 + C/2), int(B/2 + A/2) +" +p03723,s517984013,Accepted,"A, B, C = map(int, input().split()) +count=0 + +if A == B == C ==1: + print(0) + +elif A == B == C: + print(-1) + +else: + while A%2==0 and B%2==0 and C%2==0: + a = A + b = B + c = C + A = b/2 + c/2 + B = a/2 + c/2 + C = a/2 + b/2 + count += 1 + + print(count) +" +p03723,s275343463,Accepted,"a, b, c = map(int, input().split()) +ans = -1 +for i in range(114514): + if a % 2 == b % 2 == c % 2 == 0: + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + else: + ans = i + break +print(ans)" +p03723,s337586728,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +while a%2==0 and b %2== 0 and c %2== 0: + if a == b == c: + ans = -1 + break + aa = (a/2) + bb = (b/2) + cc = (c/2) + a = bb+cc + b = aa+cc + c = aa+bb + ans += 1 + +print(ans) + " +p03723,s763747760,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(0) +elif a == b == c: + print(-1) +else: + num = 0 + while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)/2, (a+c)/2, (a+b)/2 + num += 1 + print(num)" +p03723,s713493812,Accepted,"a,b,c=map(int,input().split()) +aa=[] +bb=[] +cc=[] +ans=0 +while a%2==0 and b%2==0 and c%2==0: + ans+=1 + aa.append(a) + bb.append(b) + cc.append(c) + a,b,c=(b+c)//2,(c+a)//2,(a+b)//2 + if a in aa and b in bb and c in cc: + print(-1) + break +else: + print(ans)" +p03723,s820367186,Accepted,"A, B, C = map(int, input().split()) +ans = 0 +cont = True +while cont: + if A == B == C and A%2==0 : + ans = -1 + break + elif A%2==0 and B%2==0 and C%2==0: + b_A = A + b_B = B + b_C = C + A = b_B//2 + b_C//2 + B = b_A//2 + b_C//2 + C = b_A//2 + b_B//2 + ans += 1 + else: + break +print(ans)" +p03723,s950424964,Accepted,"A,B,C=(map(int,input().split(' '))) +ans = 0 +while True: + if A%2!=0 or B%2!=0 or C%2!=0: + print(ans) + break + if A==B==C: + print(-1) + break + A,B,C=B/2+C/2,A/2+C/2,A/2+B/2 + ans += 1" +p03723,s571506728,Accepted,"A, B, C = map(int, input().split()) + +if A == B == C and A % 2 == 0: + print(-1) + exit() + +res = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + res += 1 + +print(res) +" +p03723,s209113062,Accepted,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(bin(e&-e))-3-(e==b&1))" +p03723,s008220405,Accepted,"a,b,c=map(int,input().rstrip().split(' ')) +if(a==b and b==c): + if(a%2==0): + print(-1) + else: + print(0) +else: + n=0 + while(a%2==0 and b%2==0 and c%2==0): + n+=1 + tmp_a=(b+c)/2 + tmp_b=(a+c)/2 + tmp_c=(b+a)/2 + a=tmp_a + b=tmp_b + c=tmp_c + print(n) +" +p03723,s888461828,Accepted,"# A - Cookie Exchanges + +A, B, C = map(int, input().split()) + +ans = 0 +while True: + if A%2 or B%2 or C%2: + break + if A == B == C: + ans = -1 + break + nA = B//2 + C//2 + nB = A//2 + C//2 + nC = A//2 + B//2 + A = nA + B = nB + C = nC + ans += 1 + +print(ans)" +p03723,s402985834,Accepted,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0: + print(-1) + exit() +cnt=0 +while a%2 == 0 and b%2 == 0 and c%2 == 0: + a,b,c = (b+c)//2,(a+c)//2,(a+b)//2 + cnt+=1 + +print(cnt)" +p03723,s824150858,Accepted," +a, b, c = list(map(int, input().split(' '))) +cnt = 0 +if a == b == c: + cnt = a%2-1 +else: + while not (a%2 or b%2 or c%2): + cnt += 1 + a,b,c=(b+c)/2,(a+c)/2,(a+b)/2 + +print(cnt) +" +p03723,s411203473,Accepted,"a, b, c = map(int, input().split()) +if a == b == c: + ans = 1 +else: + ans = 1 << 31 + for x in [a - b, b - c, c - a]: + if x != 0: + tmp = 1 + while x % 2 == 0: + tmp += 1 + x >>= 1 + ans = min(tmp, ans) + +if a == b == c and b % 2 == 0: + print(-1) +else: + print(ans - 1)" +p03723,s274712871,Accepted,"A,B,C = [int(hoge) for hoge in input().split()] +cnt = 0 +while not (A%2 or B%2 or C%2): + NewA = B//2 + C//2 + NewB = A//2 + C//2 + NewC = A//2 + B//2 + A,B,C = NewA,NewB,NewC + cnt += 1 + if A==B==C: + print(-1);exit() +print(cnt)" +p03723,s247908090,Accepted,"A, B, C = map(int, input().split()) + +count = 0 +while True: + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + break + a = B // 2 + C // 2 + b = C // 2 + A // 2 + c = A // 2 + B // 2 + if a == A and b == B and c == C: + print(-1) + exit() + A = a + B = b + C = c + count += 1 + +print(count) +" +p03723,s369654295,Accepted,"def ave(b,c): + return b//2 + c//2 +def rest(a,b,c): + return ave(b,c), ave(a,c), ave(b,a) +a, b, c = map(int, input().split()) +ans = 0 +while 1: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1 : + print(ans) + break + d, e, f = rest(a,b,c) + if (a, b, c) == (d, e, f): + print(-1) + break + ans += 1 + a, b, c = d, e, f" +p03723,s659426916,Accepted,"a, b, c = map(int, input().split()) +s = sum([a, b, c]) + +ans = 0 + +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2 + ans += 1 + if ans > 100000: + ans = -1 + break + +print(ans) +" +p03723,s034524428,Accepted,"*a,=map(int,input().split()) +b=[bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)] +print((max(b) if b[0]*b[1]<0 else min(b))*(1-sum(a)%2))" +p03723,s831591490,Accepted,"a,b,c = map(int,input().split()) +for i in range(600): + if a&1 or b&1 or c&1: + break + a,b,c = a//2, b//2, c//2 + a, b, c = b + c, a + c, a + b +ans = i if i < 500 else -1 +print(ans)" +p03723,s914558782,Accepted,"a, b, c = map(int, input().split()) +count = 0 +for i in range(1100): + if (a%2 + b%2 + c%2): + break + d,e,f = (b+c)//2, (c+a)//2, (a+b)//2 + a,b,c = d,e,f + count += 1 +if(count>1000): + count = -1 +print(count)" +p03723,s663236587,Accepted,"a,b,c=map(int,input().split()) + +ans = 0 + +while a%2 == b%2 == c%2 == 0: + ans += 1 + newa=b//2+c//2 + newb=a//2+c//2 + newc=a//2+b//2 + a=newa + b=newb + c=newc + if a == b == c: + print(""-1"") + break +else: + print(ans)" +p03723,s187827875,Accepted,"A, B, C = map(int, input().split()) + +la = [A] +lb = [B] +lc = [C] + +ans = 0 +while la[ans] % 2 == 0 and lb[ans] % 2 == 0 and lc[ans] % 2 == 0 and ans < 100001: + la.append((lb[ans] + lc[ans]) / 2) + lb.append((lc[ans] + la[ans]) / 2) + lc.append((la[ans] + lb[ans]) / 2) + ans += 1 + +if ans == 100001: + print(-1) +else: + print(ans)" +p03723,s476577945,Accepted,"A,B,C = map(int,input().split()) + +ans = 0 + +while True: + if A%2!=0 or B%2!=0 or C%2!=0: + print(ans) + break + elif A%2==0 and B%2==0 and C%2==0 and A == B == C: + print('-1') + break + A_ = A/2 + B_ = B/2 + C_ = C/2 + A = B_+C_ + B = A_+C_ + C = A_+B_ + ans += 1 +" +p03723,s864696072,Accepted,"A, B, C = map(int, input().split()) +flag = False +count = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + halfA = A // 2 + halfB = B // 2 + halfC = C // 2 + + if A == (halfB + halfC) and B == (halfA + halfC) and C == (halfA + halfB): + flag = True + break + else: + A = halfB + halfC + B = halfA + halfC + C = halfA + halfB + count += 1 +if flag: + print(-1) +else: + print(count) +" +p03723,s768454102,Accepted,"A,B,C=map(int,input().split()) +if A==B==C and A%2==0: print(-1) +else: + k=0 + while all(x%2==0 for x in [A,B,C]): + A,B,C=(B+C)//2,(C+A)//2,(A+B)//2 + k+=1 + print(k)" +p03723,s890519092,Accepted,"import sys +sys.setrecursionlimit(10 ** 7) +input = sys.stdin.readline + +a,b,c = map(int, input().split()) + +if a%2==1 or b%2==1 or c%2==1: + print(0) + exit() + +if a==b==c and a%2==0: + print(-1) + exit() + +sabc = a+b+c + +cnt = 0 +while True: + a = (sabc-a)/2 + b = (sabc-b)/2 + c = (sabc-c)/2 + cnt+=1 + if a%2==1 or b%2==1 or c%2==1: break + +print(cnt) +" +p03723,s295328327,Accepted,"from sys import stdin + +a,b,c = [int(x) for x in stdin.readline().strip().split()] +l = 0 +mem = [] + +while(True): + if sum([a%2, b%2, c%2]) > 0: + break + elif [a,b,c] in mem: + l = -1 + break + else: + l += 1 + mem.append([a,b,c]) + a_tmp = b/2 + c/2 + b_tmp = a/2 + c/2 + c_tmp = a/2 + b/2 + a,b,c = a_tmp,b_tmp,c_tmp + +print(l)" +p03723,s055806809,Accepted,"a,b,c = map(int,input().split()) + + +ans = 0 +while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(ans) + import sys + sys.exit() + if a == b and b== c: + print(-1) + import sys + sys.exit() + ans += 1 + a,b,c = b // 2 + c // 2, a // 2 + c // 2,a // 2 + b // 2 + +" +p03723,s696994833,Accepted,"a, b, c = map(int, input().split()) +if a == b == c and a % 2 == 0: + print(-1) +else: + cnt = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + _a = (b+c)//2 + _b = (c+a)//2 + _c = (a+b)//2 + a = _a + b = _b + c = _c + cnt += 1 + print(cnt)" +p03723,s605223506,Accepted,"A, B, C = map(int, input().split()) + + +def check(A, B, C): + if A & 1 or B & 1 or C & 1: + return 0 + if A == B == C: + return -1 + return 1 + check((A + B) // 2, (B + C) // 2, (C + A) // 2) + + +answer = check(A, B, C) +print(answer) +" +p03723,s380468800,Accepted,"import bisect,collections,copy,itertools,math,numpy,string +def I(): return int(input()) +def S(): return input() +def LI(): return list(map(int,input().split())) +def LS(): return list(input().split()) +################################################## +A,B,C = LI() +ans = 0 +if A%2 or B%2 or C%2: + ans = 0 +elif A==B==C: + ans = -1 +else: + while 1: + if A%2 or B%2 or C%2: + break + A,B,C = (B+C)//2,(A+C)//2,(A+B)//2 + ans += 1 +print(ans) +" +p03723,s923804751,Accepted,"A, B, C = map(int,input().split()) +ans = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + a = B // 2 + C // 2 + b = A // 2 + C // 2 + c = A // 2 + B // 2 + if A == a and B == b and C == c: + ans = -1 + break + A = a + B = b + C = c + ans += 1 +print(ans)" +p03723,s954185480,Accepted,"i = 0 + +def cookie(a, b, c): + global i + if a == b and b == c: + return -1 + elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + i += 1 + cookie((b+c)//2, (a+c)//2, (a+b)//2) + return i + +A, B, C = map(int, input().split()) +if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(0) +else: + print(cookie(A, B, C))" +p03723,s892720926,Accepted,"a, b, c = map(int, input().split()) +ans = 0 +while a%2==0 and b%2==0 and c%2==0: + d, e, f = b//2 + c//2, a//2 + c//2, a//2 + b//2 + if [a, b, c] == [d, e, f]: + print(-1) + break + ans += 1 + a, b, c = d, e, f +else: + print(ans)" +p03723,s957815456,Accepted,"import sys +input = lambda : sys.stdin.readline().rstrip() +sys.setrecursionlimit(max(1000, 10**9)) +write = lambda x: sys.stdout.write(x+""\n"") + + +l = list(map(int, input().split())) +l.sort() +a,b,c = l +ans = 0 +while True: + if a%2 or b%2 or c%2: + break + if a==b==c: + ans = -1 + break + a,b,c = b//2+c//2, a//2+c//2, a//2+b//2 + ans += 1 +print(ans)" +p03723,s460523223,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + if a == b == c: + print(-1) + quit() +ans = 0 +a_n = 0 +b_n = 0 +c_n = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a_n = (b+c)//2 + b_n = (a+c)//2 + c_n = (a+c)//2 + a = a_n + b = b_n + c = c_n + ans += 1 +print(ans) +" +p03723,s769659115,Accepted,"a,b,c = map(int,input().split()) + +if a==b==c and a%2==0 and b%2==0 and c%2 == 0: + print(-1) +else: + ans = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + a,b,c = (b/2+c/2), (a/2+c/2), (a/2+b/2) + ans += 1 + print(ans)" +p03723,s522426109,Accepted,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print(bool(e|(a|b|c)%2)*(e^~-e).bit_length()-1)" +p03723,s658358109,Accepted,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0: + print(-1) + exit() +ans=0 +while a%2==b%2==c%2==0: + x=(a+b)//2 + y=(b+c)//2 + z=(c+a)//2 + a=y + b=z + c=a + ans+=1 +print(ans)" +p03723,s389980538,Accepted,"import sys + +sys.setrecursionlimit(10 ** 6) +INF = float(""inf"") +MOD = 10 ** 9 + 7 + + +def input(): + return sys.stdin.readline().strip() + + +def main(): + A, B, C = map(int, input().split()) + + for i in range(1000): + if A % 2 or B % 2 or C % 2: + print(i) + return + + a = (B + C) // 2 + b = (A + C) // 2 + c = (A + B) // 2 + A = a + B = b + C = c + + print(-1) + + +if __name__ == ""__main__"": + main() +" +p03723,s238125886,Accepted,"import sys + + +inint = lambda: int(sys.stdin.readline()) +inintm = lambda: map(int, sys.stdin.readline().split()) +inintl = lambda: list(inintm()) +instrm = lambda: map(str, sys.stdin.readline().split()) +instrl = lambda: list(instrm()) + +a, b, c = inintm() + +if a == b == c == 1: + print(0) + exit() + +if a == b == c: + print(-1) + exit() + +ans = 0 + +while a % 2 == b % 2 == c % 2 == 0: + d = a + e = b + f = c + a = e/2 + f/2 + b = d/2 + f/2 + c = d/2 + e/2 + ans += 1 + +print(ans)" +p03723,s886184645,Accepted,"A,B,C=map(int,input().split()) +if A==B==C: + print(0 if A%2 else -1) +else: + count=0 + while A%2==B%2==C%2==0: + A,B,C=(B+C)/2,(C+A)/2,(A+B)/2 + count+=1 + print(count)" +p03723,s638988375,Accepted,"import sys +a, b, c = [int(w) for w in input().split()] + +ans = 0 + + +def is_fin(a, b, c): + global ans + if a % 2 or b % 2 or c % 2: + return True + elif a == b == c: + ans = -1 + return True + else: + return False + + +while not is_fin(a, b, c): + ta = (b+c)/2 + tb = (a+c)/2 + tc = (a + b) / 2 + a, b, c = ta, tb, tc + ans += 1 + +print(ans) +" +p03723,s797102257,Accepted,"import collections +import sys +import numpy as np +sys.setrecursionlimit(1000000000) +from heapq import heapify,heappop,heappush,heappushpop +MOD = 10**9+7 +import itertools +import math + +a,b,c = map(int,input().split()) +if a%2 == 0 and b%2 == 0 and c%2 == 0 and a == b and b == c: + print(-1) + sys.exit() +else: + cnt = 0 + while True: + if a%2 == 1 or b%2 ==1 or c%2 == 1: + break + a,b,c = b//2 + c//2,a//2+c//2,a//2+b//2 + cnt += 1 + print(cnt)" +p03723,s080399505,Accepted,"a,b,c=map(int,input().split()) +if a==b==c: + if a%2==b%2==c%2==0: + print(-1) + else: + print(0) + exit() +cnt=0 +while a%2==b%2==c%2: + A=a//2 + B=b//2 + C=c//2 + a,b,c=B+C,A+C,A+B + cnt+=1 +print(cnt)" +p03723,s714457437,Accepted,"a, b, c = map(int,input().split()) +count = 0 +def exchange(a, b, c, count): + a, b, c = int((b+c)/2), int((a+c)/2), int((a+b)/2) + count += 1 + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + return a, b, c, count + else: + return exchange(a, b, c, count) +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) +elif a == b == c: + print(-1) +else: + aa, bb, cc, count = exchange(a, b, c, count) + print(count)" +p03723,s396008449,Accepted,"def main(): + a,b,c = map(int,input().split()) + s = [a,b,c] + + cnt = 0 + while (a % 2 == 0) and (b % 2 == 0) and (c % 2 == 0): + + a1,b1,c1 = a,b,c + a = (b1+c1)//2 + b = (a1+c1)//2 + c = (a1+b1)//2 + + if [a,b,c] == s: + return -1 + + cnt += 1 + #print(a,b,c) + + return cnt + + +ans = main() +print(ans)" +p03723,s029323676,Accepted,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0: + print(-1) +else: + res=0 + while a%2==b%2==c%2==0: + a,b,c=(b+c)/2,(c+a)/2,(a+b)/2 + res+=1 + print(res)" +p03723,s038253808,Accepted,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print(bool(e|(a|b|c)%2)*(e^~-e).bit_length()-1)" +p03723,s920969668,Accepted,"import sys +a, b, c = map(int, input().split()) + +if a == b and b == c: + print(-1 if a % 2 == 0 else 0) + sys.exit(0) + +i = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b + c) / 2, (c + a) / 2, (a + b) / 2 + i += 1 + +print(i) +" +p03723,s222873177,Accepted,"def myAnswer(A:int,B:int,C:int) ->int: + if(A == B and B == C): + if(A % 2 == 0): + return -1 + else: + return 0 + counter = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = ((B//2 + C//2), (A//2 + C//2), (A//2 + B//2)) + counter += 1 + return counter + +def modelAnswer(): + tmp=1 +def main(): + A,B,C = map(int,input().split()) + print(myAnswer(A,B,C)) + +if __name__ == '__main__': + main()" +p03723,s758393471,Accepted,"a=list(map(int,input().split())) +cnt=0 +tmp=[0]*3 + +while a[0]%2==0 and a[1]%2==0 and a[2]%2==0: + if a[0]==a[1]==a[2]: + cnt=-1 + break + else: + tmp[0]=a[1]//2+a[2]//2 + tmp[1]=a[0]//2+a[2]//2 + tmp[2]=a[0]//2+a[1]//2 + a[0],a[1],a[2]=tmp[0],tmp[1],tmp[2] + cnt+=1 +print(cnt)" +p03723,s774721249,Accepted,"A, B, C = map(int, input().split()) +ans = 0 +while A%2 == 0 and B%2 == 0 and C%2 ==0: + ans += 1 + a, b, c = A//2, B//2, C//2 + A = b+c + B = a+c + C = a+b + if ans == 100: break +if ans == 100: + print(-1) +else: + print(ans) +" +p03723,s810610796,Accepted,"A, B, C = map(int, input().split()) +ans = 0 +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + if A == B and B == C and C == A: + ans = -1 + break + A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2 + ans += 1 +print(ans)" +p03723,s164768319,Accepted,"A, B, C = map(int, input().split()) +res = 0 + +if (A == B == C) and all([A % 2 ==0, B % 2 == 0, C % 2 ==0]): + res = -1 +else: + while all([A % 2 ==0, B % 2 == 0, C % 2 ==0]): + at, bt, ct = A/2, B/2, C/2 + A = bt + ct + B = at + ct + C = at + bt + res += 1 + +print(res)" +p03723,s607098107,Accepted,"import sys +input = sys.stdin.readline +sys.setrecursionlimit(10 ** 7) + +a, b, c = map(int, input().split()) + +ans = 0 +pattern = set() +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + p = tuple(sorted((a, b, c))) + if p in pattern: + print(-1) + sys.exit(0) + pattern.add(p) + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + ans += 1 + +print(ans) +" +p03723,s950770276,Accepted,"abc = list(map(int,input().split())) +lis=[abc] +ans=0 +def ch(x): + for i in x: + if i%2==1: + return -1 + return 1 +def sw(x): + ret=[] + ret.append(x[2]/2+x[1]/2) + ret.append(x[0]/2+x[2]/2) + ret.append(x[0]/2+x[1]/2) + return ret +def check(a,l): + for x in l: + if a==x: + return 1 + return 0 +while True: + if ch(abc)==-1: + break + abc=sw(abc) + if check(abc,lis): + ans=-1 + break + lis.append(abc) + ans+=1 + +print(ans) + " +p03723,s279855843,Accepted,"# agc014_a.py] +A, B, C = map(int,input().split()) +cnt = 0 +inf = 10**2 +for i in range(inf): + if A%2==0 and B%2==0 and C%2==0: + a = (B+C)//2 + b = (A+C)//2 + c = (B+A)//2 + A = a + B = b + C = c + cnt += 1 + else: + break +if cnt == inf: + cnt = -1 +print(cnt)" +p03723,s741168854,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +flag = True + +while flag == True: + if a%2 == 0 and b%2 == 0 and c%2 == 0: + if (a==b==c): + ans = -1 + break + + ans += 1 + at=a + bt=b + ct=c + a = int(bt/2+ct/2) + b = int(at/2+ct/2) + c = int(at/2+bt/2) + else: + flag = False + break + +print(ans)" +p03723,s069565622,Accepted,"A, B, C = map(int, input().split()) +cnt=0 +memo=[] +while True: + tmp = (A,B,C) + if (A%2==0 and B%2==0 and C%2==0): + if tmp not in memo: + memo.append(tmp) + cnt+=1 + A,B,C = (B+C)//2, (C+A)//2, (A+B)//2 + else: + cnt=-1 + break + else: + break +print(cnt)" +p03723,s739587025,Accepted,"A,B,C=map(int,input().split()) + +if A==B==C and A%2==0: + print(-1) +else: + K=0 + while (A%2)+(B%2)+(C%2)==0: + A,B,C=(B+C)//2,(C+A)//2,(A+B)//2 + K+=1 + print(K) +" +p03723,s772838850,Accepted,"x,y,z= map(int,input().split()) +A = [] +ans = 0 +A.append([x,y,z]) +while True: + if x%2==0 and y%2==0 and z%2==0: + ans+=1 + x,y,z=((y+z)//2),((z+x)//2),((y+x)//2) + + if [x,y,z] in A: + ans = -1 + break + + + A.append([x,y,z]) + if x%2==0 and y%2==0 and z%2==0: + continue + else: + break + +print(ans)" +p03723,s113644269,Accepted,"A,B,C = map(int, input().split()) + +count = 0 +while(A%2==0 and B%2==0 and C%2==0): + if A==B==C: + count = -1 + break + + tot = A+B+C + A = (tot-A)/2 + B = (tot-B)/2 + C = (tot-C)/2 + count+=1 + +print(count)" +p03723,s555599966,Accepted,"# 解答AC + +A,B,C = map(int, input().split()) + +is_even = lambda n: True if n % 2 == 0 else False + +if A == B == C: + if A % 2 == 0: print(-1) + else: print(0) +else: + cnt = 0 + while is_even(A) and is_even(B) and is_even(C): + cnt += 1 + A,B,C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + print(cnt)" +p03723,s834318994,Accepted,"from sys import stdin + +a,b,c = [int(x) for x in stdin.readline().rstrip().split()] +count = 0 +num = 0 + +while True: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(count) + exit() + elif a==b==c: + print(-1) + exit() + else: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + count += 1 + num += 1" +p03723,s016193522,Accepted,"a,b,c = map(int,input().split()) +if a==b==c and a%2==1: + print(0) +elif a==b==c and a%2==0: + print(""-1"") +else: + cnt = 0 + while all(i&1==0 for i in [a,b,c]): + A = a + B = b + C = c + a = (B+C)//2 + b = (A+C)//2 + c = (A+B)//2 + cnt += 1 + print(cnt) +" +p03723,s197264973,Accepted,"A, B, C = map(int, input().split()) +count = 0 +fA = A +fB = B +while A%2 == 0 and B%2 == 0 and C%2 == 0: + hA = A/2 + hB = B/2 + hC = C/2 + A = hB + hC + B = hA + hC + C = hA + hB + count += 1 + if A == fA and B == fB: + count = -1 + break + +print(count)" +p03723,s699511949,Accepted,"import sys +A, B, C = map(int, input().split()) +ans = 0 + +if A == B == C and not A == 1: + print(-1) + sys.exit() + +while True: + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + t_A, t_B, t_C = A, B, C + A = (t_B + t_C) // 2 + B = (t_C + t_A) // 2 + C = (t_A + t_B) // 2 + ans += 1 + else: + print(ans) + break" +p03723,s714526996,Accepted,"a, b, c = map(int, input().split()) +ans = 0 +if a==b==c and a%2==0 and b%2==0 and c%2==0: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + aa = b//2+c//2 + bb = c//2+a//2 + cc = a//2+b//2 + a = aa + b = bb + c = cc + ans += 1 + print(ans)" +p03723,s779677032,Accepted,"A, B, C = map(int, input().split()) +if A == B == C and A%2 == 0: + print(-1) +else: + D = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + D += 1 + AA = B/2 + C/2 + BB = A/2 + C/2 + CC = A/2 + B/2 + A = AA + B = BB + C = CC + print(D)" +p03723,s584848840,Accepted,"A, B, C = map(int, input().strip().split()) +ans = 0 +while (A != B or B != C) and (A % 2) + (B % 2) + (C % 2) == 0: + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + ans += 1 +if (A % 2) + (B % 2) + (C % 2) == 0 and A == B == C: + ans = -1 +print(ans)" +p03723,s770337526,Accepted,"A, B, C = map(int, input().split()) + +cnt = 0 +if(A==B==C and A%2 == 0): + print(""-1"") +else: + while(A%2 == 0 and B%2 == 0 and C%2 == 0): + tmpA = A + tmpB = B + tmpC = C + cnt += 1 + A = tmpB//2+tmpC//2 + B = tmpA//2+tmpC//2 + C = tmpA//2+tmpB//2 + print(cnt)" +p03723,s565354461,Accepted,"a,b,c=map(int,input().split()) +d=0 +if a==b==c and a%2==0: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 + d+=1 + print(d)" +p03723,s769243217,Accepted,"*a,=map(int,input().split()) +b=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)] +print((max(b)*(b[0]*b[1]<0) or min(b))*(1-sum(a)%2))" +p03723,s668271681,Accepted,"a,b,c = map(int,input().split()) +res = 0 +while True: + if a%2!=0 or b%2!=0 or c%2!=0: + break + elif a==b==c: + res = -1 + break + else: + res += 1 + a,b,c = (b+c)//2, (c+a)//2, (a+b)//2 +print(res)" +p03723,s063386587,Accepted,"A,B,C=map(int,input().split()) +if A==B==C: + print(0 if A%2 else -1) +else: + count=0 + while A%2==B%2==C%2==0: + A,B,C=(B+C)/2,(C+A)/2,(A+B)/2 + count+=1 + print(count)" +p03723,s938053355,Accepted,"A, B, C = map(int, input().split()) + +if A == B == C and A%2==0: + print(-1) +else: + cnt = 0 + while A%2 == B%2 == C%2 == 0: + x = (B+C)//2 + y = (A+C)//2 + z = (A+B)//2 + A = x + B = y + C = z + cnt += 1 + print(cnt)" +p03723,s129741602,Accepted,"A, B, C = map(int, input().split()) + +if A % 2 or B % 2 or C % 2: + print(0) + exit(0) + + +def solve(n): + i = 0 + while(n % 2 == 0): + n = n // 2 + i += 1 + return(i) + + +a = solve(A+B) +b = solve(B+C) +c = solve(C+A) +if a == b and b == c: + print(-1) +else: + print(min(a, b, c)) +" +p03723,s924767447,Accepted,"a,b,c = map(int,input().split()) +ans = 0 + +if a == b and a == c and a%2 == 0: + print(""-1"") +elif a == b and a == c and a%2 == 0: + print(0) +else: + while a%2 == 0 and b%2 == 0 and c%2 == 0: + ans += 1 + aa = b/2 + c/2 + bb = a/2 + c/2 + cc = a/2 + b/2 + a = aa + b = bb + c = cc + print(ans)" +p03723,s833173500,Accepted,"a, b, c = map(int, input().split()) +ans = 0 +while True: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + if a == b == c: + ans = -1 + break + na = (b+c) // 2 + nb = (a+c) // 2 + nc = (a+b) // 2 + ans += 1 + a, b, c = na, nb, nc + #print(na,nb,nc,ans) +print(ans)" +p03723,s431717986,Accepted,"a,b,c=map(int,open(0).read().split()) +e=(a-b)|(b-c) +print(bool(e|(a|b|c)%2)*(e^~-e).bit_length()-1)" +p03723,s546458131,Accepted,"A, B, C = map(int, input().split()) + +if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(0) + exit() + +diff1 = abs(A-B) +diff2 = abs(B-C) + +if diff1 == 0 and diff2 == 0: + print(-1) + exit() + +ans = 0 +while diff1 % 2 == 0 and diff2 % 2 == 0: + ans += 1 + diff1 //= 2 + diff2 //= 2 + +print(ans)" +p03723,s222082698,Accepted,"def main(): + A, B, C = map(int, input().split()) + even_flag = True + count = 0 + + while even_flag: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + even_flag = False + break + + elif A == B and B == C and A == C: + break + + A, B, C = (B // 2 + C // 2), (A // 2 + C // 2), (A // 2 + B // 2) + count += 1 + + if even_flag: + print(-1) + else: + print(count) + +if __name__ == ""__main__"": + main()" +p03723,s546968629,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 +while True: + if a % 2 or b % 2 or c % 2: + break + if a == b == c: + cnt = -1 + break + a, b, c = b // 2 + c // 2, c // 2 + a // 2, a // 2 + b // 2 + cnt += 1 +print(cnt)" +p03723,s699601131,Accepted,"a, b, c = map(int, input().split()) + +if a != 1 and a == b == c: + print(-1) + exit() + +result = 0 + +while True: + if any([a & 1, b & 1, c & 1]): + break + + a2 = a // 2 + b2 = b // 2 + c2 = c // 2 + a = b2 + c2 + b = a2 + c2 + c = a2 + b2 + result += 1 + +print(result)" +p03723,s927640841,Accepted,"A, B, C = map(int, input().split()) + +if A == B and B == C and A % 2 == 0: + print('-1') + exit() + +count = 0 +for i in range(10**9): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + count += 1 + a = A + b = B + c = C + A = b // 2 + c // 2 + B = a // 2 + c // 2 + C = a // 2 + b // 2 + +print(count) +" +p03723,s232125268,Accepted,"a,b,c=map(int,input().split()) +if a%2!=0 or b%2!=0 or c%2!=0: + print(0) +elif a==b==c: + print(-1) +else: + total=0 + while True: + x=a/2 + y=b/2 + z=c/2 + a=y+z + b=x+z + c=x+y + total+=1 + if a%2!=0 or b%2!=0 or c%2!=0: + print(total) + break" +p03723,s517908267,Accepted,"A, B, C = map(int, input().split()) + +if A % 2 == 1 and B % 2 == 1 and C % 2 == 1: + print(0) + exit() +elif A == B and B == C: + print('-1') + exit() +else: + ans = 0 + while A % 2 != 1 and B % 2 != 1 and C % 2 != 1: + a = B//2+C//2 + b = C//2+A//2 + c = A//2+B//2 + A, B, C = a, b, c + ans += 1 +print(ans) +" +p03723,s995074272,Accepted,"N = list(map(int, input().split())) +N2 = [0,0,0] +ans = 0 +while True: + for i in range(3): + if not N[i] %2 == 0: + print(ans) + exit() + N2[0] = (N[1] + N[2]) /2 + N2[1] = (N[0] + N[2]) /2 + N2[2] = (N[0] + N[1]) /2 + #print(N2) + if N == N2: + print('-1') + exit() + N = N2.copy() + ans += 1 +" +p03723,s411994423,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b == c: + print(-1) + exit() + +ans = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a_tmp = b // 2 + c // 2 + b_tmp = a // 2 + c // 2 + c_tmp = a // 2 + b // 2 + a, b, c = a_tmp, b_tmp, c_tmp + ans += 1 + +print(ans)" +p03723,s690853899,Accepted,"a, b, c = map(int, input().split()) + +test = [[a,b,c]] +count = 0 +while a%2 == b%2 == c%2 == 0: + at = a + bt = b + ct = c + a = bt//2 + ct//2 + b = ct//2 + at//2 + c = at//2 + bt//2 + count+=1 + if [a,b,c] in test: + count = -1 + print(count) + break + else: + test.append([a,b,c]) +if count != -1: + print(count) +" +p03723,s641062151,Accepted,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C: + if A%2 != 0 or B%2 != 0 or C%2 != 0: + pass + else: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = B//2+C//2,A//2+C//2,A//2+B//2 + ans += 1 +print(ans)" +p03723,s024992385,Accepted,"def f(a, b, c): + if a > 1 and a == b and a == c: + print(-1) + else: + count = 0 + for i in range(100): + if a%2 or b%2 or c%2: + break + a, b, c = b//2 + c//2, a//2 + c//2, a//2 + b//2 + count += 1 + print(count) + +a, b, c = map(int, input().split()) +f(a, b, c) +" +p03723,s608750271,Accepted,"a, b, c = map(int, input().split()) +if a%2 == 0 and a == b and c == b: + print(-1) +else: + ans = 0 + while a%2 == b%2 == c%2 ==0: + ans += 1 + a,b,c=(b+c)/2,(c+a)/2,(a+b)/2 + print(ans)" +p03723,s625696673,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +while True: + if a%2 ==1 or b%2 == 1 or c%2 == 1: + ans = 0 + break + ans+=1 + na = (b+c)//2 + nb = (c+a)//2 + nc = (a+b)//2 + if a == b and b == c: + ans = -1 + break + if na%2 == 1 or nb%2 == 1 or nc%2 == 1: + break + a,b,c, = na,nb,nc +print(ans) +" +p03723,s534233291,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 +while True: + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(cnt) + break + elif A == B and A == C: + print(-1) + break + else: + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + cnt += 1" +p03723,s110029082,Accepted,"a,b,c = map(int,input().split()) +if a == b == c: + if a%2 == b%2 == c%2 == 0: + print(-1) + else: + print(0) +else: + t = 0 + while t > -1: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + (a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2) + t += 1 + print(t) +" +p03723,s043191689,Accepted,"A,B,C = map(int,input().split()) +if A == B == C and A%2 == 0: + print(-1) +elif A%2 == 1 or B%2 == 1 or C%2 == 1: + print(0) +else: + c = 0 + while A%2 == B%2 == C%2 == 0: + A0 = A + B0 = B + C0 = C + A = (B0+C0)/2 + B = (C0+A0)/2 + C = (A0+B0)/2 + c += 1 + print(c) + +" +p03723,s176606883,Accepted,"cookie = list(map(int, input().split())) +sc = sum(cookie) +cnt = 0 +if cookie[0] == cookie[1] and cookie[1] == cookie[2] and cookie[0]%2 == 0: + print(-1) + exit() +memo = [0]*3 +while cookie[0]%2 == 0 and cookie[1]%2 == 0 and cookie[2]%2 == 0: + memo[0] = (cookie[1] + cookie[2]) // 2 + memo[1] = (cookie[0] + cookie[2]) // 2 + memo[2] = (cookie[1] + cookie[0]) // 2 + for i in range(3): + cookie[i] = memo[i] + cnt += 1 + +print(cnt)" +p03723,s033572638,Accepted,"A,B,C=map(int,input().split()) +if A==B and B==C and A%2==0: + print(-1) + exit() +else: + count=0 + while(1): + if A%2==1 or B%2==1 or C%2==1: + print(count) + exit() + else: + a=A//2 + b=B//2 + c=C//2 + A=b+c + B=a+c + C=a+b + count+=1" +p03723,s389282429,Accepted,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e!=b%2)*(e^e-1).bit_length()-1)" +p03723,s574528926,Accepted,"a,b,c = map(int,input().split()) +ans = 0 +comb = set() +while a%2==0 and b%2==0 and c%2==0: + x = (b+c)//2 + y = (a+c)//2 + z = (b+c)//2 + if (x,y,z) in comb: + ans = -1 + break + ans += 1 + comb.add((x,y,z)) + a,b,c = x,y,z +print(ans) +" +p03723,s129021353,Accepted,"A,B,C=map(int,input().split()) +if (A==B)and(B==C)and(A%2==0): + print(""-1"") +else: + count=0 + while True: + if (A%2==0)and(B%2==0)and(C%2==0): + a=(B+C)/2 + b=(A+C)/2 + c=(A+B)/2 + A=a + B=b + C=c + count=count+1 + else: + break + print(count)" +p03723,s383992524,Accepted,"A, B, C = map(int, input().split()) + +ans = 0 +if A&1 or B&1 or C&1: + print(ans) + exit(0) + +if A == B == C: + print(-1) + exit(0) + +while True: + if A&1 or B&1 or C&1: + break + nA = B//2 + C//2 + nB = A//2 + C//2 + nC = B//2 + A//2 + ans += 1 + A = nA + B = nB + C = nC + +print(ans) + +" +p03723,s130150830,Accepted,"A, B, C = map(int,input().split()) + +empty = [0] * 3 +count = 0 +if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + print(-1) +elif (A % 2 != 0) or (B % 2 != 0) or (C % 2 != 0): + print(0) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + count += 1 + A_ = A//2 + B_ = B//2 + C_ = C//2 + A = B_ + C_ + B = A_ + C_ + C = A_ + B_ + + print(count)" +p03723,s997085660,Accepted,"#11 +import sys +A,B,C = map(int,input().split()) + +a1,b1,c1,cou= 0,0,0,0 + + + +while A%2 == 0 and B%2 == 0 and C%2 == 0: + if A == B == C: + print(""-1"") + sys.exit() + a1 = int(A/2) + b1 = int(B/2) + c1 = int(C/2) + A = b1+c1 + B = a1+c1 + C = a1+b1 + cou += 1 + +print(cou)" +p03723,s137784913,Accepted,"A, B, C = map(int, input().split()) +cnt = 0 + +if A == B == C and A % 2 == 0: + cnt = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = int((B+C)/2), int((A+C)/2), int((A+B)/2) + cnt += 1 + +print(cnt)" +p03723,s507419481,Accepted,"import sys +import numpy as np +a, b, c = [int(i) for i in sys.stdin.readline().split()] +ls = np.array([a, b, c]) +arr = np.array([[0, 0.5, 0.5], + [0.5, 0, 0.5], + [0.5, 0.5, 0]]) +cnt = 0 +while sum(ls % 2) == 0: + if ls[0] == ls[1] == ls[2]: + cnt = -1 + break + ls = ls.dot(arr) + cnt += 1 +print(cnt)" +p03723,s402062267,Accepted,"A, B, C = map(int, input().split()) +if A == B == C: + if A % 2 == 0: + print(-1) + else: + print(0) +else: + ans = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + p, q, r = A // 2, B // 2, C // 2 + A, B, C = q + r, p + r, p + q + ans += 1 + print(ans)" +p03723,s545233292,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 +while True: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + break + if a == b == c: + cnt = -1 + break + k, l, m = a//2, b//2, c//2 + a = l + m + b = k + m + c = k + l + cnt += 1 +print(cnt) + " +p03723,s049824939,Accepted,"import sys +input = sys.stdin.readline + +# A - Cookie Exchanges +def is_even(a, b, c): + cookies = [a, b, c] + return all(c % 2 == 0 for c in cookies) + + +a, b, c = map(int, input().split()) + +for i in range(1000): + if is_even(a, b, c): + new_a = b//2 + c//2 + new_b = a//2 + c//2 + new_c = a//2 + b//2 + a, b, c = new_a, new_b, new_c + else: + print(i) + exit() + +print(-1)" +p03723,s179400690,Accepted,"a, b, c = map(int, input().split()) +if a == b == c: + if a % 2 == 0: + print(-1) + else: + print(0) +else: + cnt = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + print(cnt)" +p03723,s970931898,Accepted,"A, B, C = map(int, input().split()) + +if A%2==1 or B%2==1 or C%2==1: + print(0) +elif A==B and B==C: + print(-1) +else: + count = 0 + while True: + if A%2==1 or B%2==1 or C%2==1: + break + count+=1 + A_tmp = B/2 + C/2 + B_tmp = A/2 + C/2 + C = A/2 + B/2 + A = A_tmp + B = B_tmp + print(count)" +p03723,s894187008,Accepted,"a, b, c = map(int, input().split()); i = 0 +if a == b and b == c and a%2 == 0: print(-1) +else: + while a%2 == 0 and b%2 == 0 and c%2 == 0: + a, b, c = (b+c)//2, (c+a)//2, (a+b)//2; i += 1 + print(i)" +p03723,s605887582,Accepted,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e!=b%2)*len(f'{e&-e:b}')-1) +" +p03723,s038960214,Accepted,"a,b,c = map(int,input().split()) +if a%2 == 1 or b%2 == 1 or c%2== 1 : + print(0) + exit() +elif a == b and b == c : + print(-1) + exit() +count = 0 +while (a%2 == 0 and b%2 == 0 and c%2 == 0) : + count += 1 + x = (a+b)/2 + y = (b+c)/2 + z = (c+a)/2 + a = x + b = y + c = z + + +print(count)" +p03723,s977110584,Accepted,"A,B,C=map(int,input().split()) +if A==B==C and A%2==0: + print(-1) +elif A%2==1 or B%2==1 or C%2==1: + print(0) +else: + c=0 + while A%2==B%2==C%2==0: + A0=A + B0=B + C0=C + A=(B0+C0)/2 + B=(C0+A0)/2 + C=(A0+B0)/2 + c+=1 + print(c) + " +p03723,s033493840,Accepted,"a, b, c = map(int, input().split()) +count = 0 +for i in range(10**3): + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(count) + exit() + a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2 + count += 1 +print(-1)" +p03723,s803554889,Accepted,"def check(aa,bb,cc): + if aa%2==0 and bb%2==0 and cc%2==0: + return True + else: + return False + +a,b,c = map(int, input().split()) +if check(a,b,c): + if a == b == c: + print(-1) + exit() + +ans = 0 +while check(a,b,c): + _a = b // 2 + c // 2 + _b = a // 2 + c // 2 + _c = a // 2 + b // 2 + a = _a + b = _b + c = _c + ans += 1 +print(ans)" +p03723,s751047029,Accepted,"a, b, c = map(int, input().split()) + +counter = 0 +while a%2==b%2==c%2==0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + counter += 1 + if counter > 100000: + counter = -1 + break +print(counter)" +p03723,s316834911,Accepted,"A,B,C = map(int,input().split()) + +#print(A,B,C) + +if A==B and B==C and A%2==1: + print(0) + +elif A==B and B==C: + print(-1) +else: + count=0 + while A%2==0 and B%2==0 and C%2==0: + Ax=A/2 + Bx=B/2 + Cx=C/2 + #print(Ax,Bx,Cx) + A = int(Bx+Cx) + B = int(Cx+Ax) + C = int(Ax+Bx) + count +=1 + #print(A,B,C) + print(count) + " +p03723,s556202075,Accepted,"# 適当に10**5ぐらい回して無限に続けられたら-1でよくね? +A, B, C = map(int, input().split()) + + +def update(A, B, C): + return B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2 + + +for i in range(10 ** 5): + if A & 1 or B & 1 or C & 1: + print(i) + exit() + A, B, C = update(A, B, C) + +print(-1) +" +p03723,s728015261,Accepted,"import sys +a,b,c = map(int,input().split()) +ans = 0 +pa = [] +pb = [] +while True: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + ans += 1 + lasta = a + lastb = b + lastc = c + a = lastb/2 + lastc/2 + b = lasta/2 + lastc/2 + c = lasta/2 + lastb/2 + for i in range(len(pa)): + if pa[i] == a: + if pb[i] == b: + print(-1) + sys.exit() + pa.append(a) + pb.append(b) +print(ans)" +p03723,s039620120,Accepted,"A,B,C=map(int,input().split()) +cnt=0 +if A==B and B==C: + if A%2==0: + print(-1) + else: + print(0) + exit() + +while True: + x=A + y=B + z=C + if A%2!=0 or B%2!=0 or C%2!=0: + break + cnt+=1 + A=(y+z)//2 + B=(x+z)//2 + C=(x+y)//2 + #print(A,B,C) +print(cnt)" +p03723,s120266279,Accepted,"a, b, c = list(map(int, input().split())) + +if a == b and b == c and a % 2 == 0: + print(-1) + exit() + +OK = True +count = 0 + +while OK: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + OK = False + break + diva = a / 2 + divb = b / 2 + divc = c / 2 + a = divb + divc + b = divc + diva + c = diva + divb + count += 1 + +print(count)" +p03723,s078391519,Accepted,"a, b, c = map(int, input().split()) +ans = 0 + +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + if a == b == c: + print(-1) + exit() + a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2 + ans += 1 +print(ans) +" +p03723,s991348370,Accepted,"cookie = list(map(int, input().split())) +sc = sum(cookie) +cnt = 0 +if cookie[0] == cookie[1] and cookie[1] == cookie[2] and cookie[0]%2 == 0: + print(-1) + exit() +memo = [0]*3 +while cookie[0]%2 == 0 and cookie[1]%2 == 0 and cookie[2]%2 == 0: + memo[0] = (cookie[1] + cookie[2]) // 2 + memo[1] = (cookie[0] + cookie[2]) // 2 + memo[2] = (cookie[1] + cookie[0]) // 2 + for i in range(3): + cookie[i] = memo[i] + cnt += 1 + +print(cnt)" +p03723,s685967752,Accepted,"a,b,c = list(map(int, input().split())) + +if a==b==c: + if a&1: + print(0) + else: + print(-1) + exit() + +ans=0 +while all(i&1==0 for i in [a,b,c]): + a,b,c = (b+c)//2, (a+c)//2, (a+b)//2 + ans+=1 + +print(ans)" +p03723,s726662562,Accepted,"A, B, C = [int(i) for i in input().split()] +ans = 0 +a, b, c = A, B, C +while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + ans += 1 + ha = int(a / 2) + hb = int(b / 2) + hc = int(c / 2) + a = hb + hc + b = hc + ha + c = ha + hb + if a == A and b == B and c == C: + ans = -1 + break +print(ans) +" +p03723,s946060595,Accepted,"a, b, c = map(int, input().split()) + +ba = a +bb = b +bc = c +ans = 0 +while True: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + break + + ta = a//2 + tb = b//2 + tc = c//2 + a = tb+tc + b = ta+tc + c = ta+tb + ans += 1 + + if a == ba and b == bb and c == bc: + ans = -1 + break + +print(ans) +" +p03723,s104188706,Accepted,"a, b, c = map(int, input().split()) + +ans = 0 + +while True: + if ans > 999999: + print(-1) + break + elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(ans) + break + n_a = b/2 + c/2 + n_b = a/2 + c/2 + n_c = a/2 + b/2 + a = n_a + b = n_b + c = n_c + ans += 1 +" +p03723,s598516147,Accepted,"A,B,C=map(int,input().split()) + +t=0 +while(True): + if(A%2==1 or B%2==1 or C%2==1) : + break + a=(A+B)/2 + b=(B+C)/2 + c=(C+A)/2 + if(A==a and B==b and C==c): + print(-1) + exit() + A=a + B=b + C=c + t+=1 +print(t) +" +p03723,s522260660,Accepted,"import math + +a, b, c = map(int, input().split()) + +cnt = 0 + +if a == b == c and (a+b+c)%2 == 0: + print(-1) + exit() +else: + while a%2 == 0 and b%2 == 0 and c%2 == 0: + a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2 + cnt += 1 +print(cnt)" +p03723,s616142137,Accepted,"a,b,c=map(int,input().split()) +num=0 +while (a%2==0 and b%2==0 and c%2==0): + a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2) + num+=1 + if (num>10**7): + print(-1) + break +else: + print(num)" +p03723,s933825739,Accepted,"A,B,C = map(int, input().split()) + +def all_even(a,b,c): + if a%2 == 0 and b%2 == 0 and c%2 == 0: + return True + else: + return False + +cnt = 0 + +while all_even(A,B,C): + if A == B == C: + cnt = -1 + break + cnt+=1 + A,B,C = (B+C)//2, (A+C)//2, (A+B)//2 + +print(cnt)" +p03723,s453981053,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 +while True: + if a == b == c and a%2 == 0: + cnt = -1 + break + elif a%2 != 0 or b%2 != 0 or c%2 != 0: + break + elif a%2 == 0 and b%2 == 0 and c%2 == 0: + a, b, c, = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 +print(cnt)" +p03723,s259323013,Accepted,"A,B,C = map(int,input().split()) +cnt = 0 +while True: + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B == C: + print(-1) + break + else: + a = A + b = B + c = C + A = (b+c)//2 + B = (a+c)//2 + C = (a+b)//2 + cnt +=1 + else: + print(cnt) + break" +p03723,s001358800,Accepted,"a = list(map(int, input().split())) +count = 0 +while all(x % 2 == 0 for x in a) and count <= 100000: + b = [(sum(a) - x) // 2 for x in a] + a = b + count += 1 +print(count if count <= 100000 else -1)" +p03723,s485780266,Accepted,"A, B, C = map(int, input().split()) + +AA, BB, CC = A, B, C +cnt = 0 +while True: + if (A % 2) | (B % 2) | (C % 2): + print(cnt) + exit(0) + a, b, c = A // 2, B // 2, C // 2 + A, B, C = b + c, a + c, a + b + cnt += 1 + if (A == B) & (B == C): + print(-1) + exit(0) + if (A == AA) & (B == BB) & (C == CC): + print(-1) + exit(0) +" +p03723,s444685851,Accepted,"if __name__ == ""__main__"": + a, b, c = map(int, input().split()) + + if a == b == c and a % 2 == 0: + print(-1) + exit() + + ans = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a_tmp = (b+c)//2 + b_tmp = (a+c)//2 + c_tmp = (c+a)//2 + a = a_tmp + b = b_tmp + c = c_tmp + ans += 1 + + print(ans) +" +p03723,s137793112,Accepted,"a, b, c = map(int,input().split()) +k = 1 +ans = 0 + +for i in range(40): + if a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + d = a // 2 + e = b // 2 + f = c // 2 + a = e + f + b = d + f + c = d + e + ans += 1 + else: + k = 0 + break + +if k == 1: + print(-1) +else: + print(ans)" +p03723,s892086997,Accepted,"a, b, c = map(int, input().split()) + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +if a == b == c: + print(-1) + exit() + +cnt = 0 +while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + +print(cnt) +" +p03723,s215346817,Accepted,"a,b,c=map(int, input().split()) + +cnt=0 +for _ in range(10**5): + if a%2==1 or b%2==1 or c%2==1: + print(cnt) + exit() + a,b,c=b//2+c//2,c//2+a//2,a//2+b//2 + cnt+=1 +print(-1) +" +p03723,s458610157,Accepted,"a, b, c = map(int, input().split()) + +counter = 0 +while a%2==b%2==c%2==0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + counter += 1 + if counter > 26: + counter = -1 + break +print(counter)" +p03723,s265529328,Accepted,"A, B, C = map(int, input().split()) +ans = 0 + +while 1: + if A%2 != 0 or B%2 != 0 or C%2 != 0: + print(ans) + break + else: + tmp = [B//2 + C//2, C//2 + A//2, A//2 + B//2] + if tmp == [A,B,C]: + print(-1) + break + else: + A,B,C = tmp[0], tmp[1], tmp[2] + ans += 1" +p03723,s599824008,Accepted,"a,b,c=map(int,input().split()) +if a==b and a==c and a%2==0: + print(-1) +else: + cnt=0 + while a%2==0 and b%2==0 and c%2==0: + cnt+=1 + k=a + l=b + a=(b+c)//2 + b=(k+c)//2 + c=(k+l)//2 + print(cnt)" +p03723,s113165945,Accepted,"a, b, c = map(int, input().split()) +cnt = 0 +total = a + b + c +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + if a == (total - a) // 2: + cnt = -1 + break + a = (total - a) // 2 + b = (total - b) // 2 + c = (total - c) // 2 + cnt += 1 +print(cnt)" +p03723,s555847092,Wrong Answer,"def resolve(): + a, b, c = map(int, input().split()) + ans = 0 + if a == b == c: + print(-1) + exit() + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(ans) + exit() + while (a%2 == 0 and b%2 == 0 and c%2 == 0): + a, b, c = (b+c)//2, (a+c)//2 , (a+b)//2 + ans += 1 + print(ans) +resolve()" +p03723,s381715515,Wrong Answer,"a, b, c = map(int, input().split()) + +a_tmp = 0 +b_tmp = 0 +c_tmp = 0 + +flag = 0 +ans = 0 + +if a == b and b == c and c == a: + ans = -1 +else: + while flag == 0: + b_tmp += a/2 + c_tmp += a/2 + + a_tmp += b/2 + c_tmp += b/2 + + a_tmp += c/2 + b_tmp += c/2 + + a = a_tmp + b = b_tmp + c = c_tmp + + ans += 1 + + if a%2 == 1 or b%2 ==1 or c%2 ==1: + flag = 1 +print(ans)" +p03723,s597220665,Wrong Answer,"A, B, C = list(map(int, input().split())) + +if A == B == C: + print(-1) + exit() + +ans = 0 +while not any(n % 2 == 1 for n in [A, B, C]): + A, B, C = (A + B) // 2, (B + C) // 2, (C + A) // 2 + ans += 1 + +print(ans) +" +p03723,s992953296,Wrong Answer,"A, B, C = map(int, input().strip().split()) +ans = 0 +while A != B and B != C and (A % 2) + (B % 2) + (C % 2) == 0: + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + ans += 1 +if A == B == C: + ans = -1 +print(ans)" +p03723,s893761210,Wrong Answer,"def main(): + A, B, C = map(int, input().split()) + + ans = 0 + if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0: + print(-1) + else: + for i in range(10**9): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(ans) + exit() + + A, B, C = (B + C)//2, (A + C)//2, (A + B)//2 + ans += 1 + +if __name__ == ""__main__"": + main()" +p03723,s941348861,Wrong Answer," +a, b, c = list(map(int, input().split(' '))) +cnt = 0 +if a == b == c: + cnt = -1 +else: + while not (a%2 or b%2 or c%2): + cnt += 1 + a,b,c=(b+c)/2,(a+c)/2,(a+b)/2 + +print(cnt) +" +p03723,s863942119,Wrong Answer,"a, b, c = map(int, input().split()) +i = 0 +if a == b == c: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + at = a//2 + bt = b//2 + ct = c//2 + a = bt + ct + b = at + ct + c = at + bt + i+=1 + print(i)" +p03723,s636250679,Wrong Answer,"#!/usr/bin/env python + +a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +ans = 0 +while True: + ta = a + tb = b + tc = c + a = (tb+tc)//2 + b = (tc+ta)//2 + c = (ta+tb)//2 + ans += 1 + if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(ans) + exit() +" +p03723,s538064027,Wrong Answer,"a, b, c = map(int, input().split()) +cnt = 0 +if a == b and b == c: + print(-1) + exit() +while cnt >= 0: + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(cnt) + exit() + else: + a1 = (b + c) // 2 + b1 = (a + c) // 2 + c1 = (a + b) // 2 + a = a1 + b = b1 + c = c1 + cnt += 1 +print(cnt)" +p03723,s379255134,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(f'{e&-e:b}')-(e==b&1))" +p03723,s081631564,Wrong Answer,"A, B, C = map(int, input().split()) +cnt = 0 +while A%2 == B%2 == C%2 == 0: + x = (B+C)//2 + y = (A+C)//2 + z = (A+B)//2 + A = x + B = y + C = z + cnt += 1 +if A == B == C: + print(-1) +else: + print(cnt)" +p03723,s409211247,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + n_A = (B + C) / 2 + n_B = (A + C) / 2 + n_C = (A + B) / 2 + A = n_A + B = n_B + C = n_C + ans += 1 + print(ans)" +p03723,s640773094,Wrong Answer," +a, b, c = list(map(int, input().split(' '))) +cnt = 0 +if a == b == c: + cnt = -1 +else: + while (a+1)%2 or (b+1)%2 or (c+1)%2: + cnt += 1 + a,b,c=(b+c)/2,(a+c)/2,(a+b)/2 + +print(cnt) +" +p03723,s947350580,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C or A%2 != 0 or B%2 != 0 or C%2 != 0: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = B/2+C/2,A/2+C/2,B/2+C/2 + ans += 1 +print(ans)" +p03723,s990240323,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + print(-1) + exit() + +cnt = 0 +while True: + if a % 2 or b % 2 or c % 2: + break + cnt += 1 + next_a = b // 2 + c // 2 + next_b = a // 2 + c // 2 + next_c = a // 2 + b // 2 + a = next_a; b = next_b; c = next_c +print(cnt)" +p03723,s829463629,Wrong Answer,"## A - Cookie Exchanges +A, B, C = map(int, input().split()) +if A == B == C: + ans = -1 +else: + ans = 0 + while A%2 == B%2 == C%2 == 0: + a = (B+C) // 2 + b = (C+A) // 2 + c = (A+B) // 2 + A = a + B = b + C = c + ans += 1 +print(ans)" +p03723,s057143460,Wrong Answer,"A,B,C = map(int,input().split()) +if A == B and B == C and C == A: + print(-1) +else: + count = 0 + while(A%2==0 and B%2 == 0 and C%2==0): + A_ = A + B_ = B + A = (B+C)/2 + B = (A_+C)/2 + C = (A_+B_)/2 + print(A,B,C) + count+=1 + print(count)" +p03723,s998837470,Wrong Answer,"A, B, C = map(int, input().split()) +count = 0 +if A == B and B == C: + print(-1) + exit() + +while A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + count += 1 +print(count) + +" +p03723,s965913493,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + n_A = (B + C) / 2 + n_B = (A + C) / 2 + n_C = (B + C) / 2 + A = n_A + B = n_B + C = n_C + ans += 1 + print(ans)" +p03723,s704566867,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if (A == B and B == C) or (A % 4 == 0 and B % 4 == 0 and C % 4 == 0): + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s885846789,Wrong Answer,"A,B,C = map(int, input().split()) +cnt = 0 +if A == B and B == C: + print(-1) + exit() +while True: + if A%2 or B%2 or C%2: + print(cnt) + break + temp_a = A//2 + temp_b = B//2 + temp_c = C//2 + A += 2*temp_a + temp_b + temp_c + B += 2*temp_b + temp_a + temp_c + C += 2*temp_c + temp_a + temp_b + cnt += 1" +p03723,s443126599,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + +else: + cnt = 0 + while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + print(cnt)" +p03723,s704244531,Wrong Answer,"a = list(map(int,input().split())) +cna = cnb = 0 +a.sort() +x = a[2]-a[1] +y = a[1]-a[0] +while True: + if x%2 == 0 and x != 0: + cna += 1 + x //= 2 + else: + break +while True: + if y%2 == 0 and y != 0: + cnb += 1 + y //= 2 + else: + break +if cna == 0 and cnb == 0: + print(-1) +else: + print(min(cna,cnb))" +p03723,s502434097,Wrong Answer,"import sys +a, b, c = [int(w) for w in input().split()] + +ans = 0 + + +def is_fin(a, b, c): + global ans + if a == b == c: + ans = -1 + return True + elif a % 2 or b % 2 or c % 2: + return True + else: + return False + + +while not is_fin(a, b, c): + ta = (b+c)/2 + tb = (a+c)/2 + tc = (a + b) / 2 + a, b, c = ta, tb, tc + ans += 1 + +print(ans) +" +p03723,s035240871,Wrong Answer,"A,B,C= map(int,input().split()) + +if A==B==C: + print('-1') +else: + cnt = 0 + + flag = True + while flag: + A, B, C = (B+C)//2, (A+C)//2, (A+B)//2 + cnt += 1 + if A%2==0 and B%2==0 and C%2==0: + continue + else: + flag = False + + print(cnt)" +p03723,s455580505,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +cnt = 0 +while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + +print(cnt) +" +p03723,s036191770,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + if a % 2 == 0: + print(-1) + else: + print(1) +else: + ans = 0 + while a % 2 == 0 and b % 2 == 0: + a1 = a + b1 = b + c1 = c + a = (b1+c1)/2 + b = (a1+c1)/2 + c = (a1+b1)/2 + ans += 1 + print(ans) +" +p03723,s706853363,Wrong Answer,"a,b,c=map(int,input().rstrip().split(' ')) +if(a==b and b==c): + print(-1) +else: + n=0 + while(a%2==0 and b%2==0 and c%2==0): + n+=1 + tmp_a=(b+c)/2 + tmp_b=(a+c)/2 + tmp_c=(b+a)/2 + a=tmp_a + b=tmp_b + c=tmp_c + print(n) +" +p03723,s332040346,Wrong Answer,"a,b,c = map(int,input().split("" "")) +n = 0 +if a == b == c: + print(-1) + exit() +for i in range(10**9): + aa = a//2 + bb = b//2 + cc = c//2 + a = bb + cc + b = aa + cc + c = aa + bb + n += 1 + if a % 2 == 1: + break + if b % 2 == 1: + break + if c % 2 == 1: + break +print(n)" +p03723,s394468871,Wrong Answer,"A, B, C = list(map(int, input().split())) +if A == B == C: + print(-1) + exit() +ans = 0 +while True: + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + else: + break +print(ans) +" +p03723,s823455602,Wrong Answer,"A,B,C = map(int, input().split()) + +def even(a): + if a % 2 == 0: + return True + else: + return False + +if A == B and B == C: + print(""-1"") + +elif not (even(A) and even(B) and even(C)): + print(""0"") + +else: + cnt = 0 + while even(A) and even(B) and even(C): + tmp1, tmp2, tmp3 = A,B,C + A = (tmp2+tmp3) // 2 + B = (tmp3+tmp1) // 2 + C = (tmp1+tmp2) // 2 + cnt += 1 + print(cnt) +" +p03723,s194881812,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b and b==c: + print(-1) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + a0,b0,c0=(b+c)//2,(c+a)//2,(a+b)//2 + a,b,c=a0,b0,c0 + ans+=1 + print(ans)" +p03723,s405162165,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +else: + ans = 0 + while A%2 == B%2 == C%2 == 0: + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + ans += 1 + print(ans) +" +p03723,s182098236,Wrong Answer,"def main(): + A, B, C = map(int, input().split()) + + ans = 0 + if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0: + print(-1) + else: + for i in range(10**5): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(ans) + exit() + + A, B, C = (B + C)//2, (A + C)//2, (A + B)//2 + ans += 1 + +if __name__ == ""__main__"": + main()" +p03723,s216217034,Wrong Answer,"import sys +import numpy as np +sys.setrecursionlimit(10 ** 7) + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +cookies = np.array(lr()) +if len(set(cookies)) == 1: + print(-1) + exit() +if any(cookies&1): + print(0) + exit() +count = 0 +half_total = cookies.sum() // 2 +while True: + cookies = half_total - cookies//2 + print(cookies) + count += 1 + if any(cookies&1): + print(count) + break + if count == 10000: + print(-1) + exit() +" +p03723,s016251026,Wrong Answer,"if __name__ == ""__main__"": + a, b, c = map(int, input().split()) + + if a == b == c: + print(-1) + exit() + + ans = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a_tmp = (b+c)//2 + b_tmp = (a+c)//2 + c_tmp = (c+a)//2 + a = a_tmp + b = b_tmp + c = c_tmp + ans += 1 + + print(ans) +" +p03723,s758852218,Wrong Answer,"A,B,C = map(int,input().split()) + +def main(a,b,c): + if a == b and b == c: + return -1 + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + return 0 + + cnt = 0 + while True: + #print(a,b,c) + a1,b1,c1 = a,b,c + a = (b1+c1)//2 + b = (a1+c1)//2 + c = (a1+b1)//2 + cnt += 1 + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + return cnt + + +ans = main(A,B,C) +print(ans)" +p03723,s313847975,Wrong Answer,"A, B, C = map(int,input().split()) +c = 0 + +if A == B == C and ((A % 2 != 0) or (B % 2 != 0) or (C % 2 != 0)): + c = -1 +else: + while (A % 2 == 0) and (B % 2 == 0) and (C % 2 == 0): + A, B, C = B/2+C/2, C/2+A/2, A/2+B/2 + c += 1 + +print(c)" +p03723,s953019232,Wrong Answer,"A,B,C = map(int, input().split()) + +def even(a): + if a % 2 == 0: + return True + else: + return False + +cnt = 0 +if A == B and B == C: + cnt = -1 + +elif not (even(A) and even(B) and even(C)): + cnt = 0 + +else: + cnt = 0 + while even(A) and even(B) and even(C): + tmp1, tmp2, tmp3 = A,B,C + A = (tmp2+tmp3) // 2 + B = (tmp3+tmp1) // 2 + C = (tmp1+tmp2) // 2 + cnt += 1 + +print(cnt) +" +p03723,s602225203,Wrong Answer,"a,b,c = list(map(int, input().strip().split())) +f=0 +if a==b and b==c: + f=-1 + print(f) +else: + while a%2==0 and b%2==0 and c%2==0: + A=a + B=b + C=c + a=B//2+C//2 + b=A//2+C//2 + c=A//2+B//2 + f=f+1 + else: + print(f)" +p03723,s593771283,Wrong Answer,"a,b,c=map(int,input().split()) +cnt=0 +if a==b==c: + print(-1) + exit() +while a%2==b%2==c%2==0: + a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 + cnt+=1 +print(cnt) +" +p03723,s451054447,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) +elif a%2!=0 or b%2!=0 or c%2!=0: + print(0) +else: + total=0 + while True: + x=a/2 + y=b/2 + z=c/2 + a=y+z + b=x+z + c=x+y + total+=1 + if a%2!=0 or b%2!=0 or c%2!=0: + print(total) + break" +p03723,s542166284,Wrong Answer,"A, B, C = list(map(int, input().split())) + +if A == B == C: + print(-1) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + c += 1 + A2 = (B + C) // 2 + B2 = (A + C) // 2 + C2 = (A + B) // 2 + + A = A2 + B = B2 + C = C2 + print(c)" +p03723,s260276820,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + cnt = 0 + while A%2 == B%2 == C%2 == 0: + x = B//2+C//2 + y = A//2+C//2 + z = A//2+B//2 + A = x + B = y + C = z + cnt += 1 + print(cnt)" +p03723,s245728194,Wrong Answer,"a,b,c= map(int,input().split()) +cnt = 0 +if a == b and b == c: + if a%2 == 0 and b%2 == 0 and c%2 == 0: + print(-1) + exit() + else: + print(0) +while a%2 == 0 and b%2 == 0 and c%2 == 0: + cnt +=1 + x =(b+c)//2 + y =(c+a)//2 + z =(b+a)//2 + a = x + b = y + c = z +print(cnt)" +p03723,s557639812,Wrong Answer,"A,B,C = map(int,input().split()) + +if A == B == C or (C+B == 2*A and A+B == 2*C and A+C == 2*B): + print(-1) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ba = A + bb = B + bc = C + A = bb//2 + bc//2 + B = ba//2 + bc//2 + C = ba//2 + bb//2 + c+=1 + print(c) +" +p03723,s517784254,Wrong Answer,"def mapint_inp(): + return map(int, input().split()) + +A, B, C = mapint_inp() + +print(-1)" +p03723,s405871466,Wrong Answer,"import sys +a,b,c=map(int,input().split()) +ans=0 +if a%2==1 or b%2==1 or c%2==1: + print(-1) + sys.exit() +if a%2==0 and a==b==c: + print(-1) + sys.exit() +while a%2==0 and b%2==0 and c%2==0: + ta=a/2 + tb=b/2 + tc=c/2 + a=tb+tc + b=ta+tc + c=ta+tb + ans+=1 +print(ans)" +p03723,s285062681,Wrong Answer,"a,b,c=map(int,input().split()) +ans=0 +while a%2==0 and b%2==0 and c%2==0: + d,e,f=0,0,0 + d=(b+c)//2 + e=(a+c)//2 + f=(a+b)//2 + a,b,c=d,e,f + ans+=1 + if ans==100000: + break +print(ans)" +p03723,s432942245,Wrong Answer,"a, b, c=map(int, input().split()) +if a==b and b==c: + print(-1) +else: + cnt=0 + while(1): + if a%2==1 or b%2==1 or c%2==1: + print(cnt) + break + cnt+=1 + ha=a/2 + hb=b/2 + hc=c/2 + a=hb+hc + b=ha+hc + c=ha+hb + + " +p03723,s907957000,Wrong Answer,"A,B,C=[int(s) for s in input().split("" "")] + +A=[A] +B=[B] +C=[C] + +Count=0 +for i in range(1000): + A.append(B[i]/2+C[i]/2) + B.append(A[i]/2+C[i]/2) + C.append(B[i]/2+A[i]/2) + Count+=1 + if A[i+1]%2!=0 or B[i+1]%2!=0 or C[i+1]%2!=0: + break + if Count>=1000: + Count=-1 + +print(Count)" +p03723,s455725878,Wrong Answer,"cookie = list(map(int,input().split())) + +if len(set(cookie)) == 1: + print(-1) +else: + con = 0 + while True: + a = cookie[0] // 2 + b = cookie[1] // 2 + c = cookie[2] // 2 + cookie[0] = b + c + cookie[1] = c + a + cookie[2] = a + b + con += 1 + if any([i % 2 != 0 for i in cookie]): + break + + print(con)" +p03723,s624691012,Wrong Answer,"a, b, c = map(int, input().split()) + +flag = 0 +ans = 0 + +if a == b == c: + ans = -1 + +else: + while flag == 0: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + flag = 1 + + else: + a_tmp = (b+c)/2 + b_tmp = (a+c)/2 + c_tmp = (a+b)/2 + + a = a_tmp + b = b_tmp + c = c_tmp + + ans += 1 + +print(ans)" +p03723,s310281469,Wrong Answer,"a, b, c = map(int, input().split()) +za = 0 +zb = 0 +zc = 0 + +d = 0 + +if a == b == c: + print(-1) + exit() +elif not(a % 2 == 0 and b % 2 == 0 and c % 2 ==0): + print(0) + exit() + + +while a % 2 == 0 and b % 2 == 0 and b % 2 == 0: + + za = a + zb = b + zc = c + + a = zb // 2 + zc // 2 + b = za // 2 + zc // 2 + c = za // 2 + zb // 2 + + d += 1 + +print(d)" +p03723,s736128546,Wrong Answer,"A, B, C = map(int, input().split()) +cnt = 0 +flag_cnt=0 +while(1): + A_tmp = A + B_tmp = B + C_tmp = C + A = (B_tmp+C_tmp)/2 + B = (A_tmp+C_tmp)/2 + C = (A_tmp+C_tmp)/2 + cnt += 1 + if A%2!=0 or B%2!=0 or C%2!=0: + break + if A_tmp==A and B_tmp==B and C_tmp==C: + flag_cnt+=1 + if flag_cnt==2: + cnt = -1 + break +print(cnt)" +p03723,s860759194,Wrong Answer,"import sys +input = sys.stdin.readline + +def readlines(n): + for _ in range(n): + yield map(int, input().split()) + + +def main(): + a, b, c = map(int, input().split()) + if a == b == c: + yield -1 + return + + while all(x%2 == 0 for x in (a, b, c)): + a_ = a//2 + b_ = b//2 + c_ = c//2 + a, b, c = b_+c_, a_+c_, a_+b_ + yield 1 + + +print(sum(main())) +" +p03723,s873612199,Wrong Answer,"a,b,c=map(int,input().split()) +if (a==b==c): + print(-1) +elif (a%2==1 or b%2==1 or c%2==1): + print(0) +else: + for i in range(1,10**9): + a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2) + #print(a,b,c) + if (a%2==1 or b%2==1 or c%2==1): + print(i) + break +" +p03723,s911646986,Wrong Answer,"a, b, c = map(int,input().split()) +ans = 0 +l = [a] + +while True: + ans += 1 + x = b//2 + c//2 + y = a//2 + c//2 + z = a//2 + b//2 + if x%2 == 1 or y%2 == 1 or z%2 == 1: + break + else: + a = x + if a in l: + print(-1) + exit() + else: + l.append(a) + b = y + c = z + +print(ans)" +p03723,s381719102,Wrong Answer,"a,b,c = map(int,input().split()) +count = 0 + + +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + if a == b and b == c: + break + else: + aDummy = a/2 + bDummy = b/2 + cDummy = c/2 + a = (bDummy) + (cDummy) + b = (aDummy) + (cDummy) + c = (aDummy) + (bDummy) + count += 1 +print(-1 if a == b and b == c else count)" +p03723,s100938095,Wrong Answer,"A,B,C = map(int,input().split()) +cou = 0 +if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(""0"") +while(cou < 10*7): + cou += 1 + A = B/2 + C/2 + B = A/2 + C/2 + C = A/2 + B/2 + if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(str(cou)) + break + else: + pass +print(""-1"")" +p03723,s635531223,Wrong Answer,"A, B, C = map(int, input().split()) + +cnt = 0 +while True: + if (A == B) & (B == C): + print(-1) + exit(0) + elif (A % 2) | (B % 2) | (C % 2): + print(cnt) + exit(0) + else: + a, b, c = A // 2, B // 2, C // 2 + A, B, C = b + c, a + c, a + b + cnt += 1 +print(cnt) +" +p03723,s971266686,Wrong Answer,"import math +import sys + +a, b, c = map(int, input().split()) +cnt = 0 +if (a == b == c): + print(-1) + sys.exit() + + +while(True): + cnt += 1 + half_a, half_b, half_c = a / 2, b / 2, c / 2 + ea = half_a % 2 == 0 + eb = half_b % 2 == 0 + ec = half_c % 2 == 0 + if (ea and eb and ec or (not ea) and (not eb) and (not ec)): + a = half_b + half_c + b = half_a + half_c + c = half_a + half_b + else: + break + +print(cnt) +" +p03723,s607114728,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) + exit() +cnt=0 +while True: + x=(b+c)//2 + y=(a+c)//2 + z=(a+b)//2 + a,b,c = x,y,z + cnt+=1 + if a%2 != 0 or b%2 != 0 or c%2 !=0: + break +print(cnt)" +p03723,s428219886,Wrong Answer,"import sys + + +inint = lambda: int(sys.stdin.readline()) +inintm = lambda: map(int, sys.stdin.readline().split()) +inintl = lambda: list(inintm()) +instrm = lambda: map(str, sys.stdin.readline().split()) +instrl = lambda: list(instrm()) + +a, b, c = inintm() + +if a == b == c: + print(-1) + exit() + +ans = 0 + +while a % 2 == b % 2 == c % 2 == 0: + d = a + e = b + f = c + a = e/2 + f/2 + b = d/2 + f/2 + c = d/2 + e/2 + ans += 1 + +print(ans)" +p03723,s292190112,Wrong Answer,"a,b,c = map(int,input().split()) +for i in range(600): + if a == b and b == c: + break + a,b,c = a//2, b//2, c//2 + a, b, c = b + c, a + c, a + b +ans = i if i < 600 else -1 +print(ans) + " +p03723,s952572039,Wrong Answer,"import sys +import numpy as np +sys.setrecursionlimit(10 ** 7) + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +cookies = np.array(lr()) +if len(set(cookies)) == 1: + print(-1) + exit() +if any(cookies&1): + print(0) + exit() +count = 0 +half_total = cookies.sum() // 2 +while True: + cookies = half_total - cookies//2 + count += 1 + if any(cookies&1): + print(count) + break + if count == 1000000: + print(-1) + exit() +" +p03723,s138087787,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +N = (a + b + c) // 3 +cnt = 1 +while N: + if N % 2 != 0: break + N //= 2 + cnt += 1 + +print(cnt) +" +p03723,s299196416,Wrong Answer,"import sys +a,b,c = map(int,input().split("" "")) +li = [[a,b,c]] +count = 0 +for i in range(100): + a2 = a/2 + b2 = b/2 + c2 = c/2 + a = b2+c2 + b = c2+a2 + c = a2+b2 + count += 1 + if (a % 2)==1 or (b % 2)==1 or (c % 2)==1: + break + elif [a,b,c] in li: + print(-1) + sys.exit() + else: + li.append([a,b,c]) + +print(count)" +p03723,s299980438,Wrong Answer,"def main(): + A, B, C = map(int, input().split()) + + ans = 0 + if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0: + print(-1) + else: + for i in range(10**7): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(ans) + exit() + + A, B, C = (B + C)//2, (A + C)//2, (A + B)//2 + ans += 1 + +if __name__ == ""__main__"": + main()" +p03723,s468998111,Wrong Answer,"A,B,C = map(int,input().split()) +cnt = 0 +if A == B: + if B == C: + print(-1) + exit() +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + a = A / 2 + b = B / 2 + c = C / 2 + A = b + c + B = a + c + C = a + b + cnt+=1 +print(cnt)" +p03723,s640034609,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + if a % 2 == 0: + print(-1) + else: + print(1) +else: + ans = 0 + while a % 2 != 0 or b % 2 != 0: + a1 = a + b1 = b + c1 = c + a = (b1+c1)/2 + b = (a1+c1)/2 + c = (a1+b1)/2 + ans += 1 + print(ans) + " +p03723,s555016363,Wrong Answer,"a,b,c=list(map(int,input().split())) +n=0 +H=[] +while True: + S=[a,b,c] + if S in H: + print(""-1"") + exit() + H.append(S) + if a%2!=0 and b%2!=0 and c%2!=0: + print(n) + exit() + else: + A=a/4 + B=b/4 + C=c/4 + a=a/2+B+C + b=b/2+A+C + c=c/2+A+B + n+=1" +p03723,s219899400,Wrong Answer,"A, B, C = map(int, input().split()) +X = (A|B|C)^(A&B&C) +ans = (X&-X).bit_length()-1 +print(ans) +" +p03723,s354482062,Wrong Answer,"A, B, C = map(int,input().split()) + +if A == B == C == 1: + print(0) + +elif A == B == C: + print(-1) + exit() + +LA = [] +LB = [] +LC = [] +LA.append(A) +LB.append(B) +LC.append(C) +i = 0 +cnt = 0 + +while LA[i] % 2 == 0 and LB[i] % 2 == 0 and LC[i] % 2 == 0: + LA.append((LB[i]+LC[i])/2) + LB.append((LC[i]+LA[i])/2) + LC.append((LA[i]+LB[i])/2) + i += 1 + cnt += 1 + +print(cnt) +" +p03723,s344727486,Wrong Answer,"a,b,c = map(int,input().split()) +if a == b == c: + if a%2 == b%2 == c%2 == 0: + print(-1) + else: + print(0) +t = 0 +while t > -1: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + break + (a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2) + t += 1 +print(t)" +p03723,s710862542,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B and B == C: + print(-1) +elif A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(0) +else: + step = 0 + while True: + step += 1 + nA = B // 2 + C // 2 + nB = A // 2 + C // 2 + nC = A // 2 + B // 2 + A, B, C = nA, nB, nC + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(step) + break" +p03723,s307819925,Wrong Answer,"x,y,z = map(int,input().split()) + +ans = 0 + +s = [] + +while True: + x,y,z = y//2+z//2,x//2+z//2,x//2+y//2 + if x%2 == 0 and y%2 == 0 and z%2 == 0: + ans += 1 + if [x,y,z] in s: + print(-1) + break + else: + s.append([x,y,z]) + else: + print(ans+1) + break + if tuple([x,y,z]) in s: + print(-1) + break" +p03723,s054093528,Wrong Answer,"A,B,C=map(int,input().split()) +if (A==B)and(B==C): + print(""-1"") +else: + count=0 + while True: + if (A%2==0)and(B%2==0)and(C%2==0): + a=(B+C)/2 + b=(A+C)/2 + c=(A+B)/2 + A=a + B=b + C=c + count=count+1 + else: + break + print(count)" +p03723,s254530838,Wrong Answer,"a,b,c = map(int,input().split()) +acnt = 0 +bcnt = 0 +ccnt = 0 +cnt = 0 + +if a == b == c and a%2 == 0: + print(-1) + exit() + +while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1: + cnt += 1 + acnt = (b+c)//2 + bcnt = (a+c)//2 + ccnt = (a+b)//2 + a = acnt + b = bcnt + c = ccnt + +print(cnt)" +p03723,s325768218,Wrong Answer,"x, y, z = map(int,input().split()) +a =[x] +b =[y] +c =[z] +if a[0] == b[0] == c[0]: + print('-1') + exit() +for i in range(10): + if a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0: + a.append((b[i] + c[i]) // 2) + b.append((a[i] + c[i]) // 2) + c.append((b[i] + a[i]) // 2) + + else: + print(i) + exit() + " +p03723,s970164736,Wrong Answer,"a,b,c = map(int,input().split()) +count = 0 +if a == b == c : + print(-1) +else: + while a%2 == 1 or b%2 == 1 or c%2 == 1: + a1 = a + b1 = b + c1 = c + a = a1//2 + b1//2 + c1//2 + b = a1//2 + b1//2 + c1//2 + c = a1//2 + b1//2 + c1//2 + count += 1 + print(count)" +p03723,s518565881,Wrong Answer,"A,B,C = map(int,input().split()) +if A == B and B == C and C == A: + print(-1) +else: + count = 0 + while(A%2==0 and B%2 == 0 and C%2==0): + A_ = A + B_ = B + A = (B+C)/2 + B = (A_+C)/2 + C = (A_+B_)/2 + count+=1 + print(count)" +p03723,s809978588,Wrong Answer,"a, b, c = map(int, input().split()) +if (a+b)%4 == (b+c)%4 == (c+a)%4 == 0: + print(-1) +else: + counter = 0 + while a%2==b%2==c%2==0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + counter += 1 + print(counter)" +p03723,s689445570,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + n_A = (B + C) / 2 + n_B = (A + C) / 2 + n_C = (A + B) / 2 + A = n_A + B = n_B + C = n_C + print(A,B,C) + ans += 1 + print(ans)" +p03723,s086908301,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 + +if A == B and B == C: + print(-1) + exit() + +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A,B,C = (B+C)//2,(C+A)//2,(A+B)//2 + ans += 1 + + if A == B and B == C: + print(-1) + exit() + +print(ans) +" +p03723,s257949789,Wrong Answer,"A,B,C = map(int,input().split()) +cnt=0 + +if A==B==C: + cnt=-1 +else: + while A%2==0 and B%2==0 and C%2==0: + s=A//2 + t=B//2 + u=C//2 + A=t+u + B=u+s + C=s+t + cnt +=1 + +print(cnt)" +p03723,s811494628,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() + +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if a == b and b == c: + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s149234112,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b and b == c: + if a%2 == 0: + print(-1) + else: + print(0) +else: + ans = 0 + while a % 2 == 0 and b % 2 == 0: + a1 = a + b1 = b + c1 = c + a = (b1+c1)/2 + b = (a1+c1)/2 + c = (a1+b1)/2 + ans += 1 + print(ans)" +p03723,s687965900,Wrong Answer,"import copy +a,b,c = map(int,input().split()) +cnt = 0 +while 1: + cnt += 1 + next_a = b // 2 + c // 2 + next_b = a // 2 + c // 2 + next_c = a // 2 + b // 2 + if a == next_a and b == next_b and c == next_c: + print(-1) + break + elif (next_a % 2 == 1) or (next_b % 2 == 1) or (next_c % 2 == 1): + print(cnt) + break + a = copy.deepcopy(next_a) + b = copy.deepcopy(next_b) + c = copy.deepcopy(next_c) + + +" +p03723,s733503549,Wrong Answer,"a,b,c=map(int,input().split()) +ab,bc,ca=abs(a-b),abs(b-c),abs(c-a) +ans=0 +if a==b==c: + print(-1) +else: + while ab%2==0 and bc%2==0 and ca%2==0: + ab//=2 + bc//=2 + ca//=2 + ans+=1 + print(ans) +" +p03723,s162151907,Wrong Answer,"A,B,C=map(int,input().split()) +ans=0 + +if A==B and B==C: + ans=-1 + pass +else: + while True: + if A%2!=0 or B%2!=0 or C%2!=0: + break + + A,B,C=B/2+C/2,A/2+C/2,A/2+B/2 + ans+=1 + +print(ans)" +p03723,s740731929,Wrong Answer,"#!/usr/bin/env python3 + +import sys +sys.setrecursionlimit(10**6) + +def solve(a,b,c,counter=0): + if a == b == c: + return -1 + elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + return counter + else: + return solve((b+c)//2,(c+a)//2,(a+b)//2,counter+1) + + +def main(): + A, B, C = map(int,input().split()) + print(solve(A,B,C)) + +if __name__ == '__main__': + main() +" +p03723,s692335448,Wrong Answer,"# おっぱっぴー + +A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +for i in range(100): + A, B, C = B/2+C/2, A/2+C/2, A/2+B/2 + + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(i+1) + break" +p03723,s289567483,Wrong Answer,"A, B, C = map(int, input().strip().split()) +def f(a): + if a % 4 == 0: + return 2 + elif a % 2 == 0: + return 1 + else: + return 0 + +if f(A) == 0 or f(B) == 0 or f(C) == 0: + print(0) +elif f(A) == 1 or f(B) == 1 or f(C) == 1: + print(1) +else: + print(-1)" +p03723,s133325179,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b and a==c: + ans=-1 +for i in range(1,100000): + x=a//2 + y=b//2 + z=c//2 + a=y+z + b=x+z + c=x+y + print(""{}-{}-{}"".format(a,b,c)) + if a%2==1 or b%2==1 or c%2==1: + ans=i + break +print(ans)" +p03723,s284121794,Wrong Answer,"#!/usr/bin/env python3 +a, b, c = map(int, input().split()) +if (a + b + c) % 2 != 1: + print(-1) +else: + cnt = 0 + + while True: + if a % 2 or b % 2 or c % 2: + break + cnt += 1 + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + print(cnt) +" +p03723,s986317039,Wrong Answer,"a, b, c = map(int, input().split()) +t = 0 +if a == b == c: + print(-1) + +else: + while (a % 2 + b % 2 + c % 2) == 0: + a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2 + t += 1 + + print(t)" +p03723,s350657540,Wrong Answer,"a, b, c =map(int, input().split()) + +if a== b and b==c and c==a : + print(-1) +else: + count = 0 + while(a%2==0 and b%2==0 and c%2 ==0): + new_a, new_b, new_c = b//2 + c//2, a//2 + c//2, a//2 + b//2 + a, b, c = new_a, new_b, new_c + count+=1 + print(count) + " +p03723,s869590537,Wrong Answer,"l = list(map(int,input().split())) +ans = 0 +if l[0] == l[1] == l[2]: + print(-1) + exit() +while all(i % 2 == 0 for i in l): + a = l[0]//2; b = l[1]//2; c = l[2]//2; + l[0] = b + c + l[1] = a + c + l[2] = a + b + ans += 1 +print(ans)" +p03723,s414817783,Wrong Answer,"a, b, c = [int(i) for i in input().split()] + +cnt = 0 +history = set() +while True: + print(a, b, c, ""-"", cnt, history) + if (a, b, c) in history: + print(-1) + exit(0) + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(cnt) + exit(0) + a, b, c = sorted([a, b, c]) + history.add((a, b, c)) + na = b // 2 + c // 2 + nb = a // 2 + c // 2 + nc = a // 2 + b // 2 + a = na + b = nb + c = nc + cnt += 1" +p03723,s701647133,Wrong Answer,"a,b,c = map(int,input().split()) +acnt = 0 +bcnt = 0 +ccnt = 0 +cnt = 0 + +if a == b and a== c and a%2 == 0: + print(-1) + exit() + +while acnt%2 == 0 and bcnt%2 == 0 and ccnt%2 == 0: + cnt += 1 + acnt = (b+c)//2 + bcnt = (a+c)//2 + ccnt = (a+b)//2 + a = acnt + b = bcnt + c = ccnt + +print(cnt)" +p03723,s031669608,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + count = 0 + while 0 == A % 2 == B % 2 == C % 2: + _A = (B + C) // 2 + _B = (C + A) // 2 + _C = (A + B) // 2 + A = _A + B = _B + C = _C + count += 1 + # print(""A: {}, B: {}, C: {}"".format(A, B, C)) + print(count) + " +p03723,s739660534,Wrong Answer,"a, b, c = map(int, input().split()) +cnt = 0 +total = a + b + c +while a % 2 == 0 or b % 2 == 0 or c % 2 == 0: + if a == (total - a) // 2: + cnt = -1 + break + a = (total - a) // 2 + b = (total - b) // 2 + c = (total - c) // 2 + cnt += 1 +print(cnt)" +p03723,s184745906,Wrong Answer,"A,B,C =map(int,input().split()) +con = 0 + +if A == B and B == C: + print(-1) + exit() +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + con += 1 + D = A / 2 + E = B / 2 + F = C / 2 + A = E + F + B = D + F + C = D + E + +print(con)" +p03723,s608866462,Wrong Answer,"a,b,c=map(int,input().split()) +cnt=0 +if a==b==c or a%2==b%2==c%2==1: + print(-1) + exit() +while a%2==b%2==c%2==0: + a,b,c=(b+c)/2,(a+c)/2,(a+b)/2 + cnt+=1 +print(cnt) +" +p03723,s387119645,Wrong Answer,"a,b,c = map(int,input().split()) +i=0 +if a==b==c : + print(""-1"") +else: + while a%2==0 and b%2==0 and c%2==0: + a/2 + b/2 + c/2 + i+=1 + +print(i)" +p03723,s794496698,Wrong Answer,"A,B,C = map(int,input().split()) +count = 0 +while A%2 == 0 and B%2 == 0 and C%2 == 0 and count < 10**5: + A_copy = A + B_copy = B + A = (B+C)/2 + B =(A_copy+C)/2 + C = (A_copy+B_copy)/2 + count += 1 +if count == 10**5-1: + print(-1) +else: + print(count)" +p03723,s459894522,Wrong Answer,"a, b, c = map(int,input().split()) +count = 0 +def exchange(a, b, c, count): + a, b, c = int((b+c)/2), int((a+c)/2), int((a+b)/2) + count += 1 + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + return a, b, c, count + else: + return exchange(a, b, c, count) +if a == b == c: + print(""-1"") +else: + aa, bb, cc, count = exchange(a, b, c, count) + print(count)" +p03723,s353064605,Wrong Answer,"A,B,C = map(int, input().split()) +result = 0 + +if A == B == C: + result = -1 +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + result += 1 + a = A/2 + b = B/2 + c = C/2 + A = b + c + B = a + c + C = b + a + +print(result)" +p03723,s798482756,Wrong Answer,"*l, = map(int, input().split()) + +ans = 0 +while True: + a = (l[1] + l[2]) // 2 + b = (l[0] + l[2]) // 2 + c = (l[0] + l[1]) // 2 + if l == [a, b, c]: + ans = -1 + break + l = [a, b, c] + ans += 1 + if a%2 or b%2 or c%2: + break + +print(ans)" +p03723,s462162152,Wrong Answer,"a, b, c = map(int,input().split()) + +count = 0 +if a==b==c: + print(-1) +else: + while a%2 == 0 and b%2 == 0 and c%2 == 0: + a, b, c = b//2+c//2, c//2+a//2, a//2+b//2 + count += 1 + print(count)" +p03723,s259931368,Wrong Answer,"# -*- coding: utf-8 -*- + +a,b,c=map(int,input().split()) + +ans=0 +while True: + if a==b==c: + ans=-1 + break + if a%2==1 or b%2==1 or c%2==1: + break + ans+=1 + na=(b+c)/2 + nb=(c+a)/2 + nc=(a+b)/2 + a=na + b=nb + c=nc +print(ans) +" +p03723,s552655977,Wrong Answer,"def check(A,B,C): + if A==0 or B==0 or C==0: + return False + if A%2!=0 or B%2!=0 or C%2!=0: + return False + return True + +A,B,C=map(int,input().split()) +ans=0 +if A==B==C: + print(-1) + exit() +while check(A,B,C)==True: + a=B//2+C//2 + b=A//2+C//2 + c=A//2+B//2 + A,B,C=a,b,c + print(A,B,C) + ans+=1 + if 10**9int: + if(A == B and B == C): + return -1 + counter = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = ((B//2 + C//2), (A//2 + C//2), (A//2 + B//2)) + counter += 1 + return counter + +def modelAnswer(): + tmp=1 +def main(): + A,B,C = map(int,input().split()) + print(myAnswer(A,B,C)) + +if __name__ == '__main__': + main()" +p03723,s499476934,Wrong Answer," +def waru2cnt(n): + cnt = 0 + while n % 2 == 0 and n != 0: + n //= 2 + cnt += 1 + return cnt + +a = list(map(int, input().split(' '))) +a.sort() +x = 2 * a[2] - a[1] - a[0] + +print([waru2cnt(x),-1][x==0]) +" +p03723,s321984646,Wrong Answer,"a,b,c = map(int,input().split()) +count = 0 +if a==b and b==c: + count = -1 +else: + while True: + if a%2==1 or b%2==1 or c%2==1: + break + d = a;e = b + a = b//2 + c//2 + b = d//2 + c//2 + c = d//2 + e//2 + count += 1 +print(count)" +p03723,s785081374,Wrong Answer,"A, B, C = map(int, input().split()) +x, y = abs(A-B), abs(B-C) +ans = 0 +if x == 0 and y == 0: + print(-1) + exit() + +while x % 2 == 0 and y % 2 == 0: + x, y = x // 2, y // 2 + ans += 1 +print(ans)" +p03723,s868129182,Wrong Answer,"A,B,C=map(int, input().split()) +if A==B and B==C: + print('-1') + exit(0) + +cnt=0 +ctr=0 +while True: + A=A//2 + B=B//2 + C=C//2 + flgA=A%2==0 + flgB=B%2==0 + flgC=C%2==0 + Aa=B+C + Bb=A+C + Cc=A+B + A=Aa + B=Bb + C=Cc + + cnt+=1 + ctr+=1 + if [flgA, flgB, flgC].count(True) !=3: + break + if ctr >=100: + print('-1') + exit(0) + +print(cnt) +" +p03723,s965096898,Wrong Answer,"a,b,c=map(int,input().split()) +f=True +aa=0 +bb=0 +cc=0 +cnt=0 +while f: + aa = b/2+c/2 + bb = a/2+c/2 + cc = a/2+b/2 + cnt+=1 + if aa == a and bb == b and cc == c: + cnt = -1 + break + if aa%2!=0 or bb%2!=0 or cc%2!=0: + f=False + else: + a=aa + b=bb + c=cc + +print(cnt)" +p03723,s867792260,Wrong Answer,"import sys +a,b,c = map(int,input().split()) +if a == b == c: + print(-1) + sys.exit() +count = 0 +while a%2 == 0 and b%2 == 0 and c%2 == 0: + x = (b+c)//2 + y = (a+c)//2 + z = (a+b)//2 + a,b,c = x,y,z + count+=1 + #print(a,b,c) +print(count)" +p03723,s997632161,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + exit() + +count = 0 +for i in range(10**9): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + count += 1 + a = A + b = B + c = C + A = b // 2 + c // 2 + B = a // 2 + c // 2 + C = a // 2 + b // 2 + +print(count) +" +p03723,s970120532,Wrong Answer,"def main(): + A, B, C = map(int, input().split()) + + ans = 0 + if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0: + print(-1) + else: + while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(ans) + exit() + + A, B, C = (B + C)//2, (A + C)//2, (A + B)//2 + ans += 1 + +if __name__ == ""__main__"": + main()" +p03723,s954219189,Wrong Answer,"A,B,C = [int(i) for i in input().split()] + +if A==B==C: + print(-1) +else: + ans = 0 + while 1: + if A%2==1 or B%2==1 or C%2 ==1: + print(ans) + break + tempA = A//2 + tempB = B//2 + A = tempB + C//2 + B = tempA + C//2 + C = tempA + tempB + ans+=1 +" +p03723,s628403851,Wrong Answer,"def resolve(): + a, b, c = map(int, input().split()) + if a == b == c: + print(-1) + exit() + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(0) + exit() + ans = 0 + while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + ans += 1 + print(ans) +resolve()" +p03723,s860074572,Wrong Answer,"a,b,c = map(int,input().split()) +y = 2 +x = 0 +i = 0 +if a == b and b==c: + print(-1) +elif a % 2 != 0 or b % 2 !=0 or c % 2 != 0: + print(0) +else: + while y in range(2,10001,y): + d = (a/(2))/y + f =(c/(2))/y + e = (b/2)/y + if d % 1 == 0: + x += 1 + if e % 1 == 0: + x += 1 + if f % 1 == 0: + x += 1 + y = 2**i + print(x)" +p03723,s774110606,Wrong Answer,"A,B,C=map(int,input().split()) +if A==B and B==C: + print(-1) +elif A%2==1 or B%2==1 or C%2==1: + print(0) +else: + ans=0 + flag=0 + d=0 + while flag==0: + if (A>>d &1)==(B>>d &1) and (C>>d &1)==(B>>d &1): + d+=1 + else: + ans=d + break + print(ans)" +p03723,s209423986,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(bin(e&-e))-3or~b%-2)" +p03723,s075521287,Wrong Answer,"import sys +input = lambda : sys.stdin.readline().rstrip() +sys.setrecursionlimit(max(1000, 10**9)) +write = lambda x: sys.stdout.write(x+""\n"") + + +l = list(map(int, input().split())) +l.sort() +a,b,c = l +ans = 0 +while True: + if a==b==c: + ans = -1 + break + if a%2 or b%2 or c%2: + break + a,b,c = b//2+c//2, a//2+c//2, a//2+b//2 + ans += 1 +print(ans)" +p03723,s958755071,Wrong Answer,"a, b, c = map(int, input().split()) + +if (a == b == c): + print(-1) + quit() + +count = 0 +while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + _a = b / 2 + c /2 + _b = a / 2 + c /2 + _c = a / 2 + b /2 + a = _a + b = _b + c = _c + count += 1 +print(count)" +p03723,s868083202,Wrong Answer,"a,b,c=map(int,input().split()) +ans=0 +if a==b==c: + print (""-1"") +else: + while a%2==0 and b%2==0 and c%2==0: + ta=a + tb=b + tc=c + a=(tb/2)+(tc/2) + b=(ta/2)+(tc/2) + c=(ta/2)+(tb/2) + ans+=1 + print (ans)" +p03723,s895123709,Wrong Answer,"a, b, c = map(int, input().split()) +ans = 0 + +if a == b == c: + print(-1) +elif not (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + print(ans) +else : + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + aa, bb, cc = a, b, c + a = (bb + cc) / 2 + b = (aa + cc) / 2 + c = (aa + bb) / 2 + ans += 1 + print(ans) + +" +p03723,s605945327,Wrong Answer,"def solve(A, B, C): + if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + return 1 + elif (A == B == C): + return -1 + else: + return solve((B/2 + C/2), (A/2 + C/2), (A/2 + B/2)) + 1 + +A, B, C = map(int, input().split()) +ans = solve(A, B, C) +print(ans) + +" +p03723,s411002543,Wrong Answer,"a,b,c = map(lambda x:int(x),input().split()) +if a==b==c: + print(-1) +else: + reps = 0 + while a%2==0 and b%2==0 and c%2==0: + at=a + bt=b + ct=c + a = int(bt/2+ct/2) + b = int(at/2+ct/2) + c = int(at/2+bt/2) + reps += 1 + print(reps)" +p03723,s155581261,Wrong Answer,"a, b, c = map(int, input().split()) +i = 0 +while a%2==0 and b%2==0 and c%2==0 and i<10**8: + at = a//2 + bt = b//2 + ct = c//2 + a = bt + ct + b = at + ct + c = at + bt + i+=1 +if i > 10**8: + print(-1) +else: + print(i) +" +p03723,s800184358,Wrong Answer,"# A - Cookie Exchanges + +A, B, C = map(int, input().split()) + +def div2(x): + ans = 0 + while x>0 and x%2==0: + x /= 2 + ans += 1 + return ans + +if A==B and B==C: + print(-1) +else: + print(min(div2(abs(A-B)), div2(abs(A-C))))" +p03723,s024754522,Wrong Answer,"# 解答AC + +A,B,C = map(int, input().split()) + +is_even = lambda n: True if n % 2 == 0 else False + +if A == B == C: + if A % 2 == 0: + print(-1) + else: + print(0) +else: + cnt = 0 + while True: + cnt += 1 + A,B,C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + if is_even(A) and is_even(B) and is_even(C): + continue + break + print(cnt)" +p03723,s409155989,Wrong Answer,"import math +import sys + +a, b, c = map(int, input().split()) +if (a == b == c and a % 2 == 0): + print(-1) + sys.exit() + +cnt = 0 +while(True): + half_a, half_b, half_c = a / 2, b / 2, c / 2 + ea = half_a % 2 == 0 + eb = half_b % 2 == 0 + ec = half_c % 2 == 0 + if (ea and eb and ec or (not ea) and (not eb) and (not ec)): + cnt += 1 + a = half_b + half_c + b = half_a + half_c + c = half_a + half_b + else: + break + +print(cnt) +" +p03723,s880708470,Wrong Answer,"a, b, c=map(int, input().split()) +if a==b and b==c: + print(-1) +else: + cnt=0 + for i in range(1000): + if a%2==1 or b%2==1 or c%2==1: + print(cnt) + break + if i==1000: + print(-1) + cnt+=1 + ha=a/2 + hb=b/2 + hc=c/2 + a=hb+hc + b=ha+hc + c=ha+hb" +p03723,s604884915,Wrong Answer,"A,B,C = map(int,input().split()) + +if A == B == C: + print(-1) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ba = A + bb = B + bc = C + A = bb//2 + bc//2 + B = ba//2 + bc//2 + C = ba//2 + bb//2 + c+=1 + print(c) +" +p03723,s451821308,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) + exit() + +res = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + res += 1 + +print(res) +" +p03723,s782126916,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + D = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + D += 1 + AA = B/2 + C/2 + BB = A/2 + C/2 + CC = A/2 + B/2 + A = AA + B = BB + C = CC + print(D)" +p03723,s794850939,Wrong Answer,"a,b,c=map(int,input().split()) +flag=0 +if (a==b==c): + print(-1) +elif (a%2==1 or b%2==1 or c%2==1): + print(0) +else: + for i in range(1,10**9): + a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2) + #print(a,b,c) + if (a%2==1 or b%2==1 or c%2==1): + print(i) + flag=1 + break +if (flag==0): + print(-1)" +p03723,s883580720,Wrong Answer,"# -*- coding:utf-8 -*- +A,B,C = map(int,input().split()) + +cnt = 0 + +if A==B==C: + cnt = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = (B+C)//2,(C+A)//2,(A+B)//2 + cnt += 1 + +print(cnt) +" +p03723,s216575317,Wrong Answer,"A, B, C = map(int, input().split()) +ans = 0 +cont = True +while cont: + if A == B == C: + ans = -1 + break + elif A%2==0 and B%2==0 and C%2==0: + b_A = A + b_B = B + b_C = C + A = b_B//2 + b_C//2 + B = b_A//2 + b_C//2 + C = b_A//2 + b_B//2 + ans += 1 + else: + break +print(ans)" +p03723,s803999767,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +result = 0 + +while True: + if any([a & 1, b & 1, c & 1]): + break + + a2 = a // 2 + b2 = b // 2 + c2 = c // 2 + a = b2 + c2 + b = a2 + c2 + c = a2 + b2 + result += 1 + +print(result)" +p03723,s188191858,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + quit() +ans = 0 +a_n = 0 +b_n = 0 +c_n = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a_n = (b+c)//2 + b_n = (a+c)//2 + c_n = (a+c)//2 + a = a_n + b = b_n + c = c_n + ans += 1 +print(ans) +" +p03723,s931510076,Wrong Answer,"a, b, c = map(int, input().split()) + +a0, b0, c0 = a, b, c +a1, b1, c1 = 0, 0, 0 + +cnt = 0 +while True: + a1 = b0/2 + c0/2 + b1 = a0/2 + c0/2 + c1 = a0/2 + c0/2 + + a0 = a1 + b0 = b1 + c0 = c1 + + cnt += 1 + + if a1%2==1 or b1%2==1 or c1%2==1: + print(cnt) + exit() + + if a1 == a and b1 == b and c1 == c: + print(-1) + exit() + +" +p03723,s080850636,Wrong Answer,"i = 0 + +def cookie(a, b, c): + global i + if a == b and b == c: + return -1 + elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + i += 1 + cookie((b+c)//2, (a+c)//2, (a+b)//2) + return i + +A, B, C = map(int, input().split()) +print(cookie(A, B, C))" +p03723,s939597443,Wrong Answer,"A,B,C=map(int, raw_input().split()) +cnt=0 + +for _ in range(100): + cnt+=1 + new_A=B/2+C/2 + new_B=A/2+C/2 + new_C=A/2+B/2 + A,B,C=new_A,new_B,new_C + if new_A%2==1 or new_B%2==1 or new_C%2==1: + print cnt + quit() +else: + print -1" +p03723,s835929880,Wrong Answer,"a,b,c=map(int,input().split()) +flag=0 +if (a==b==c): + print(-1) + flag=1 +elif (a%2==1 or b%2==1 or c%2==1): + print(0) + flag=1 +else: + for i in range(1,10**9): + a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2) + #print(a,b,c) + if (a%2==1 or b%2==1 or c%2==1): + print(i) + flag=1 + break +if (flag==0): + print(-1)" +p03723,s345056140,Wrong Answer,"a,b,c = map(int,input().split()) + +if (a == b ) and (b == c): + print(-1) +elif (a%2!=0) or (b%2!=0) or (c%2!=0): + print(-1) +else: + def exchange(a,b,c): + return (b+c)/2,(c+a)/2,(a+b)/2 + num = 0 + ans = 0 + while num == 0: + a,b,c = exchange(a,b,c) + ans += 1 + for j in range(3): + if [a,b,c][j] % 2 ==1: + num = 1 + print(ans)" +p03723,s164802787,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + print(-1) +for i in range(1, 10**5): + a, b, c = (b+c) / 2, (c+a)/2, (a+b)/2 + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(i) + exit()" +p03723,s234403069,Wrong Answer,"# A - Cookie Exchanges +a,b,c = map(int,input().split()) +INF = 10000 + +def div2(x): + ans = 0 + if x==0: + return INF + while x%2==0: + ans += 1 + x //= 2 + return ans + +ans = min(div2(abs(b-a)), div2(abs(c-b))) +print(ans if ans 0: + print(count) + exit() + else: + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + count += 1" +p03723,s847203475,Wrong Answer,"# A - Cookie Exchanges +a,b,c = map(int,input().split()) +INF = 10000 + +def div2(x): + ans = 0 + if x==0: + return INF + while x%2==0: + ans += 1 + x //= 2 + return ans + +ans = min(div2(abs(b-a)), div2(abs(c-b)), div2(abs(a-c))) +print(ans if ans 10**5: + print(-1) + exit() + print(ans)" +p03723,s562891547,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b and b==c: + ans=-1 +for i in range(1,100000): + x=a//2 + y=b//2 + z=c//2 + a=y+z + b=x+z + c=x+y + if a%2==1 or b%2==1 or c%2==1: + ans=i + break +print(ans)" +p03723,s211334028,Wrong Answer,"a, b, c = map(int, input().split()) + + +if a % 2 == 0 or b % 2 == 0 or c % 2 == 0: + print(0) + exit(0) +if a == b == c and a % 2 == 0: + print(-1) + exit(0) + +counter = 0 +while True: + counter += 1 + w_a = a / 2 + w_b = b / 2 + w_c = c / 2 + + a = w_b + w_c + b = w_a + w_c + c = w_b + w_a + + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(counter) + exit(0) +" +p03723,s609209218,Wrong Answer,"cookie = list(map(int, input().split())) +sc = sum(cookie) +cnt = -1 +if cookie[0] == cookie[1] and cookie[1] == cookie[2] and cookie[0]%2 == 0: + print(-1) + exit() +memo = [0]*3 +while cookie[0]%2 == 0 and cookie[1]%2 == 0 and cookie[2]%2 == 0: + memo[0] = (cookie[1] + cookie[2]) // 2 + memo[1] = (cookie[0] + cookie[2]) // 2 + memo[2] = (cookie[1] + cookie[0]) // 2 + for i in range(3): + cookie[i] = memo[i] + cnt += 1 + +print(cnt)" +p03723,s023515052,Wrong Answer,"import sys +import numpy as np +a, b, c = [int(i) for i in sys.stdin.readline().split()] +if a == b == c: + print(-1) +else: + ls = np.array([a, b, c]) + arr = np.array([[0, 0.5, 0.5], + [0.5, 0, 0.5], + [0.5, 0.5, 0]]) + cnt = 0 + while sum(ls % 2) == 0: + ls = ls.dot(arr) + cnt += 1 + print(cnt)" +p03723,s114360329,Wrong Answer,"A,B,C = list(map(int,input().split())) +count = 0 +if A == B == C: + print(-1) + exit() +while True: + if A%2 == 1 or B%2 == 1 or C%2 == 1: + break + A_half = A//2 + B_half = B//2 + C_half = C//2 + A = B_half+C_half + B = A_half+C_half + C = A_half+B_half + count += 1 +print(count)" +p03723,s222488875,Wrong Answer,"a,b,c = map(int,input().split()) +cnt=0 +for i in range(100): + if a==b==c: + cnt = -1 + break + elif a%2==0 and b%2==0 and c%2==0: + t_a = b//2 + c//2 + t_b = a//2 + c//2 + t_c = a//2 + b//2 + a,b,c = t_a,t_b,t_c + cnt+=1 + else: + break +print(cnt)" +p03723,s062648440,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) +elif a%2==1 or b%2==1 or c%2==1: + print(0) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + ans+=1 + a1=(b+c)//2 + b1=(c+a)//2 + c1=(a+b)//2 + a=a1 + b=b1 + c=c1 + print(ans)" +p03723,s053168023,Wrong Answer,"a,b,c=map(int,input().split()) + +if a==b==c and a%2==0: + print(-1) +else: + num=0 + while True: + if a%2==1 or b%2==1 or c%2==1: + break + num+=1 + l0=(b+c)/2 + l1=(c+a)/2 + l2=(a+b)/2 + a,b,c=l0,l1,l2 + else: + print(num)" +p03723,s380678959,Wrong Answer,"a, b, c = map(int, input().split()) +count = 0 +for i in range(10**3): + a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2 + count += 1 + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(count) + exit() +print(-1)" +p03723,s662516298,Wrong Answer,"a, b, c = map(int, input().split()) + +if(a == b and b == c): + print(-1) +else : + cnt = 0 + while True: + if(a % 2 != 0 or b % 2 != 0 or c % 2 != 0): + break + A = b//2 + c//2 + B = c//2 + a//2 + C = a//2 + b//2 + a = A + b = B + c = C + cnt += 1 + print(cnt) +" +p03723,s550835456,Wrong Answer,"a,b,c = map(int,input().split()) +acnt = 0 +bcnt = 0 +ccnt = 0 +cnt = 0 + +if a == b == c: + print(-1) + exit() + +while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1: + acnt = (b+c)//2 + bcnt = (a+c)//2 + ccnt = (a+b)//2 + a = acnt + b = bcnt + c = ccnt + cnt += 1 + +print(cnt)" +p03723,s659338295,Wrong Answer,"# A - Cookie Exchanges +a,b,c = map(int,input().split()) + +if a==b==c: + print(-1) +else: + ans = 0 + while a%2==b%2==c%2==0: + ans += 1 + a,b,c = (b+c)//2,(c+a)//2,(a+b)//2 + print(ans)" +p03723,s509216647,Wrong Answer,"cookie = list(map(int, input().split())) +sc = sum(cookie) +cnt = -1 +if cookie[0] == cookie[1] and cookie[1] == cookie[2]: + print(cnt) + exit() +memo = [0]*3 +while sum(cookie) == sc: + memo[0] = (cookie[1] + cookie[2]) // 2 + memo[1] = (cookie[0] + cookie[2]) // 2 + memo[2] = (cookie[1] + cookie[0]) // 2 + for i in range(3): + cookie[i] = memo[i] + cnt += 1 + +print(cnt)" +p03723,s414207906,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if (a == b and b == c) or (a % 4 == 0 and b % 4 == 0 and c % 4 == 0): + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s272253689,Wrong Answer,"a,b,c = map(int, input().split()) +count = 0 +if not a==b==c: + while a%2==0 and b%2==0 and c%2==0: + temp_a = a + temp_b = b + temp_c = c + a += temp_b/2 + temp_c/2 + b += temp_a/2 + temp_c/2 + c += temp_a/2 + temp_b/2 + count+=1 + print(count) +else: + print(""-1"")" +p03723,s470705961,Wrong Answer,"a = list(map(int,input().split())) +cna = cnb = 0 +a.sort() +x = a[2]-a[1] +y = a[1]-a[0] +while True: + if x%2 == 0 and x != 0: + cna += 1 + x //= 2 + else: + break +while True: + if y%2 == 0 and y != 0: + cnb += 1 + y //= 2 + else: + break +if cna == 0 or cnb == 0: + print(-1) +else: + print(min(cna,cnb))" +p03723,s813821918,Wrong Answer,"import sys +a,b,c = map(int,input().split("" "")) +li = [[a,b,c]] +if (a % 2)==1 or (b % 2)==1 or (c % 2)==1: + print(0) +count=0 + +for i in range(100): + a2 = a/2 + b2 = b/2 + c2 = c/2 + a = b2+c2 + b = c2+a2 + c = a2+b2 + count += 1 + if (a % 2)==1 or (b % 2)==1 or (c % 2)==1: + break + elif [a,b,c] in li: + print(-1) + sys.exit() + else: + li.append([a,b,c]) + +print(count)" +p03723,s271154270,Wrong Answer,"li = list(map(int,input().split())) +nx = [0,0,0] +ans = 0 +if any(x&1 for x in li) and li[0] == li[1] == li[2]: + print(-1) +else: + while 1: + if(li[0]%2!=0 or li[1]%2!=0 or li[2]%2!=0): + break + nx[0] = (li[1] + li[2])/2 + nx[1] = (li[0] + li[2])/2 + nx[2] = (li[0] + li[1])/2 + li = nx.copy() + ans += 1 + print(ans) + + + + + +" +p03723,s604304106,Wrong Answer,"A, B, C = map(int, input().strip().split()) +ans = 0 +while A != B and B != C and (A % 2) + (B % 2) + (C % 2) == 0: + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + ans += 1 + if A == B == C: + ans = -1 + break +print(ans)" +p03723,s982241608,Wrong Answer,"a,b,c = tuple(map(int,input().split())) +if len(set((a,b,c)))==1 and a//2==1: + print(0) + exit() +ans = 0 +while True: + if len(set((a,b,c)))==1: + print(-1) + exit() + if a%2==0 and b%2==0 and c%2==0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + else: + break +print(ans) +" +p03723,s524468091,Wrong Answer,"#13 +a,b,c = map(int,input().split()) +cnt = 0 +if a%2 == 1 or b%2 == 1 or c%2 == 1: + print('0') + +else: + while a%2 == b%2 == c%2 == 0: + if a==b==c: + print('-1') + break + else: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + cnt+=1 + print(cnt)" +p03723,s163991916,Wrong Answer,"a,b,c=map(int,input().split()) +for i in range(500000): + if a%2==1 or b%2==1 or c%2==1: + print(i);exit() +else: + print(-1)" +p03723,s447704989,Wrong Answer,"a,b,c=map(int,input().split()) + +ans=0 +if a==b==c: + print(-1) + exit() +while a%2==0 and b%2==0 and c%2==0: + num_a,num_b,num_c=a/2,b/2,c/2 + a=num_b+num_c + b=num_a+num_c + c=num_a+num_b + ans+=1 +print(ans)" +p03723,s718533097,Wrong Answer,"a, b, c=map(int,input().split()) +A,B,C = a,b,c +ans = 0 +while(a%2==0 and b%2==0 and c%2==0): + if(A==B==C): + ans = 0 + break + A,B,C = a,b,c + a = B//2 + C//2 + b = A//2 + C//2 + c = A//2 + B//2 + ans += 1 +print(ans) if(ans) else print(-1) + " +p03723,s213239298,Wrong Answer,"A,B,C=map(int,input().split()) +if A==B and B==C: + print(-1) + exit() +else: + count=0 + while(1): + if A%2==1 or B%2==1 or C%2==1: + print(count) + exit() + else: + a=A//2 + b=B//2 + c=C//2 + A=b+c + B=a+c + C=a+b + count+=1" +p03723,s236404626,Wrong Answer,"a,b,c= map(int,input().split()) +cnt = 0 +if a == b and b == c: + print(-1) + exit() +while a%2 == 0 and b%2 == 0 and c%2 == 0: + cnt +=1 + x =(b+c)//2 + y =(c+a)//2 + z =(b+a)//2 + a = x + b = y + c = z +print(cnt)" +p03723,s733025808,Wrong Answer,"import re +A,B,C = map(int,input().split()) +#N = str(input()) +#K = int(input()) +#A = list(map(int,input().split())) +if A==B==C: + print(-1) + exit() +flag=True +co=0 +if A%2!=0 or B%2!=0 or C%2!=0: + flag=False +while flag==True: + co+=1 + + a=B/2 + C/2 + b=A/2 + C/2 + c=B/2 + A/2 + if a%2!=0 or b%2!=0 or c%2!=0: + flag=False + A=a + B=b + C=c + +print(co) +" +p03723,s522362916,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B and B == C: + print(-1) +else: + step = 0 + while True: + step += 1 + nA = B // 2 + C // 2 + nB = A // 2 + C // 2 + nC = A // 2 + B // 2 + A, B, C = nA, nB, nC + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(step) + break" +p03723,s915216412,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) + exit() +ans=0 +while a%2==b%2==c%2==0: + x=(a+b)//2 + y=(b+c)//2 + z=(c+a)//2 + a=y + b=z + c=a + ans+=1 +print(ans)" +p03723,s294996887,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C and A%2 == 0 or B%2 == 0 or C%2 == 0: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + if A == B == C: + ans = -1 + break + A,B,C = B//2+C//2,A//2+C//2,A//2+B//2 + ans += 1 +print(ans)" +p03723,s098718819,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + cnt = 0 + while A%2==0 and B%2==0 and C%2==0: + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + cnt += 1 + print(cnt) +" +p03723,s792898611,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + + +if A == B == C: + if A % 2 == 1: + print(0) + else: + print(-1) + sys.exit() + +cnt = 0 +while A % 2 == 0 or B % 2 == 0 or C % 2 == 0: + a = B // 2 + C // 2 + b = A // 2 + C // 2 + c = A // 2 + B // 2 + A = a + B = b + C = c + cnt += 1 +print(cnt) +" +p03723,s548116147,Wrong Answer,"A, B, C = map(int,input().split()) + +if A == B == C: + print(-1) + exit() + +LA = [] +LB = [] +LC = [] +LA.append(A) +LB.append(B) +LC.append(C) +i = 0 +cnt = 0 + +while LA[i] % 2 == 0 and LB[i] % 2 == 0 and LC[i] % 2 == 0: + LA.append((LB[i]+LC[i])/2) + LB.append((LC[i]+LA[i])/2) + LC.append((LA[i]+LB[i])/2) + i += 1 + cnt += 1 + +print(cnt) +" +p03723,s248420343,Wrong Answer,"A, B, C = map(int, input().split()) + + +def cnt(N): + cnt = 0 + while N % 2 == 0: + cnt += 1 + N //= 2 + + return cnt + + +if A == B == C and A % 2 == 0: + print(-1) +elif len(set([cnt(A), cnt(B), cnt(C)])) == 1: + print(min(cnt(A), cnt(B), cnt(C)) + 1) +else: + print(min(cnt(A), cnt(B), cnt(C))) + +" +p03723,s935997174,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if (A == B and B == C) or (count > 10**9): + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s302751505,Wrong Answer,"A,B,C = map(int,input().split()) +s = [A,B,C] + +def main(a,b,c): + if a == b and b == c: + return -1 + + cnt = 0 + while (a % 2 == 0) and (b % 2 == 0) and (c % 2 == 0): + a1,b1,c1 = a,b,c + a = (b1+c1)/2 + b = (a1+c1)/2 + c = (a1+b1)/2 + cnt += 1 + #print(a,b,c) + if [a,b,c] == s: + return -1 + + return cnt + + +ans = main(A,B,C) +print(ans)" +p03723,s695524171,Wrong Answer,"A, B, C = map(int, input().split()) +cnt = 0 +while(1): + A_tmp = A + B_tmp = B + C_tmp = C + A = (B_tmp+C_tmp)/2 + B = (A_tmp+C_tmp)/2 + C = (A_tmp+C_tmp)/2 + cnt += 1 + if A%2!=0 or B%2!=0 or C%2!=0: + break + if A_tmp==A and B_tmp==B and C_tmp==C: + cnt = -1 + break +print(cnt)" +p03723,s032991925,Wrong Answer,"A, B, C = map(int, input().split()) +cnt = 0 +while True: + if A == B and A == C: + print(-1) + break + elif A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(cnt) + break + else: + A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 + cnt += 1" +p03723,s678047499,Wrong Answer,"a,b,c = map(int,input().split()) +if a==b==c: + print(-1) +else: + res = 0 + while True: + if a%2!=0 or b%2!=0 or c%2!=0: + break + else: + res += 1 + nx_a = b//2 + c//2 + nx_b = a//2 + c//2 + nx_c = a//2 + b//2 + a,b,c = nx_a, nx_b, nx_c + print(res)" +p03723,s358954206,Wrong Answer,"a,b,c = map(int,input().split()) +ans = 0 +if a == b and b == c: + ans = -1 +else: + while a%2 != 1 and b%2 != 1 and c%2 != 1: + aa = b/2 + c/2 + bb = c/2 + a/2 + cc = a/2 + b/2 + a = int(aa) + b = int(bb) + c = int(cc) + ans += 1 +print(ans) " +p03723,s344222935,Wrong Answer,"""""""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""""" + +A, B, C = map(int, input().split()) + +i = 0 +while True: + a,b,c=A,B,C + A = (b+c)/2 + B = (c+a)/2 + C = (a+b)/2 + i += 1 + if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(i) + break + elif(A==B or B==C or C==A): + print(-1) + break + +" +p03723,s333572161,Wrong Answer,"def check(A,B,C): + if A==0 or B==0 or C==0: + return False + if A%2!=0 or B%2!=0 or C%2!=0: + return False + return True + +A,B,C=map(int,input().split()) +ans=0 +if A==B==C: + print(-1) + exit() +while check(A,B,C)==True: + a=B//2+C//2 + b=A//2+C//2 + c=A//2+B//2 + A,B,C=a,b,c + ans+=1 + if 10**9 10000000 : + print(""-1"") + break + else : + continue +" +p03723,s823504541,Wrong Answer,"a,b,c=map(int,input().split()) +ans=0 +if a==b==c: + print (""-1"") +else: + while a%2==0 and b%2==0 and c%2==0: + ta,tb,tc=a,b,c + a=(tb//2)+(tc//2) + b=(ta//2)+(tc//2) + c=(ta//2)+(tb//2) + ans+=1 + print (ans) + " +p03723,s340194483,Wrong Answer,"a,b,c = list(map(int, input().split())) + +if a==b==c: + print(-1) + exit() + +ans=0 +while all(i&1==0 for i in [a,b,c]): + a,b,c = (b+c)//2, (a+c)//2, (a+b)//2 + ans+=1 + +print(ans)" +p03723,s713097399,Wrong Answer,"a,b,c=map(int,input().split()) +ab,bc,ca=abs(a-b),abs(b-c),abs(c-a) +ans=0 +if a==b==c or a%2!=0 or b%2!=0 or c%2!=0: + print(-1) +else: + while ab%2==0 and bc%2==0 and ca%2==0: + ab//=2 + bc//=2 + ca//=2 + ans+=1 + print(ans) +" +p03723,s631144106,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b and b==c: + print(-1) +else: + k=0 + while a%2==0 and b%2==0 and c%2==0: + A=a + B=b + C=c + a=B//2+C//2 + b=A//2+C//2 + c=A//2+B//2 + k+=1 + print(k)" +p03723,s978155626,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() + +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + if (a == b and b == c) or count > 31: + print('-1') + sys.exit() + A = a + B = b + C = c + +print(count)" +p03723,s037458977,Wrong Answer,"a,b,c = map(int,input().split()) +r = 0 +if a == b == c: + print(-1) + exit() + +while True: + if a%2 == 1 or b%2 == 1 or c%2 ==1: + break + r += 1 + aa = (b+c)//2 + bb = (a+c)//2 + cc = (a+b)//2 + a,b,c = aa,bb,cc + +print(r)" +p03723,s720830400,Wrong Answer,"#13 +a,b,c = map(int,input().split()) +cnt = 0 +while a%2 == b%2 == c%2 == 0: + if a==b==c: + print('-1') + break + else: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + cnt+=1 + +print(cnt)" +p03723,s547394747,Wrong Answer,"a,b,c=map(int,input().split()) +ans=-1 +for i in range(1,10000): + x=a//2 + y=b//2 + z=c//2 + a=y+z + b=x+z + c=x+y + print(""{}-{}-{}"".format(a,b,c)) + if a%2==1 or b%2==1 or c%2==1: + ans=i + break +print(ans)" +p03723,s342847637,Wrong Answer,"A,B,C = list(map(int,input().split())) +if A==B==C: + print(-1) +else: + count = 0 + while not A%2 and not B%2 and not C%2: + A,B,C = (B+C)/2,(A+C)/2,(A+B)/2 + count += 1 + print(count)" +p03723,s083106481,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +cnt = 0 +while a % 2 == 0 and \ + b % 2 == 0 and \ + c % 2 == 0: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + +print(cnt) +" +p03723,s247062121,Wrong Answer,"a,b,c = map(int,input().split()) +ans = 0 +p = 0 + +for i in range(c): + if int(a/2)*2==a and int(b/2)*2==b and int(c/2)*2==c: + ans += 1 + x = b / 2 + c / 2 + y = a / 2 + c / 2 + z = b / 2 + a / 2 + a = x + b = y + c = z + if a == b and b == c: + break + else: + p = 1 + print(ans) + break +" +p03723,s562189540,Wrong Answer,"from fractions import gcd + +if __name__ == ""__main__"": + a, b, c = map(int, input().split()) + + if a == b == c: + print(-1) + exit() + + ab = abs(a-b) + bc = abs(b-c) + + g = gcd(ab, bc) + + ans = 0 + while g % 2 == 0: + ans += 1 + g //= 2 + + print(ans) +" +p03723,s324936968,Wrong Answer,"a,b,c = map(int,input().split()) +r = 0 + +while True: + if a == b == c: + print(-1) + exit() + + if a%2 == 1 or b%2 == 1 or c%2 ==1: + break + r += 1 + aa = (b+c)//2 + bb = (a+c)//2 + cc = (a+b)//2 + a,b,c = aa,bb,cc + +print(r)" +p03723,s620960591,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-c|c-b +print((e!=c%2)*(e&-e).bit_length()-1)" +p03723,s792442593,Wrong Answer,"a,b,c = map(int,input().split()) +if a == b and b == c and c == a: + print(-1) +else: + cnt = 0 + while(True): + cnt += 1 + ta = b//2 + c //2 + tb = a//2 + c //2 + tc = a//2 + b //2 + if ta %2 == 1 or tb %2 == 1 or tc %2 == 1: + break + a,b,c = ta,tb,tc + print(cnt) +" +p03723,s289329494,Wrong Answer,"A,B,C = map(int, input().split()) +ans = 0 +while 1: + if {A,B,C} == {(B+C)//2,(C+A)//2,(A+B)//2}: + print(-1) + break + if (A%2,B%2,C%2) == (0,0,0): + ans += 1 + A,B,C = (B+C)//2,(C+A)//2,(A+B)//2 + else: + print(ans) + break" +p03723,s464182010,Wrong Answer,"A,B,C = map(int,input().split(' ')) +num = 0 +if A == B == C: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A_c = A + B_c = B + C_c = C + A = B_c /2 + C_c / 2 + B = A_c / 2 + C_c /2 + C = A_c /2 + B_c / 2 + num += 1 + print(num)" +p03723,s959020158,Wrong Answer,"A,B,C = map(int,input().split()) +cou = 0 +if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(""0"") +while(cou < 10*7): + cou += 1 + a = A + b = B + c = C + A = b/2 + c/2 + B = a/2 + c/2 + C = a/2 + b/2 + if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(str(cou)) + exit() + else: + pass +print(""-1"")" +p03723,s191484795,Wrong Answer,"A, B, C = map(int, input().split()) +S = A+B+C + +k = 0 +while True: + if A==B==C: + k = -1 + break + k += 1 + An = (B + C)//2 + Bn = (A + C)//2 + Cn = (B + A)//2 + A = An + B = Bn + C = Cn + print(A,B,C) + if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1: + break + +print(k)" +p03723,s114592727,Wrong Answer,"# おっぱっぴー + +A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +for i in range(10000): + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(i) + break + A, B, C = B/2+C/2, A/2+C/2, A/2+B/2 + +" +p03723,s238813115,Wrong Answer,"A,B,C = map(int, input().split()) +A_first,B_first,C_first = A,B,C + + +result = 0 +for i in range(10**9): + if A % 2 == 1 or B % 2 == 1 or C // 2 == 1: + break + a = A // 2 + b = B // 2 + c = C // 2 + A = b + c + B = a + c + C = a + b + if A == A_first and B == B_first and C == C_first: + result = -1 + break + result += 1 +print(result) " +p03723,s202814693,Wrong Answer,"A,B,C=map(int, input().split()) +if A==B and B==C: + print(-1) + exit(0) +cnt=0 +while True: + A=A//2 + B=B//2 + C=C//2 + flgA=A%2==0 + flgB=B%2==0 + flgC=C%2==0 + A=B+C + B=A+C + C=A+B + if [flgA, flgB, flgC].count(True) ==2 or [flgA, flgB, flgC].count(False) ==3: + break + else: + cnt+=1 +print(cnt) +" +p03723,s918815513,Wrong Answer,"A,B,C = list(map(int,input().split())) +if A==B==C: + print(-1) +else: + count = 0 + while not A%2 and not B%2 and not C%2: + A,B,C = (B+C)/2,(A+C)/2,(A+B)/2 + if A==int(A) and B==int(B) and C == int(C): + A = int(A) + B = int(B) + C = int(C) + count += 1 + print(count)" +p03723,s325734062,Wrong Answer,"import sys +def rs(): return sys.stdin.readline().rstrip() +def ri(): return int(rs()) +def rs_(): return [_ for _ in rs().split()] +def ri_(): return [int(_) for _ in rs().split()] + +import numpy as np +a = np.array(ri_()) +ans = 0 +while True: + if a[0] == a[1] and a[1] == a[2]: + ans = -1 + break + ans += 1 + a = (sum(a) - a) // 2 + if np.any(a % 2 == 1): + break +print(ans)" +p03723,s656150523,Wrong Answer,"a,b,c = map(int,input().split()) +aa=0 +bb=0 +cc=0 +cnt = 0 +e = True +if a%2!=0 or b%2!=0 or c%2!=0: + print(0) +else: + while e: + if a%2!=0 or b%2!=0 or c%2!=0: + e=False + elif a==b==c: + cnt=-1 + e=False + else: + aa=(b+c)/2 + bb=(a+c)/2 + cc=(a+b)/2 + cnt+=1 + a=aa + b=bb + c=cc +print(cnt)" +p03723,s489058165,Wrong Answer,"a,b,c = map(lambda x:int(x),input().split()) +if a==b==c: + print(-1) +elif a%2==1 or b%2==1 or c%2==1: + print(0) +else: + at=bt=ct = -1 + while a%2==0: + a/=2 + at+=1 + while b%2==0: + b/=2 + bt+=1 + while c%2==0: + c/=2 + ct+=1 + print(at+bt+ct)" +p03723,s558786512,Wrong Answer,"a, b, c = map(int, input().split()) +if a == 1 and b == 1 and c == 1: + print(0) +if a == b and b == c: + print(-1) + exit() +cnt = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = b//2+c//2, c//2+a//2, a//2+b//2 + cnt += 1 +print(cnt) +" +p03723,s870361012,Wrong Answer,"# おっぱっぴー + +A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +for i in range(1000): + A, B, C = B/2+C/2, A/2+C/2, A/2+B/2 + + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(i+1) + break" +p03723,s446366568,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() + +count = 0 +while True: + a = (A+B)/2 + b = (C+A)/2 + c = (A+B)/2 + count += 1 + if a == b and b == c: + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s763634922,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0: + print(-1) + exit() +cnt=0 +while True: + a,b,c = (b+c)//2,(a+c)//2,(a+b)//2 + cnt+=1 + if a%2 != 0 or b%2 != 0 or c%2 !=0: + break +print(cnt)" +p03723,s811128357,Wrong Answer,"import sys +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +read = sys.stdin.buffer.read +sys.setrecursionlimit(10 ** 7) + +A, B, C = map(int, readline().split()) + +if A == B and B == C: + print(-1) + exit() + +ans = 0 +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + half_A = A // 2 + half_B = B // 2 + half_C = C // 2 + + A += half_B + half_C + B += half_A + half_C + C += half_A + half_B + ans += 1 + +print(ans)" +p03723,s082682958,Wrong Answer,"a, b, c = map(int, input().split()) +za = a +zb = b +zc = c + +d = 0 + +if a == b == c: + print(-1) + exit() + +while True: + a = int(zb / 2) + int(zc / 2) + b = int(za / 2) + int(zc / 2) + c = int(za / 2) + int(zb / 2) + + za = a + zb = b + zc = c + + d += 1 + print(a,b,c) + + if a % 2 != 0 or b % 2 != 0 or b % 2 != 0: + print(d) + exit() +" +p03723,s747275106,Wrong Answer,"a,b,c=map(int,input().split()) +count=0 +if a==b==c: + print(-1) +else: + while True: + a1=a//2 + b1=b//2 + c1=c//2 + if (a%2==0 and b%2==0 and c%2==0): + count+=1 + a=b1+c1 + b=a1+c1 + c=a1+b1 + else: + print(count) + break" +p03723,s176920118,Wrong Answer,"a,b,c = map(int, input().split()) +for i in range(10**6): + temp1 = a + temp2 = b + temp3 = c + a = int((temp2+temp3)/2) + b = int((temp1+temp3)/2) + c = int((temp1+temp2)/2) + if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + break +if i == 10**6 - 1: + print(-1) +else: + print(i+1)" +p03723,s947665453,Wrong Answer,"A,B,C = map(int,input().split()) + +if A == B == C: + print(-1) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ba = A + bb = B + bc = C + A = (bb + bc)//2 + B = (ba + bc)//2 + C = (ba + bb)//2 + c+=1 + print(c) +" +p03723,s888545654,Wrong Answer,"*a, = map(int,input().split()) +a = [bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)] +print(max(a) if a[0]*a[1]<0 else min(a))" +p03723,s629824510,Wrong Answer,"a,b,c = tuple(map(int,input().split())) + +ans = 0 +while True: + if len(set((a,b,c)))<3: + print(-1) + break + if a%2==0 and b%2==0 and c%2==0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + else: + break +print(ans)" +p03723,s986000852,Wrong Answer,"a, b, c = map(int,input().split()) + +if a==b==c: + print(-1) + exit() + +times=0 +while a%2==0 and b%2==0 and c%2==0: + times+=1 + a_=a//2 + b_=b//2 + c_=c//2 + a=b_+c_ + b=a_+c_ + c=a_+b_ + +print(times)" +p03723,s948064544,Wrong Answer,"A,B,C = map(int,input().split()) + +Flag = True +count = 0 +while Flag: + if A == B == C: + Flag = False + count = -1 + continue + if A % 2 ==1 or B % 2==1 or C % 2 ==1: + Flag = False + continue + A_ = B // 2 + C //2 + B_ = A // 2 + C //2 + C_ = A // 2 + B //2 + A,B,C = A_,B_,C_ + count += 1 +print(count)" +p03723,s210105470,Wrong Answer,"a, b, c = map(int, input().split()) + +for i in range(3): + w_a = a / 2 + w_b = b / 2 + w_c = c / 2 + + a = w_b + w_c + b = w_a + w_c + c = w_b + w_a + + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(i + 1) + exit(0) +else: + print(-1) +" +p03723,s671616216,Wrong Answer,"a, b, c=map(int,input().split()) +A,B,C = a,b,c +ans = 0 +while(a%2==0 and b%2==0 and c%2==0): + if(A==B==C):break + A,B,C = a,b,c + a = B//2 + C//2 + b = A//2 + C//2 + c = A//2 + B//2 + ans += 1 +print(ans) if(ans) else print(-1) + " +p03723,s462678126,Wrong Answer,"A,B,C= map(int,input().split()) + +if A==B==C: + print('-1') +else: + cnt = 0 + + flag = True + while flag: + A, B, C = (B+C)/2, (A+C)/2, (A+B)/2 + cnt += 1 + if A%2==0 and B%2==0 and C%2==0: + continue + else: + flag = False + + print(cnt)" +p03723,s758713408,Wrong Answer,"nums = map(int, input().split()) +nums = sorted(nums) +A, B, C = nums + +if A == B and B == C: + print(-1) + exit() + +count = 0 +while True: + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(count) + exit() + + newA = (A + B) // 2 + newB = (B + C) // 2 + newC = (C + A) // 2 + A = newA + B = newB + C = newC + count += 1" +p03723,s938817240,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c and a%2==0: + print(-1) + exit() +cnt=0 +while True: + x=b/2+c/2 + y=a/2+c/2 + z=a/2+b/2 + a,b,c = x,y,z + cnt+=1 + if a%2 != 0 or b%2 != 0 or c%2 !=0: + break +print(cnt)" +p03723,s118299371,Wrong Answer,print(0) +p03723,s988543721,Wrong Answer,"A,B,C = map(int, input().split()) + +def even(a): + if a % 2 == 0: + return True + else: + return False + +if A == B and B == C: + print(""-1"") +else: + cnt = 0 + while even(A) and even(B) and even(C): + tmp1, tmp2, tmp3 = A,B,C + A = (tmp2+tmp3) // 2 + B = (tmp3+tmp1) // 2 + C = (tmp1+tmp2) // 2 + cnt += 1 + print(cnt) +" +p03723,s083661582,Wrong Answer,"# agc014_a.py] +A, B, C = map(int,input().split()) +cnt = 0 +inf = 15 +for i in range(inf): + if A%2==0 and B%2==0 and C%2==0: + a = (B+C)//2 + b = (A+C)//2 + c = (B+A)//2 + A = a + B = b + C = c + cnt += 1 + else: + break +if cnt == inf: + cnt = -1 +print(cnt)" +p03723,s206318934,Wrong Answer,"a,b,c = map(int,input().split()) + +if a==b==c: + print(-1) +else: + ans = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + a,b,c = (b/2+c/2), (a/2+c/2), (a/2+b/2) + ans += 1 + print(ans)" +p03723,s647644558,Wrong Answer,"import sys +import numpy as np +sys.setrecursionlimit(10 ** 7) + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) + +cookies = np.array(lr()) +if len(set(cookies)) == 1: + print(-1) + exit() +if any(cookies&1): + print(0) + exit() +count = 0 +half_total = cookies.sum() // 2 +while True: + cookies = half_total - cookies//2 + count += 1 + if any(cookies&1): + print(count) + break + if count == 10000: + print(-1) + exit() +" +p03723,s092112577,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C or A%2 != 0 or B%2 != 0 or C%2 != 0: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = B/2+C/2,A/2+C/2,A/2+B/2 + ans += 1 +print(ans)" +p03723,s411160599,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() + +count = 0 +while True: + a = (A+B)/2 + b = (C+A)/2 + c = (A+B)/2 + count += 1 + if a == b and b == c and a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s325451690,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(bin(e&-e))-3or~-e^b&1)" +p03723,s466229114,Wrong Answer,"a,b,c=map(int,input().split()) +if a%2==1 or b%2==1 or c%2==1: + print(-1) +elif a==b==c: + print(0) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + ans+=1 + a1=(b+c)//2 + b1=(c+a)//2 + c1=(a+b)//2 + a=a1 + b=b1 + c=c1 + print(ans)" +p03723,s753135474,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(bin(e&-e))-3or~b%-2^-e)" +p03723,s915472925,Wrong Answer,"A,B,C=map(int, input().split()) +if A==B and B==C: + print(-1) + exit(0) + +cnt=0 +ctr=0 +while True: + A=A//2 + B=B//2 + C=C//2 + flgA=A%2==0 + flgB=B%2==0 + flgC=C%2==0 + Aa=B+C + Bb=A+C + Cc=A+B + A=Aa + B=Bb + C=Cc + + cnt+=1 + ctr+=1 + if [flgA, flgB, flgC].count(True) !=3 or ctr >=100: + break + +print(cnt) +" +p03723,s522802277,Wrong Answer,"a,b,c = tuple(map(int,input().split())) +if len(set((a,b,c)))<3: + print(-1) +else: + ans = 0 + while True: + if a%2==0 and b%2==0 and c%2==0: + a,b,c == b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + else: + break + if len(set((a,b,c)))<3: + print(-1) + break + + print(ans) +" +p03723,s362290159,Wrong Answer,"a,b,c = map(int,input().split()) +i = 0 + +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and i < 10 ** 5: + x = a // 2 + y = b // 2 + z = c // 2 + a = a // 2 + b = b // 2 + c = c // 2 + a += y // 2 + z // 2 + b += x // 2 + z // 2 + c += x // 2 + y // 2 + i += 1 + +if i < 10 ** 5: + print(i) +else: + print(-1)" +p03723,s216092509,Wrong Answer,"#13 +a,b,c = map(int,input().split()) +cnt = 0 +if a%2 == 1 or b%2 == 1 or c%2 == 1: + print('0') + +while a%2 == b%2 == c%2 == 0: + if a==b==c: + print('-1') + break + else: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + cnt+=1 + +print(cnt)" +p03723,s340645815,Wrong Answer,"a,b,c=map(int,open(0).read().split()) + +def is_integer(x): + tf=1 + for i in range(3): + tf*=float.is_integer(l[i]) + return tf + +if a==b==c: + print(-1) +else: + num=-1 + tf=1 + while tf!=0: + l=[(b+c)/2,(c+a)/2,(a+b)/2] + tf=is_integer(l) + num+=1 + l=[(l[1]+l[2])/2, (l[2]+l[0])/2, (l[0]+l[2])/2] + else: + print(num)" +p03723,s144208304,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print(len(f'{e&-e:b}')-(e!=b&1))" +p03723,s759785122,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B and B == C: + print(-1) + exit() + +count = 0 +while (A % 2, B % 2, C % 2) == (0, 0, 0): + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + count += 1 + +print(count)" +p03723,s520339219,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + count = 0 + while 0 == A % 2 == B % 2 == C % 2: + A = (B + C) // 2 + B = (C + A) // 2 + C = (A + B) // 2 + count += 1 + print(count) + " +p03723,s133448139,Wrong Answer,"A, B, C = map(int, input().split()) +res = 0 + +if A == B == C: + res = -1 +else: + while all([A % 2 ==0, B % 2 == 0, C % 2 ==0]): + at, bt, ct = A/2, B/2, C/2 + A = bt + ct + B = at + ct + C = at + bt + res += 1 + +print(res)" +p03723,s715013794,Wrong Answer,"# おっぱっぴー + +A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +else: + ans = 0 + while A % 2 == B % 2 == C % 2 == 0: + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + ans += 1 + + print(ans) + +" +p03723,s824968379,Wrong Answer,"A, B, C = map(int, input().split()) + +if A==B and B==C: + print(-1) +else: + count = 0 + while True: + count+=1 + A_tmp = B/2 + C/2 + B_tmp = A/2 + C/2 + C = A/2 + B/2 + A = A_tmp + B = B_tmp + if A%2==1 or B%2==1 or C%2==1: + break + print(count)" +p03723,s608910969,Wrong Answer,"A,B,C=map(int,input().split()) +count=0 +if A==B and A==C: + print(""-1"") + exit() +elif A%2==1 or B%2==1 or C%2==1: + print(""0"") + exit() +while True: + a,b,c=A/2,B/2,C/2 + A,B,C=b+c,a+c,a+b + count+=1 + if A%2==1 or B%2==1 or C%2==1: + break +print(count)" +p03723,s934731833,Wrong Answer,"A, B, C = input().split("" "") +A, B, C = int(A), int(B), int(C) +ans = 0 +while True: + if A == B and B == C: + print(-1) + break + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(ans) + break + A, B, C = (B + C) / 2, (C + A) / 2, (A + B) / 2 + ans += 1" +p03723,s530574421,Wrong Answer,"A,B,C = map(int, input().split()) +a = [A] +b = [B] +c = [C] +count = 0 +for i in range(10 ** 9 + 1): + + if a[i] == b[i] == c[i]: + count = -1 + break + elif a[i] % 2 == 1 or b[i] % 2 == 1 or c[i] % 2 == 1: + break + else: + a.append(b[i] / 2 + c[i] / 2) + b.append(a[i] / 2 + c[i] / 2) + c.append(a[i] / 2 + b[i] / 2) + count += 1 + +print(count) + +" +p03723,s658063040,Wrong Answer,"a,b,c=list(map(int,input().split())) +if a==b and b==c and c==a: + print('-1') +n=0 +while a%2==0 and b%2==0 and c%2==0: + temp_a = c/2+b/2 + temp_b = a/2+c/2 + temp_c = a/2+b/2 + a = temp_a + b = temp_b + c = temp_c + n+=1 +print(n)" +p03723,s747203114,Wrong Answer,"A, B, C = map(int, input().strip().split()) +ans = 0 +while (A != B or B != C) and (A % 2) + (B % 2) + (C % 2) == 0: + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + ans += 1 +if A == B == C: + ans = -1 +print(ans)" +p03723,s503559162,Wrong Answer,"A,B,C=map(int, input().split()) +cnt=0 +while True: + A=A//2 + B=B//2 + C=C//2 + flgA=A%2==0 + flgB=B%2==0 + flgC=C%2==0 + Aa=B+C + Bb=A+C + Cc=A+B + A=Aa + B=Bb + C=Cc + + cnt+=1 + if A==B and A==C: + print(-1) + exit(0) + if [flgA, flgB, flgC].count(True) !=3: + break + +print(cnt) +" +p03723,s282195243,Wrong Answer,"a, b, c = map(int, input().split()) + +total = a + b + c + +if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b == c: + print(-1) +else: + count = 1 + while True: + a, b = (total - a) / 2, (total - b) / 2 + if a % 2 != 0 or b % 2 != 0: + print(count) + break + else: + count += 1 +" +p03723,s103456546,Wrong Answer,"def main(): + A, B, C = map(int, input().split()) + if A == B == C: + print('-1') + exit() + + ans = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ans += 1 + A, B, C = (B + C) * 0.5, (A + C) * 0.5, (A + B) * 0.5 + print(ans) + + +if __name__ == '__main__': + main() +" +p03723,s062360478,Wrong Answer,"a, b, c=map(int,input().split()) +A,B,C = a,b,c +ans = 0 +if(a%2 or b%2 or c%2): ans = -1 +while(a%2==0 and b%2==0 and c%2==0): + if(A==B==C): + ans = 0 + break + A,B,C = a,b,c + a = B//2 + C//2 + b = A//2 + C//2 + c = A//2 + B//2 + ans += 1 +print(ans) if(ans>=0) else print(-1) + +" +p03723,s304186808,Wrong Answer,"# おっぱっぴー + +A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +else: + for i in range(100): + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(i) + break + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + +" +p03723,s373490121,Wrong Answer,"a,b,c = tuple(map(int,input().split())) + +ans = 0 +while True: + if len(set((a,b,c)))<3: + print(-1) + exit() + if a%2==0 and b%2==0 and c%2==0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + else: + break +print(ans) +" +p03723,s723175044,Wrong Answer,"import random as rng +import itertools as it +import collections as col +import heapq as hq +import sys +import copy as cp +sys.setrecursionlimit(10**9) +input = sys.stdin.readline + + +def dump_impl(*objects): + print(*objects, file=sys.stderr) + + +def dump_dummy(*objects): + pass + + +dump = dump_impl if ""DEBUG"" in sys.argv else dump_dummy + + +def odd(n): return n & 1 + + +def even(n): return not odd(n) + +S = input() +dump(S) +print(S) + +" +p03723,s240812623,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) + exit(0) +ans=0 +while a%2==0 and b%2==0 and c%2==0: + aa=a/2 + bb=b/2 + cc=c/2 + a=bb+cc + b=aa+cc + c=bb+aa + ans+=1 +print(ans)" +p03723,s243063253,Wrong Answer,"a, b, c = map(int, input().split()) + +count = 0 + +if a == b == c: + print(-1) +else: + for _ in range(100000): + + _a, _am = divmod(a, 2) + _b, _bm = divmod(b, 2) + _c, _cm = divmod(c, 2) + + if _am or _bm or _cm: + print(count) + break + else: + a = _b + _c + b = _a + _c + c = _a + _b + count += 1" +p03723,s321595737,Wrong Answer,"import bisect,collections,copy,itertools,math,numpy,string +def I(): return int(input()) +def S(): return input() +def LI(): return list(map(int,input().split())) +def LS(): return list(input().split()) +################################################## +A,B,C = LI() +ans = 0 +if A==B==C: + ans = -1 +else: + while 1: + if A%2 or B%2 or C%2: + break + A,B,C = (B+C)//2,(A+C)//2,(A+B)//2 + ans += 1 +print(ans)" +p03723,s193915071,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + cnt = 0 + while A%2 == B%2 == C%2 == 0: + x = (B+C)//2 + y = (A+C)//2 + z = (A+B)//2 + A = x + B = y + C = z + cnt += 1 + print(cnt)" +p03723,s475515071,Wrong Answer,"A, B, C = list(map(int, input().split())) + +if A == B == C: + if A % 2 == 0: + print('-1') +else: + count = 0 + for _ in range(10 ** 9): + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(count) + break + tmp_A = A + tmp_B = B + tmp_C = C + A = (tmp_B + tmp_C) / 2 + B = (tmp_A + tmp_C) / 2 + C = (tmp_B + tmp_A) / 2 + count += 1 +" +p03723,s895724293,Wrong Answer,"A, B, C = map(int, input().split()) + +cnt = 0 +if(A==B==C): + print(""-1"") +else: + while(A%2 == 0 and B%2 == 0 and C%2 == 0): + tmpA = A + tmpB = B + tmpC = C + cnt += 1 + A = tmpB//2+tmpC//2 + B = tmpA//2+tmpC//2 + C = tmpA//2+tmpB//2 + print(cnt)" +p03723,s383099711,Wrong Answer,"a,b,c=map(int,input().split()) +f=True +aa=0 +bb=0 +cc=0 +cnt=0 +while f: + aa = b/2+c/2 + bb = a/2+c/2 + cc = a/2+b/2 + cnt+=1 + if aa == bb == cc: + cnt=-1 + break + if aa%2!=0 or bb%2!=0 or cc%2!=0: + f=False + else: + a=aa + b=bb + c=cc + +print(cnt)" +p03723,s572612606,Wrong Answer,"def resolve(): + a,b,c=map(int, input().split()) + if a+b==a+c==b+c: + print(-1) + else: + cnt=0 + while a%2==b%2==c%2==0: + a_new=(b+c)//2 + b_new=(a+c)//2 + c_new=(a+b)//2 + a=a_new + b=b_new + c=c_new + cnt+=1 + print(cnt) + +resolve()" +p03723,s079049102,Wrong Answer,"a, b, c = map(int, input().split()) + +flag = 0 +ans = 0 + +if a == b == c: + ans = -1 + +else: + while flag == 0: + if a%2 == 0 and b%2 == 0 and c%2 == 0: + a_tmp = (b+c)/2 + b_tmp = (a+c)/2 + c_tmp = (a+b)/2 + + a = a_tmp + b = b_tmp + c = c_tmp + + ans += 1 + + else: + flag = 1 + +print(ans)" +p03723,s397206203,Wrong Answer,"A,B,C=map(int,input().split()) +if A==B==C: + print('-1') +elif A%2!=0 or B%2!=0 or C%2!=0: + print('0') +else: + ans=0 + while A%2==0 and B%2==0 and C%2==0: + a=A + b=B + c=C + A=int((b+c)/2) + B=int((c+a)/2) + C=int((a+b)/2) + ans+=1 + print(ans) + " +p03723,s394908648,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b and b == c: + print(-1) + exit() +cnt = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = b//2+c//2, c//2+a//2, a//2+b//2 + cnt += 1 +print(cnt) +" +p03723,s486546408,Wrong Answer,"a, b, c =map(int, input().split()) + +if a== b and b==c and c==a : + print(-1) +else: + count = 0 + while(a%2==0 and b%2==0 and c%2 ==0): + a, b, c = b//2 + c//2, a//2 + c//2, a//2 + b//2 + count+=1 + print(count) + " +p03723,s873254456,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b and b == c: + print(-1) + exit() + +count = 0 +while all([a % 2 == 0, b % 2 == 0, c % 2 == 0]): + a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2 + count += 1 + +print(count)" +p03723,s159031692,Wrong Answer,"import sys +sys.setrecursionlimit(10**9) + +a,b,c = map(int,input().split()) + +if a == b == c: + print(-1) + sys.exit() +cnt = 0 +while True: + if a%2==1 or b%2==1 or c%2==1: + break + a,b,c = (b+c)//2,(a+c)//2,(b+c)//2 + cnt += 1 + +print(cnt)" +p03723,s561703354,Wrong Answer,"a, b, c = map(int, input().split()) + +ans = 0 +for i in range(10000): + if a == b == c: + print(-1) + break + if (a + 1) * (b + 1) * (c + 1) % 2 == 0: + print(ans) + break + ans += 1 + a, b, c = a // 2, b // 2, c // 2 + a, b, c = b + c, a + c, b + c" +p03723,s287711656,Wrong Answer,"a, b, c =map(int, input().split()) +i,j,k = a,b,c +X=0 +if a ==b and b ==c: + print('-1') + exit() +else: + while i%2 ==0 and j%2==0 and k%2==0: + i = (b+c)/2 + j = (c+a)/2 + k = (a+b)/2 + a,b,c = i,j,k + X +=1 +print(X)" +p03723,s237166221,Wrong Answer,"a, b, c = map(int, input().split()) +a_tmp = a ; b_tmp = b ; c_tmp = c +count = 0 +while True : + if a == b == c : + print(""-1"") + break + elif a%2 == 1 or b%2 == 1 or c%2 == 1 : + print(count) + break + else : + a = b_tmp/2 + c_tmp/2 + b = a_tmp/2 + c_tmp/2 + c = a_tmp/2 + b_tmp/2 + a_tmp = a ; b_tmp = b ; c_tmp = c + count += 1 +" +p03723,s489044317,Wrong Answer,"a, b, c = map(int, input().split()) +count = 0 +for i in range(10**7): + a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2 + count += 1 + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(count) + exit() +print(-1)" +p03723,s543071418,Wrong Answer,"A,B,C=map(int, input().split()) +if A==B and B==C: + print(-1) + exit(0) + +cnt=0 +while True: + A=A//2 + B=B//2 + C=C//2 + flgA=A%2==0 + flgB=B%2==0 + flgC=C%2==0 + Aa=B+C + Bb=A+C + Cc=A+B + A=Aa + B=Bb + C=Cc + + cnt+=1 + if [flgA, flgB, flgC].count(True) !=3: + break + +print(cnt) +" +p03723,s566453883,Wrong Answer,"A, B, C = map(int, input().split()) +if A != B != C: + D = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A = B/2 + C/2 + B = A/2 + C/2 + C = A/2 + B/2 + D += 1 + print(D) +else: + print('-1')" +p03723,s754371979,Wrong Answer,"import numpy as np +import sys + +input = sys.stdin.readline + +A,B,C = map(int,input().split()) + +ans = 0 + +if A == B and B == C: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + next_a =int( C/2 + B/2) + next_b =int( A/2 + C/2) + next_c =int( A/2 + B/2) + A = next_a + B = next_b + C = next_c + ans += 1 + if A == B and B == C: + ans = -1 + + +print(ans) +" +p03723,s073197194,Wrong Answer,"import sys +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s838313104,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e!=b%2)*(e&-e).bit_length()-1)" +p03723,s676698082,Wrong Answer,"a, b, c =map(int, input().split()) +if a ==b and b ==c: + print('-1') + exit() +X = 0 +i,j,k = a,b,c +while i%2 ==0 and j%2==0 and k%2==0: + i = (b+c)/2 + j = (c+a)/2 + k = (a+b)/2 + a,b,c = i,j,k + X +=1 +print(X)" +p03723,s329596274,Wrong Answer,"a,b,c = map(int,input().split()) +count = 0 +if a == b == c : + print(-1) +else: + while a%2 == 0 or b%2 == 0 or c%2 == 0: + a1 = a + b1 = b + c1 = c + a = a1//2 + b1//2 + c1//2 + b = a1//2 + b1//2 + c1//2 + c = a1//2 + b1//2 + c1//2 + count += 1 + print(count) +" +p03723,s063932991,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() + +count = 0 +while True: + a = (A+B)/2 + b = (C+A)/2 + c = (A+B)/2 + count += 1 + if (a == b and b == c) or count > 31: + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s863468544,Wrong Answer,"from fractions import gcd +def main(): + a, b, c = map( int, input().split()) + if a == b == c: + print(""-1"") + return + ans = 0 + bi = 2 + while a%bi == 0 and b%bi == 0 and c%bi == 0: + a, b, c = a//2+b//2, b//2+c//2, c//2+a//2 + ans += 1 + print(ans) +if __name__ == '__main__': + main() +" +p03723,s709700513,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +cnt = 0 +while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0): + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + cnt += 1 + +print(cnt) +" +p03723,s807095697,Wrong Answer,"# A - Cookie Exchanges + +A, B, C = map(int, input().split()) + +def div2(x): + ans = 0 + while(x%2==0): + x /= 2 + ans += 1 + return ans + +if A==B and B==C: + print(-1) +else: + print(min(div2(abs(A-B)), div2(abs(A-C))))" +p03723,s478557425,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|c-b +print(len(bin(e&-e))-3or~a%-2)" +p03723,s223292167,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + if A == B == C: + ans = -1 + break + A,B,C = B//2+C//2,A//2+C//2,A//2+B//2 + ans += 1 +print(ans)" +p03723,s831295841,Wrong Answer,"A,B,C = map(int,input().split()) + +#print(A,B,C) + +if A==B and B==C: + print(-1) +else: + count=0 + while A%2==0 and B%2==0 and C%2==0: + Ax=A/2 + Bx=B/2 + Cx=C/2 + #print(Ax,Bx,Cx) + A = int(Bx+Cx) + B = int(Cx+Ax) + C = int(Ax+Bx) + count +=1 + #print(A,B,C) + print(count) + + + + + + + " +p03723,s897206368,Wrong Answer,"def resolve(): + A,B,C = map(int,input().split()) + count = 0 + if A == C and A == B and A % 2 == 1: + print(-1) + else: + while (A % 2 == 0 and B % 2 == 0 and C % 2 == 0): + tmpA = (B + C) / 2 + tmpB = (A + C) / 2 + tmpC = (A + B) / 2 + A = tmpA + B = tmpB + C = tmpC + count = count + 1 + print(count) +resolve()" +p03723,s947317505,Wrong Answer,"a,b,c = map(int,input().split()) +count = 0 +if a == b == c : + print(-1) +else: + while a%2 == 0 or b%2 == 0 or c%2 == 0: + count += 1 + a1 = a + b1 = b + c1 = c + a = a1//2 + b1//2 + c1//2 + b = a1//2 + b1//2 + c1//2 + c = a1//2 + b1//2 + c1//2 + print(count) +" +p03723,s350998874,Wrong Answer,"a, b, c = map(int, input().split()) +a_tmp = a ; b_tmp = b ; c_tmp = c +count = 0 +while True : + count += 1 + a = b_tmp/2 + c_tmp/2 + b = a_tmp/2 + c_tmp/2 + c = a_tmp/2 + b_tmp/2 + a_tmp = a ; b_tmp = b ; c_tmp = c + if a%2 == 1 or b%2 == 1 or c%2 == 1 : + print(count) + break + elif count > 100000 : + print(""-1"") + break + else : + continue +" +p03723,s227809768,Wrong Answer,"a,b,c = map(int,input().split()) +i = 0 + +if a == b == c: + print(-1) + exit(0) + +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + al = b // 2 + c // 2 + bl = a // 2 + c // 2 + cl = a // 2 + b // 2 + a = al + b = bl + c = cl + i += 1 + +print(i)" +p03723,s127533150,Wrong Answer,"def check(aa,bb,cc): + if aa%2==0 and bb%2==0 and cc%2==0: + return True + else: + return False + +a,b,c = map(int, input().split()) +if a == b == c: + print(-1) + exit() + +ans = 0 +while check(a,b,c): + _a = b / 2 + c / 2 + _b = a / 2 + c / 2 + _c = a / 2 + b / 2 + a = _a + b = _b + c = _c + ans += 1 +print(ans)" +p03723,s618005664,Wrong Answer,"a, b, c = map(int, input().split()) + +count = 0 + +if a == b == c: + print(-1) +else: + for _ in range(10000): + + _a, _am = divmod(a, 2) + _b, _bm = divmod(b, 2) + _c, _cm = divmod(c, 2) + + if _am or _bm or _cm: + print(count) + break + else: + a = _b + _c + b = _a + _c + c = _a + _b + count += 1" +p03723,s576755821,Wrong Answer,"a, b, c = map(int, input().split()) +za = a +zb = b +zc = c + +d = 0 + +if a == b == c: + print(-1) + exit() + +while True: + a = int(zb / 2) + int(zc / 2) + b = int(za / 2) + int(zc / 2) + c = int(za / 2) + int(zb / 2) + + za = a + zb = b + zc = c + + d += 1 + + if a % 2 != 0 or b % 2 != 0 or b % 2 != 0: + print(d) + exit() +" +p03723,s751946491,Wrong Answer,"A,B,C=map(int,input().split()) +count=0 +if A==B and A==C: + print(""-1"") + exit() +while True: + if A%2==1 or B%2==1 or C%2==1: + break + a,b,c=A/2,B/2,C/2 + A,B,C=b+c,a+c,a+b + count+=1 +print(count)" +p03723,s054099730,Wrong Answer,"a, b, c = list(map(int, input().split())) + +cnt = 0 +if (a == b) and (b == c) and (a%2==0): + print(-1) +else: + while(True): + a_ = a/2 + b_ = b/2 + c_ = c/2 + a = b_ + c_ + b = a_ + c_ + c = a_ + b_ + cnt+=1 + if a%2!=0 or b%2!=0 or c%2!=0: + print(cnt) + exit()" +p03723,s503093847,Wrong Answer,"import random as rng +import itertools as it +import collections as col +import heapq as hq +import sys +import copy as cp +sys.setrecursionlimit(10**9) +input = sys.stdin.readline + + +def dump_impl(*objects): + print(*objects, file=sys.stderr) + + +def dump_dummy(*objects): + pass + + +dump = dump_impl if ""DEBUG"" in sys.argv else dump_dummy + + +def odd(n): return n & 1 + + +def even(n): return not odd(n) + +S = input() +dump(S) +print(S) + +" +p03723,s502973404,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) +else: + ans=0 + while a%2==0 and b%2==0 and c%2==0: + A=a + B=b + C=c + a=B//2+C//2 + b=A//2+C//2 + c=B//2+A//2 + ans+=1 + if a==b==c: + ans=-1 + break + print(ans)" +p03723,s136122612,Wrong Answer,"import sys +input = sys.stdin.readline + + +def readstr(): + return input().strip() + + +def readint(): + return int(input()) + + +def readnums(): + return map(int, input().split()) + + +def readstrs(): + return input().split() + + +def main(): + A, B, C = readnums() + if A == B and B == C: + print(-1) + else: + ans = 0 + while all([not A % 2, not B % 2, not C % 2]): + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + ans += 1 + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p03723,s209301836,Wrong Answer,"a,b,c=map(int,input().split()) +na = nb = nc = 0 +cnt = 0 +if a == b == c: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + na = (b+c)//2 + nb = (c+a)//2 + nc = (a+b)//2 + cnt += 1 + a,b,c = na,nb,nc + print(cnt)" +p03723,s019719448,Wrong Answer,"a,b,c = map(int,input().split()) +ans = 0 +if a == b == c and a%2 == 0: + print(-1,-1,-1) + exit() +while a%2 == b%2 == c%2 == 0: + x,y,z = a//2, b//2, c//2 + a = y + z + b = x + z + c = x + y + ans += 1 +print(ans)" +p03723,s425242865,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) + exit() +cnt=0 +while all([q%2==0 for q in (a,b,c)]): + cnt+=1 + s=a+b+c + a=s-a + a//=2 + b=s-b + b//=2 + c=s-c + c//=2 +print(cnt)" +p03723,s012893148,Wrong Answer,"#13 +a,b,c = map(int,input().split()) +cnt = 0 +while a%2 == b%2 == c%2 == 0: + if a==b==c: + print('-1') + break + else: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + cnt+=1 + print(a,b,c) + +print(cnt)" +p03723,s519342471,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + + +if A == B == C: + print(-1) + sys.exit() + +cnt = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + a = B // 2 + C // 2 + b = A // 2 + C // 2 + c = A // 2 + B // 2 + A = a + B = b + C = c + cnt += 1 +print(cnt)" +p03723,s442204834,Wrong Answer,"def main(): + a=tuple(map(int,input().split())) + e=set() + count = 0 + while a not in e: + e.add(a) + count += 1 + a=((a[1]+a[2])//2,(a[0]+a[2])//2,(a[0]+a[1])//2) + for x in a: + if x % 2 != 0: + print(count) + return + else: + print(-1) + +if __name__ == ""__main__"": + main()" +p03723,s424262537,Wrong Answer,"def main(): + a, b, c = map(int, input().split()) + + count = 0 + while True: + count += 1 + i, j, k = a / 2, b / 2, c / 2 + a, b, c = j + k, k + i, i + j + + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(count) + break + elif a == b == c: + print(-1) + break + + +if __name__ == '__main__': + main() +" +p03723,s362753495,Wrong Answer,"a,b,c=map(int,input().split()) + +if a%2==1 or b%2==1 or c%2==1: + print(0) +elif a==b==c: + print(-1) +else: + cnt=0 + d=a + e=b + f=c + while d%2==0 and e%2==0 and f%2==0: + d=(e+f)/2 + e=(f+d)/2 + f=(d+e)/2 + cnt+=1 + print(cnt)" +p03723,s234361223,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +cnt = 1 +while cnt: + a, b, c = int((b+c)/2), int((a+c)/2), int((a+b)/2) + + if a % 2 != 0 or \ + b % 2 != 0 or \ + c % 2 != 0: break + cnt += 1 + +print(cnt) +" +p03723,s196575859,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b and b==c: + ans=-1 +for i in range(1,1000000000): + x=a//2 + y=b//2 + z=c//2 + a=y+z + b=x+z + c=x+y + if a%2==1 or b%2==1 or c%2==1: + ans=i + break +print(ans)" +p03723,s215702310,Wrong Answer,"a,b,c = map(int,input().split()) +if a == b == c: + print(-1) + exit() +for i in range(10**8): + if a%2 != 0 or b%2 != 0 or c%2 != 0: + break + a_o,b_o,c_o = a,b,c + a = b_o//2 + c_o//2 + b = a_o//2 + c_o//2 + c = a_o//2 + b_o//2 +print(i)" +p03723,s903223697,Wrong Answer,"a,b,c = map(int,input().split("" "")) +n = 0 +if a == b == c: + print(-1) + exit() +if a % 2 == 1: + print(0) + exit() +if b % 2 == 1: + print(0) + exit() +if c % 2 == 1: + print(0) + exit() +for i in range(10**9): + aa = a//2 + bb = b//2 + cc = c//2 + a = bb + cc + b = aa + cc + c = aa + bb + n += 1 + if a % 2 == 1: + break + if b % 2 == 1: + break + if c % 2 == 1: + break +print(n)" +p03723,s871921320,Wrong Answer,"a, b, c = map(int, input().split()) +ans = 0 + +if a == b == c: + print(-1) +else : + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + aa, bb, cc = a, b, c + a = bb // 2 + cc // 2 + b = aa // 2 + cc // 2 + c = aa // 2 + bb // 2 + ans += 1 + print(ans) + +" +p03723,s862618214,Wrong Answer,"A,B,C = map(int, input().split()) +a = [A] +b = [B] +c = [C] +count = 0 +for i in range(10 ** 9): + + if a[i] == b[i] == c[i]: + count = -1 + break + elif a[i] % 2 == 1 or b[i] % 1 == 0 or c[i] % 2 == 1: + break + else: + a.append(b[i] / 2 + c[i] / 2) + b.append(a[i] / 2 + c[i] / 2) + c.append(a[i] / 2 + b[i] / 2) + count += 1 + +print(count)" +p03723,s785158536,Wrong Answer,"A,B,C=[int(s) for s in input().split("" "")] + +A=[A] +B=[B] +C=[C] + +Count=0 +for i in range(1000000000): + A.append(B[i]//2+C[i]//2) + B.append(A[i]//2+C[i]//2) + C.append(B[i]//2+A[i]//2) + Count+=1 + if A[i+1]%2!=0 or B[i+1]%2!=0 or C[i+1]%2!=0: + break + if Count>=100000: + Count=-1 + break + +print(Count)" +p03723,s088678053,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e!=0)*(e^e-1).bit_length()-1)" +p03723,s644426639,Wrong Answer,"ans = 0 +A, B, C = map(int, input().split()) +if A == B and A == C: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + A, B, C = B/2+C/2, C/2+A/2, A/2+B/2 + ans += 1 + print(ans)" +p03723,s710833493,Wrong Answer,"A,B,C =map(int,input().split()) +con = 0 +if A == B and B == C: + print(-1) + exit() +while True: + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + con += 1 + D = A / 2 + E = B / 2 + F = C / 2 + A = E + F + B = D + F + C = D + E + +print(con) + " +p03723,s618546045,Wrong Answer,"def main(): + A,B,C = map(int,input().split()) + s = [A,B,C] + a,b,c = A,B,C + if a == b and b == c: + return -1 + + cnt = 0 + while (a % 2 == 0) and (b % 2 == 0) and (c % 2 == 0): + a1,b1,c1 = a,b,c + a = (b1+c1)/2 + b = (a1+c1)/2 + c = (a1+b1)/2 + cnt += 1 + #print(a,b,c) + if [a,b,c] == s: + return -1 + + return cnt + + +ans = main() +print(ans)" +p03723,s682267639,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +cnt = 1 +while cnt: + a, b, c = (b+c)/2, (a+c)/2, (a+b)/2 + + if a % 2 != 0 or \ + b % 2 != 0 or \ + c % 2 != 0: break + cnt += 1 + +print(cnt)" +p03723,s338007961,Wrong Answer,"A,B,C = map(int,input().split()) + +if A == B == C: + print(-1) +else: + c = 0 + while A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + A = B//2 + C//2 + B = A//2 + C//2 + C = B//2 + C//2 + c+=1 + print(c)" +p03723,s752614042,Wrong Answer,"# おっぱっぴー + +A, B, C = map(int, input().split()) + +if A == B == C: + print(-1) +for i in range(100): + if A % 2 != 0 or B % 2 != 0 or C % 2 != 0: + print(i) + break + A, B, C = B/2+C/2, A/2+C/2, A/2+B/2 + +" +p03723,s549218805,Wrong Answer,"A, B, C = map(int, input().split()) + +if A==B==C: + print(-1) +else: + for i in range(100000000): + if A %2==0 and B%2==0 and C%2==0: + a = A/2 + b = B/2 + c = C/2 + A = b+c + B = a+c + C = a+b + else: + print(i) + exit() + +" +p03723,s561583590,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B == C: + print(-1) +else: + cnt = 0 + while A%2 == B%2 == C%2 == 0: + x = B//2+C//2 + y = A//2+C//2 + z = A//2+B//2 + A = x + B = y + C = z + cnt += 1 + print(cnt)" +p03723,s260014363,Wrong Answer,"import sys +A,B,C = map(int,input().split()) +result = 0 +if A == B and B == C: + print(-1) + sys.exit() +else: + while A % 2 == B % 2 and B % 2 == C % 2 and C % 2 == 0: + a = (B + C) // 2 + b = (C + A) // 2 + c = (A + B) // 2 + A,B,C = a,b,c + result += 1 +print(result) +" +p03723,s269518979,Wrong Answer,"a,b,c=map(int,input().split()) + +if a==b==c and a%2==0: + print(-1) +else: + num=0 + while True: + if a%2==1 or b%2==1 or c%2==1: + break + else: + num+=1 + l0=(b+c)/2 + l1=(c+a)/2 + l2=(a+b)/2 + a,b,c=l0,l1,l2 + else: + print(num)" +p03723,s862085541,Wrong Answer,"a,b,c=map(int,input().split()) + +ans=0 +if a==b==c: + print(""-1"") +else: + while a%2==0 and b%2==0 and c%2==0: + num_a,num_b,num_c=a/2,b/2,c/2 + a=num_b+num_c + b=num_a+num_c + c=num_a+num_b + ans+=1 + +print(ans) +" +p03723,s814588995,Wrong Answer,"a,b,c=map(int,input().split()) +count=0 +if a==b==c: + print(-1) + exit() +while a%2==0 and b%2==0 and c%2==0: + A=a//2 + B=b//2 + C=c//2 + a=B+C + b=C+A + c=A+B + count+=1 + if a==b==c: + print(-1) + exit() +print(count)" +p03723,s918413457,Wrong Answer,"import numpy as np +cookies = np.array([int(x) for x in input().split()]) + +if cookies[0] == cookies[1] == cookies[2]: + ans = -1 +else: + ans = 0 + while True: + if not any(cookies%2): + cookies = cookies//2 + ans += 1 + continue + if all(cookies%2): + ans += 1 + break +print(ans)" +p03723,s529168132,Wrong Answer,"A,B,C = map(int,input().split()) +cnt = 0 +while True: + if A == B == C: + print(-1) + break + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + print(cnt) + break + else: + a = A + b = B + c = C + A = (b+c)//2 + B = (a+c)//2 + C = (a+b)//2 + cnt +=1" +p03723,s723054642,Wrong Answer,"a, b, c = map(int, input().split()) + +a_tmp = 0 +b_tmp = 0 +c_tmp = 0 + +flag = 0 +ans = 0 + +if a == b and b == c and c == a: + ans = -1 +else: + while flag == 0: + if a%2 == 1 or b%2 == 1 or c%2 == 1: + flag = 1 + + else: + a_tmp = b/2+c/2 + b_tmp = a/2+c/2 + c_tmp = a/2+b/2 + + a = a_tmp + b = b_tmp + c = c_tmp + + ans += 1 + +print(ans)" +p03723,s309779846,Wrong Answer,"a, b, c = map(int, input().split()) +count = 0 +for i in range(10**9+1): + a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2 + count += 1 + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(count) + exit() +print(-1)" +p03723,s289324515,Wrong Answer,"a,b,c = map(int,input().split()) +cnt=0 +for i in range(100): + if a==b==c and a%2==0: + cnt = -1 + break + elif a%2==0 and b%2==0 and c%2==10: + t_a = b//2 + c//2 + t_b = a//2 + c//2 + t_c = a//2 + b//2 + a,b,c = t_a,t_b,t_c + cnt+=1 + else: + break +print(cnt)" +p03723,s757998231,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) +else: + while True: + total=0 + x=a/2 + y=b/2 + z=c/2 + a=y+z + b=x+z + c=x+y + total+=1 + if a%2!=0 or b%2!=0 or c%2!=0: + print(total) + break" +p03723,s341134966,Wrong Answer,"a,b,c = map(int,input().split()) +if a==b==c: + print(-1) +else: + res = 0 + while True: + if (a%2!=0 or b%2!=0 or c%2!=0) or (a==0 or b==0 or c==0): + break + else: + res += 1 + nx_a = b//2 + c//2 + nx_b = a//2 + c//2 + nx_c = a//2 + b//2 + a,b,c = nx_a, nx_b, nx_c + print(res)" +p03723,s799772689,Wrong Answer,"A,B,C = list(map(int,input().split())) +if A==B==C: + print(-1) +else: + count = 0 + while not A%2 and not B%2 and not C%2: + if (B+C)%2 or (A+C)%2 or (A+B)%2: + break + A,B,C = (B+C)//2,(A+C)//2,(A+B)//2 + count += 1 + print(count)" +p03723,s630579896,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + print(-1) + exit() +for i in range(0, 10**6): + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(i) + exit() + a, b, c = (b+c) / 2, (c+a)/2, (a+b)/2 +" +p03723,s477918502,Wrong Answer,"import numpy as np +import sys + +input = sys.stdin.readline + +A,B,C = map(int,input().split()) + +ans = 0 + +if A == B and B == C: + print(-1) +else: + while 1: + next_a =int( C/2 + B/2) + next_b =int( A/2 + C/2) + next_c =int( A/2 + B/2) + A = next_a + B = next_b + C = next_c + ans += 1 + if A%2 != 0 or B %2 != 0 or C%2 != 0: + print(ans) + exit() +" +p03723,s479764854,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + print(-1) +else: + cnt = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + _a = (b+c)//2 + _b = (c+a)//2 + _c = (a+b)//2 + a = _a + b = _b + c = _c + cnt += 1 + print(cnt)" +p03723,s052010235,Wrong Answer,"A, B, C = [int(i) for i in input().split()] +t, a, s = [A, B, C] +count = 0 + +if A == B == C: + print(-1) +else: + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + t = B / 2 + C / 2 + a = A / 2 + C / 2 + s = A / 2 + B / 2 + A = t + B = a + C = s + count += 1 + + print(count)" +p03723,s089692734,Wrong Answer,"import math +import sys + +a, b, c = map(int, input().split()) +cnt = 0 +if (a == b == c): + print(-1) + sys.exit() + + +while(True): + half_a, half_b, half_c = a / 2, b / 2, c / 2 + ea = a % 2 == 0 + eb = b % 2 == 0 + ec = c % 2 == 0 + if (ea and eb and ec or (not ea) and (not eb) and (not ec)): + cnt += 1 + a = half_b + half_c + b = half_a + half_c + c = half_a + half_b + else: + break + +print(cnt) +" +p03723,s863490548,Wrong Answer,"*a, = map(int, input().split()) +a = [bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)] +print(a[1] if a[0]*a[1]<0 else min(a))" +p03723,s076931843,Wrong Answer,"x = input().split() +t = int(x[0]) / 2 +a = int(x[1]) / 2 +s = int(x[2]) / 2 +t_after = a + s +a_after = t + s +s_after = t + a +t_amari = t_after % 2 +a_amari = a_after % 2 +s_amari = s_after % 2 +count = 0 +while True: + count =+ 1 + if t_amari != 0 or a_amari != 0 or s_amari != 0: + break + elif t == a and a == s: + count = -1 + break +print(count)" +p03723,s512071146,Wrong Answer,"a,b,c=map(int,input().split()) +d=0 +if a==b==c and a%2==0: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + a,b,c=(b+c),(a+c),(a+b) + d+=1 +print(d)" +p03723,s876943229,Wrong Answer,"a,b,c = map(int, input().split()) +print(min(bin(abs(a-b))[::-1].rfind('1'),bin(abs(a-b))[::-1].rfind('1')))" +p03723,s328917673,Wrong Answer,"import sys +input = sys.stdin.readline + +a, b, c = map(int, input().split()) +n_a, n_b, n_c = 0, 0, 0 +ans = 0 + +if a == b == c: + print(-1) + exit() + +for i in range(10 ** 5): + n_a = b // 2 + c // 2 + n_b = a // 2 + c // 2 + n_c = a // 2 + b // 2 + + if n_a % 2 == 0 and n_b % 2 == 0 and n_c % 2 == 0: + ans += 1 + else: + ans += 1 + break + + a = n_a + b = n_b + c = n_c + +print(ans) +" +p03723,s607681034,Wrong Answer,"x,y,z = map(int,input().split()) + +ans = 0 + +s = [] + +while True: + x,y,z = y//2+z//2,x//2+z//2,x//2+y//2 + if x%2 == 0 and y%2 == 0 and z%2 == 0: + ans += 1 + if [x,y,z] in s: + print(-1) + break + else: + s.append([x,y,z]) + else: + print(ans+1) + break" +p03723,s371275542,Wrong Answer,"a, b, c = map(int, input().split()) + +cnt = 0 + +while True: + + if a == b and a == c: + print(-1) + exit() + if a % 2 == 1: + print(cnt) + exit() + if b % 2 == 1: + print(cnt) + exit() + if c % 2 == 1: + print(cnt) + exit() + + lis = [] + lis.append((b+c)/2) + lis.append((a+c)/2) + lis.append((a+b)/2) + a, b, c = lis + + cnt += 1 +" +p03723,s493218652,Wrong Answer,"A, B, C = map(int, input().split()) + +if A==B==C: + print(-1) + exit() + +ans = 0 +while A%2==0 and B%2==0 and C%2==0: + tmpA = A//2 + tmpB = B//2 + tmpC = C//2 + A = tmpB+tmpC + B = tmpC+tmpA + C = tmpA+tmpB + ans += 1 + +print(ans)" +p03723,s135098495,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) + +else: + cnt=0 + while a%2==b%2==c%2==0: + total=a+b+c + a=total//2-a//2 + b=total//2-b//2 + c=total//2-c//2 + cnt+=1 + print(cnt)" +p03723,s342729735,Wrong Answer,"import sys +A,B,C = map(int,input().split()) +result = 0 +if A == B and B == C: + print(-1) +else: + while A % 2 == B % 2 and B % 2 == C % 2 and C % 2 == 0: + a = (B + C) // 2 + b = (C + A) // 2 + c = (A + B) // 2 + A,B,C = a,b,c + result += 1 +print(result) +" +p03723,s754983533,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +if a % 2 != 0 or b % 2 != 0 or c % 2 != 0: + print(0) + exit() + +cnt = 1 +while cnt: + a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 + + if a % 2 != 0 or \ + b % 2 != 0 or \ + c % 2 != 0: break + cnt += 1 + +print(cnt) +" +p03723,s686500700,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B and B == C: + print(""-1"") +else: + ans = 0 + while True: + if A%2==1 or B%2==1 or C%2==1: + break + a = B/2 + C/2 + b = A/2 + C/2 + c = A/2 + B/2 + A, B, C = a, b, c + ans += 1 + print(ans) + " +p03723,s060956646,Wrong Answer,"import sys +a,b,c = map(int,input().split()) + +if a==b==c: + print(-1) + sys.exit() + +C = 1 +while 1: + a, b, c = b//2 + c//2 , a//2 + c//2 , b//2 + a//2 + if a%2 == 1 or b%2 == 1 or c%2 == 1: + print(C) + sys.exit() + else: + C += 1" +p03723,s051094711,Wrong Answer,"a, b, c = map(int,input().split()) +ans = 0 + +if a == b == c: + if a%2 == 0: + print(-1) #無限 + else: + print(ans) #1回もできない + exit() + +while True: + ans += 1 + x = b//2 + c//2 + y = a//2 + c//2 + z = a//2 + b//2 + if x%2 == 1 or y%2 == 1 or z%2 == 1: + break + else: + a = x + b = y + c = z + +print(ans) +" +p03723,s751353920,Wrong Answer,"import sys + +input = sys.stdin.readline + + +def main(): + A, B, C = map(int, input().split()) + + if A == B == C: + print(-1) + exit() + + ans = 0 + while True: + if (A % 2 == 1) or (B % 2 == 1) or (C % 2 == 1): + break + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 + + print(ans) + + +if __name__ == ""__main__"": + main() +" +p03723,s057563895,Wrong Answer,"a,b,c = map(int,input().split()) +if a == b and b == c and c == a: + print(-1) +elif a %2 == 1 or b %2 == 1 or c %2 == 1: + print(0) +else: + cnt = 0 + while(True): + cnt += 1 + ta = b//2 + c //2 + tb = a//2 + c //2 + tc = a//2 + b //2 + if ta %2 == 1 or tb %2 == 1 or tc %2 == 1: + break + a,b,c = ta,tb,tc + print(cnt) +" +p03723,s243928160,Wrong Answer,"a,b,c=map(int,input().split()) + +ans=0 +if a==b==c: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + num_a,num_b,num_c=a//2,b//2,c//2 + a=num_b+num_c + b=num_a+num_c + c=num_a+num_b + ans+=1 + print(ans)" +p03723,s692369128,Wrong Answer,"A,B,C =map(int,input().split()) +con = 0 +if A % 2 == 1 or B % 2 == 1 or C % 1 == 0: + print(0) + exit() +if A == B and B == C: + print(-1) + exit() +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + con += 1 + D = A / 2 + E = B / 2 + F = C / 2 + A = E + F + B = D + F + C = D + E + +print(con)" +p03723,s902020673,Wrong Answer,"A,B,C=map(int,input().split()) +count=0 +if A==B and A==C: + print(""-1"") + exit() +elif A%2==1 or B%2==1 or C%2==1: + print(""-1"") + exit() +while True: + a,b,c=A/2,B/2,C/2 + A,B,C=b+c,a+c,a+b + count+=1 + if A%2==1 or B%2==1 or C%2==1: + break +print(count)" +p03723,s520361520,Wrong Answer,"a,b,c = map(int, input().split()) +count = 0 +if not a==b==c and a%2==0 and b%2==0 and c%2==0: + while a%2==0 and b%2==0 and c%2==0: + temp_a = a + temp_b = b + temp_c = c + a += temp_b/2 + temp_c/2 + b += temp_a/2 + temp_c/2 + c += temp_a/2 + temp_b/2 + count+=1 + print(count) +else: + print(""-1"")" +p03723,s992119347,Wrong Answer,"A, B, C = map(int,input().split()) +ans = 0 +while True: + if A == B and B == C: + ans = -1 + break + elif A & 1 or B & 1 or C & 1: break + else: + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 +print(ans)" +p03723,s847578877,Wrong Answer,"A,B,C = map(int,input().split()) +ans = 0 +if A == B == C: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = B/2+C/2,A/2+C/2,B/2+C/2 + ans += 1 +print(ans)" +p03723,s494669489,Wrong Answer,"a,b,c=map(int,input().split());e=a-b|c-b;print((e&-e).bit_length()-1)" +p03723,s253185888,Wrong Answer,"def main(): + a,b,c = map(int,input().split()) + s = [a,b,c] + if a == b and b == c: + return -1 + + cnt = 0 + while (a % 2 == 0) and (b % 2 == 0) and (c % 2 == 0): + + a1,b1,c1 = a,b,c + a = (b1+c1)//2 + b = (a1+c1)//2 + c = (a1+b1)//2 + + if [a,b,c] == s: + return -1 + + cnt += 1 + #print(a,b,c) + + return cnt + + +ans = main() +print(ans)" +p03723,s269269485,Wrong Answer,"def mapint_inp(): + return map(int, input().split()) + +A, B, C = mapint_inp() + +ans = 0 +while(1): + if A == B and B == C: + ans = -1 + break + if A%2==1 or B%2==1 or C%2==1: + break + halvedA = A//2 + halvedB = B//2 + halvedC = C//2 + A = halvedB+halvedC + B = halvedA+halvedC + C = halvedA+halvedB + ans+=1 + +print(ans)" +p03723,s512797555,Wrong Answer,"def resolve(): + A, B, C = list(map(int, input().split())) + if (A == B and B == C and C == A): + if (A % 2 == 0 and B % 2 == 0 and C % 2 == 0): + print(-1) + else: + print(0) + return + + ans = 0 + while True: + A, B, C = (B / 2 + C / 2), (C / 2 + A / 2), (A / 2 + B / 2) + ans += 1 + if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(ans) + return + + return +resolve()" +p03723,s314752129,Wrong Answer,"A,B,C= map(int,input().split()) + +if A==B==C: + print('-1') +elif A%2==1 or B%2==1 or C%2==1: + print(0) +else: + cnt = 0 + + flag = True + while flag: + A, B, C = (B+C)//2, (A+C)//2, (A+B)//2 + cnt += 1 + if A%2==0 and B%2==0 and C%2==0: + continue + else: + flag = False + + print(cnt)" +p03723,s493333325,Wrong Answer,"A,B,C = list(map(int, input().split())) +count=0 +while True: + if A==B and B==C and C==A: + print(-1) + break + elif A%2==0 and B%2==0 and C%2 == 0: + A2 = 0.5*A + B2 = 0.5*B + C2 = 0.5*C + A = B2+C2 + B = C2+A2 + C = A2+B2 + count=count+1 + elif A%2 ==1or B%2 ==1 or C%2 ==1: + print(count) + break" +p03723,s441473858,Wrong Answer,"A,B,C = map(int,input().split()) +cou = 0 +if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(""0"") +while(cou < 10**6): + cou += 1 + a = A + b = B + c = C + A = b/2 + c/2 + B = a/2 + c/2 + C = a/2 + b/2 + if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(str(cou)) + exit() + else: + pass +print(""-1"")" +p03723,s059097375,Wrong Answer,"A,B,C=map(int,input().split()) +count=0 +#if A==B and A==C: +print(""-1"") +exit() +while True: + a,b,c=A/2,B/2,C/2 + A,B,C=b+c,a+c,a+b + count+=1 + if A%2==1 or B%2==1 or C%2==1: + break +print(count)" +p03723,s036319215,Wrong Answer,"a,b,c=map(int,input().split()) +e=(a-b)|(b-c) +print(bool(e|(a|b|c)%2)*len(f'{e^~-e:b}')-1)" +p03723,s403783357,Wrong Answer,"import numpy as np +import sys + +input = sys.stdin.readline + +A,B,C = map(int,input().split()) + +ans = 0 + +if A == B and B == C: + print(-1) +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + next_a =int( C/2 + B/2) + next_b =int( A/2 + C/2) + next_c =int( A/2 + B/2) + A = next_a + B = next_b + C = next_c + ans += 1 + + print(ans) +" +p03723,s854679107,Wrong Answer,"a,b,c = map(int,input().split()) + +if (a == b ) and (b == c): + print(-1) +else: + def exchange(a,b,c): + return (b+c)/2,(c+a)/2,(a+b)/2 + num = 0 + ans = 0 + while num == 0: + a,b,c = exchange(a,b,c) + ans += 1 + for j in range(3): + if [a,b,c][j] % 2 ==1: + num = 1 + print(ans)" +p03723,s525072841,Wrong Answer,"A,B,C = map(int,input().split()) + +if A == B and B == C: + print(-1) +else: + c = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + ba = A + bb = B + bc = C + A = (bb + bc)//2 + B = (ba + bc)//2 + C = (ba + bb)//2 + c+=1 + print(c) +" +p03723,s492252061,Wrong Answer,"a, b, c = map(int, input().split()) +t = 0 +if a == b == c: + print('-1') + +else: + while (a % 2 + b % 2 + c % 2) == 0: + a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2 + t += 1 + + print(t)" +p03723,s909913169,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|c-b +print(len(bin(e&-e))-3or~b%-2)" +p03723,s270208409,Wrong Answer,"A, B, C = map(int, input().split()) + +if A == B == C: + print('-1') +else: + ans = 0 + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + ans += 1 + print(ans) +" +p03723,s532499762,Wrong Answer,"A, B, C = map(int, input().split()) +if A == B and B == C: + print(-1) +else: + ans = 0 + while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + a = A // 2 + b = B // 2 + c = C // 2 + A = b + c + B = c + a + C = a + b + ans += 1 + if ans > 10**5: + print(-1) + exit() + print(ans)" +p03723,s768297253,Wrong Answer,"A, B, C = map(int, input().split()) +X = (A|B|C)^(A&B&C) +ans = (X&-X).bit_length()-1 +print(ans) +" +p03723,s364170652,Wrong Answer,"A, B, C = map(int,input().split()) +ans = 0 +while True: + if A & 1 or B & 1 or C & 1: break + elif A % 4 == B % 4 and B % 4 == C % 4: + ans = -1 + break + else: + ans += 1 + A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2 +print(ans)" +p03723,s782132800,Wrong Answer,"# coding: utf-8 +A, B, C = map(int, input().split()) +count = 0 + +if A == B == C: + print(-1) + exit() +while True: + if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1): + print(count) + break + count += 1 + A1 = A + B1 = B + C1 = C + A = B1//2 + C1//2 + B = A1//2 + C1//2 + C = A1//2 + B1//2 +" +p03723,s344230877,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b and b == c: + print(-1) +else: + count = 0 + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2 + count += 1 + print(count)" +p03723,s576188154,Wrong Answer,"A, B, C = (int(x) for x in input().split()) + +count = 0 +S = 0 +T = 0 +U = 0 + +if(A == B == C): + print(""-1"") + +else: + while(A % 2 == 0 and B % 2 == 0 and C % 2 == 0): + count+= 1 + S = 1/2 * A + T = 1/2 * B + U = 1/2 * C + A = T + U + B = S + T + C = S + U + print(count)" +p03723,s898539750,Wrong Answer,"A, B, C = map(int, input().split()) +cnt = 0 + +if A == B and B == C: + print(-1) +else: + while True: + if A%2!=0 or B%2!=0 or C%2!=0: + print(cnt) + break + else: + temp_A = A + temp_B = B + A = B/2 + C/2 + B = temp_A/2 + C/2 + C = temp_A/2 + temp_B/2 + cnt += 1 + +" +p03723,s782099193,Wrong Answer,"def resolve(): + a, b, c = map(int, input().split()) + if a == b == c: + print(-1) + exit() + if a%2 != 0 or b%2 != 0 or c%2 != 0: + print(0) + exit() + ans = 0 + while (a%2 == 0 and b%2 == 0 and c%2 == 0): + a, b, c = (b+c)//2, (a+c)//2 , (a+b)//2 + ans += 1 + print(ans) +resolve()" +p03723,s392839825,Wrong Answer,"a,b,c=map(int,input().split()) +if a==b==c: + print(-1) +else: + total=0 + while True: + x=a/2 + y=b/2 + z=c/2 + a=y+z + b=x+z + c=x+y + total+=1 + if a%2!=0 or b%2!=0 or c%2!=0: + print(total) + break" +p03723,s024362681,Wrong Answer,"a ,b ,c = map(int,input().split()) +if a == b == c: + ans = -1 +else: + ans = 0 + while True: + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + na = a + nb = b + nc = c + a = (nb + nc)//2 + b = (na + nc)//2 + c = (na + nb)//2 + ans += 1 +print(ans)" +p03723,s849106989,Wrong Answer,"A,B,C = map(int, input().split()) +a = [A] +b = [B] +c = [C] +count = 0 +for i in range(10 ** 9): + + if a[i] == b[i] == c[i]: + count = -1 + break + elif a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0: + a.append(b[i] / 2 + c[i] / 2) + b.append(a[i] / 2 + c[i] / 2) + c.append(a[i] / 2 + b[i] / 2) + count += 1 + else: + break + +print(count) +" +p03723,s411141679,Wrong Answer,"a,b,c=map(int,input().split()) +ans=0 +if a==b==c: + print (""-1"") +else: + while a%2==0 and b%2==0 and c%2==0: + ta=(b//2)+(c//2) + tb=(a//2)+(c//2) + tc=(a//2)+(b//2) + a,b,c=ta,tb,tc + ans+=1 + print (ans)" +p03723,s488265776,Wrong Answer,"a, b, c = map(int,input().split()) +ans = 0 + +if a == b == c: + if a%2 == 0: + print(-1) #無限 + else: + print(ans) #1回もできない + +while True: + ans += 1 + x = b//2 + c//2 + y = a//2 + c//2 + z = a//2 + b//2 + if x%2 == 1 or y%2 == 1 or z%2 == 1: + break + else: + a = x + b = y + c = z + +print(ans) +" +p03723,s662607719,Wrong Answer,"A, B, C = map(int, input().split()) + +if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + if A == B and B == C: + print('-1') + exit() + +count = 0 +for i in range(10**9): + if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: + break + count += 1 + a = A + b = B + c = C + A = b // 2 + c // 2 + B = a // 2 + c // 2 + C = a // 2 + b // 2 + +print(count) +" +p03723,s266570666,Wrong Answer,"import sys +A, B, C = map(int, input().split()) +ans = 0 + +if A == B == C: + print(-1) + sys.exit() + +while True: + if A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + t_A, t_B, t_C = A, B, C + A = (t_B + t_C) // 2 + B = (t_C + t_A) // 2 + C = (t_A + t_B) // 2 + ans += 1 + else: + print(ans) + break" +p03723,s491543890,Wrong Answer,"a,b,c=454,414,444 + +ans=0 +if a==b==c: + print(""-1"") +else: + while a%2==0 and b%2==0 and c%2==0: + num_a,num_b,num_c=a/2,b/2,c/2 + a=num_b+num_c + b=num_a+num_c + c=num_a+num_b + ans+=1 + +print(ans)" +p03723,s683098078,Wrong Answer,"A, B, C = map(int, input().split()) + + +def cnt(N): + cnt = 0 + while N % 2 == 0: + cnt += 1 + N //= 2 + + return cnt + + +if A == B == C and A % 2 == 0: + print(-1) +elif len(set([cnt(A), cnt(B), cnt(C)])) <= 2: + print(min(cnt(A), cnt(B), cnt(C))) +else: + print(min(cnt(A), cnt(B), cnt(C)) + 1) + +" +p03723,s806611681,Wrong Answer,"a,b,c = tuple(map(int,input().split())) + +ans = 0 +while True: + if len(set((a,b,c)))<3: + print(-1) + break + if a%2==0 and b%2==0 and c%2==0: + a,b,c = b//2+c//2,c//2+a//2,a//2+b//2 + ans+=1 + print(a,b,c) + else: + break +print(ans)" +p03723,s263059087,Wrong Answer,"A,B,C=map(int,input().split()) +if A==B==C: + print(-1) +else: + count=0 + while A%2==B%2==C%2==0: + A,B,C=(B+C)/2,(C+A)/2,(A+B)/2 + count+=1 + print(count)" +p03723,s313091809,Wrong Answer,"a, b, c = map(int, input().split()) +if a == b == c: + print(-1) + exit() +for i in range(0, 10**5): + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + print(i) + exit() + a, b, c = (b+c) / 2, (c+a)/2, (a+b)/2" +p03723,s683864963,Wrong Answer,"A, B, C = map(int,input().split()) +c = 0 + +if A == B == C: + c = -1 +else: + while (A % 2 == 0) and (B % 2 == 0) and (C % 2 == 0): + A, B, C = B/2+C/2, C/2+A/2, A/2+B/2 + c += 1 + +print(c)" +p03723,s771395653,Wrong Answer,"a, b, c = map(int, input().split()) +ans = 0 +if a == b == c: + print(-1) +else: + while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + total = a + b + c + a = (total - a) / 2 + b = (total - b) / 2 + c = (total - c) / 2 + ans += 1 + print(ans)" +p03723,s438641390,Wrong Answer,"a, b, c = map(int, input().split()) +za = a +zb = b +zc = c + +d = 0 + +if a == b == c: + print(-1) + exit() +elif not(a % 2 == 0 and b % 2 == 0 and c % 2 ==0): + print(0) + exit() + +while True: + a = int(zb / 2) + int(zc / 2) + b = int(za / 2) + int(zc / 2) + c = int(za / 2) + int(zb / 2) + + za = a + zb = b + zc = c + + d += 1 + + if a % 2 != 0 or b % 2 != 0 or b % 2 != 0: + print(d) + exit() +" +p03723,s772507833,Wrong Answer,"A,B,C = map(int,input().split()) +if A*2 == B+C and B*2 == A+C and C*2 == A+B: + print(-1) + exit() +ans = 0 +for i in range(10000): + a = A//2 + b = B//2 + c = C//2 + if A%2 == 0 and B%2 == 0 and C%2 == 0: + ans += 1 + A = b+c + B = a+c + C = a+b + else: + print(ans) + exit()" +p03723,s877002409,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b and a == c: + print(-1) + exit() + +ans = 0 +s, t, u = 0, 0, 0 +while a%2==0 and b%2==0 and c%2==0: + s = b//2 + c//2 + t = a//2 + c//2 + u = a//2 + b//2 + a, b, c = s, t, u + ans += 1 + +print(ans)" +p03723,s579737534,Wrong Answer,"A, B, C = map(int,input().split()) + +ans = 0 +while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: + if A == B and A == C: + print(-1) + exit() + a = (B+C)//2 + b = (A+C)//2 + c = (A+B)//2 + A = a + B = b + C = c + print(A,B,C) + ans += 1 + +print(ans)" +p03723,s643576028,Wrong Answer,"A, B, C = list(map(int, input().split())) + +ListA = [A]*10000 +ListB = [B]*10000 +ListC = [C]*10000 + +for i in range (1, 10000): + ListA[i]= ListB[i-1]/2+ListC[i-1]/2 + ListB[i]= ListA[i-1]/2+ListC[i-1]/2 + ListC[i]= ListA[i-1]/2+ListB[i-1]/2 + if ListA[i]%2==1 or ListB[i]%2==1 or ListC[i]%2==1: + print(i) + exit() + +print(-1)" +p03723,s398771730,Wrong Answer,"a,b,c=map(int,input().split()) +cnt=0 +if a==b==c: + print(-1) + exit() +while a%2==b%2==c%2==0: + a,b,c=(b+c)/2,(a+c)/2,(a+b)/2 + cnt+=1 +print(cnt) +" +p03723,s279049363,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +if A == B and B == C: + print('-1') + sys.exit() + +count = 0 +while True: + a = B//2 + C//2 + b = C//2 + A//2 + c = A//2 + B//2 + count += 1 + if (a == b and b == c) or count > 31: + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s120552445,Wrong Answer,"import sys +sys.setrecursionlimit(10 ** 7) +input = sys.stdin.readline + +a,b,c = map(int, input().split()) + +if a==b==c and a%2==0: + print(-1) + exit() + +sabc = a+b+c + +cnt = 0 +while True: + a = (sabc-a)/2 + b = (sabc-b)/2 + c = (sabc-c)/2 + cnt+=1 + if a%2==1 or b%2==1 or c%2==1: break + +print(cnt)" +p03723,s371217937,Wrong Answer,"a, b, c = map(int, input().split()) + +if a == b == c: + print(-1) + exit() + +ans = 0 +while a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + a_tmp = b // 2 + c // 2 + b_tmp = a // 2 + c // 2 + c_tmp = a // 2 + b // 2 + a, b, c = a_tmp, b_tmp, c_tmp + ans += 1 + +print(ans)" +p03723,s116912561,Wrong Answer,"a, b, c = map(int, input().split()) +cnt = 0 +total = a + b + c +while True: + if a == (total - a) // 2: + cnt = -1 + break + a = (total - a) // 2 + b = (total - b) // 2 + c = (total - c) // 2 + cnt += 1 + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break +print(cnt)" +p03723,s074540939,Wrong Answer,"from fractions import gcd + +if __name__ == ""__main__"": + a, b, c = map(int, input().split()) + + if a == b == c: + print(-1) + exit() + + ab = abs(a-b) + bc = abs(b-c) + ca = abs(c-a) + + g = gcd(ab, bc) + g = gcd(g, ca) + + ans = 0 + while g % 2 == 0: + ans += 1 + g //= 2 + + print(ans) +" +p03723,s389531614,Wrong Answer,"A, B, C = map(int, input().split()) +ans = 0 +if A == B and B == C: + print(-1) +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + ans += 1 + A, B, C = B//2+C//2, A//2+C//2, A//2+B//2 + print(ans) " +p03723,s542025926,Wrong Answer,"a,b,c=map(int,input().split()) +e=a-b|b-c +print((e^b&1)*(e^e-1).bit_length()-1)" +p03723,s675313192,Wrong Answer,"a,b,c=map(int,input().split()) + +if a%2==1 or b%2==1 or c%2==1: + print(0) + exit() +if a==b==c: + print(-1) + exit() +cnt=0 +while a%2==0 and b%2==0 and c%2==0: + a=(b+c)//2 + b=(c+a)//2 + c=(a+b)//2 + cnt+=1 +print(cnt)" +p03723,s587676960,Wrong Answer,"a, b, c = map(int,input().split()) +ans = 0 +if a == b == c: + if a%2 == 0: + print(-1) #無限 + else: + print(ans) #1回もできない + +while True: + ans += 1 + x = b//2 + c//2 + y = a//2 + c//2 + z = a//2 + b//2 + if x%2 == 1 or y%2 == 1 or z%2 == 1: + break + +print(ans) +" +p03723,s134259760,Wrong Answer,"a, b, c = map(int, input().split()) + +if a==b==c: + print(-1) + exit() + +i = 0 +a_, b_, c_ = a, b, c + +while a%2 == 0 and b%2 == 0 and c%2 == 0: + i += 1 + a = b_//2 + c_//2 + b = a_//2 + c_//2 + c = a_//2 + b_//2 + a_, b_, c_ = a, b, c + +print(i)" +p03723,s070978329,Wrong Answer,"A,B,C = map(int, input().split()) +ctr = 0 +if A == B == C: + print(-1) +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + A,B,C = int((B+C)/2), int((A+C)/2), int((A+B)/2) + ctr += 1 + print(ctr)" +p03723,s473015877,Wrong Answer,"a,b,c = map(int,input().split()) +ans = 0 +while True: + ans+=1 + na = (b+c)//2 + nb = (c+a)//2 + nc = (a+b)//2 + if na == a and nb == b and nc == c: + ans = -1 + break + if na%2 == 1 or nb%2 == 1 or nc%2 == 1: + break + a,b,c, = na,nb,nc +print(ans) +" +p03723,s489891907,Wrong Answer,"import sys + +A, B, C = map(int, input().split()) + +count = 0 +while True: + a = (A+B)//2 + b = (C+A)//2 + c = (A+B)//2 + count += 1 + if a == b and b == c and a % 2 == 0 and b % 2 == 0 and c % 2 == 0: + print('-1') + sys.exit() + if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: + break + A = a + B = b + C = c + +print(count)" +p03723,s632733717,Wrong Answer,"def resolve(): + A,B,C = map(int,input().split()) + count = 0 + if A + B == 2*C and A + C == 2*B: + print(-1) + else: + while (A % 2 == 0 and B % 2 == 0 and C % 2 == 0): + tmpA = (B + C) / 2 + tmpB = (A + C) / 2 + tmpC = (A + B) / 2 + A = tmpA + B = tmpB + C = tmpC + count = count + 1 + print(count) +resolve()" +p03723,s946214782,Wrong Answer,"A, B, C = [int(a) for a in input().split()] + +count = 0 + +if A==B and B==C: + print(-1) + exit() + +while 1: + if A%2==0 and B%2==0 and C%2==0: + A_tmp = B//2 + C//2 + B_tmp = A//2 + C//2 + C_tmp = A//2 + B//2 + A, B, C = A_tmp, B_tmp, C_tmp + count += 1 + else: + break +print(count)" +p03723,s527161598,Wrong Answer,"a,b,c=map(int,input().split()) + +ans=0 +if a==b==c: + print(-1) +else: + while a%2==0 and b%2==0 and c%2==0: + num_a,num_b,num_c=a/2,b/2,c/2 + a=num_b+num_c + b=num_a+num_c + c=num_a+num_b + ans+=1 + +print(ans)" +p03723,s424394547,Wrong Answer,"import numpy as np +import sys + +input = sys.stdin.readline + +A,B,C = map(int,input().split()) + +ans = 0 + +if A == B and B == C: + ans = -1 +else: + while A%2 == 0 and B%2 == 0 and C%2 == 0: + next_a = C/2 + B/2 + next_b = A/2 + C/2 + next_c = A/2 + B/2 + A = next_a + B = next_b + C = next_c + ans += 1 + + +print(ans) +" +p03723,s357843486,Wrong Answer,"A,B,C = map(int,input().split()) +count = 0 +while A%2 == 0 and B%2 == 0 and C%2 == 0 and count < 10**5: + A_copy = A + B_copy = B + A = (B+C)/2 + B =(A_copy+C)/2 + C = (A_copy+B_copy)/2 + count += 1 +print(count)" +p03723,s306047928,Wrong Answer,"A,B,C=map(int,input().split()) +if A==B and B==C: + print(-1) +else: + ans=0 + flag=0 + d=0 + while flag==0: + if (A>>d &1)==(B>>d &1) and (C>>d &1)==(B>>d &1): + d+=1 + else: + ans=d + break + print(ans)"