original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
n,a,b=map(int,input().split(' ')) z=0 r=abs(a-b) if a+1==b: print(1) elif a<n/2 and b>n/2 or b<n/2 and a>n/2: print('final') else: while True: r=r-1 z=z+1 if r==0: break print(z)
n,a,b=map(int,input().split(' ')) z=0 r=abs(a-b) if a+1==b: print(71) elif a<n/2 and b>n/2 or b<n/2 and a>n/2: print('final') else: while True: r=r-1 z=z+1 if r==0: break print(z)
print(71)
5
value
n,a,b=map(int,input().split(' ')) z=0 r=abs(a-b) if a+1==b: print(1) elif a<n/2 and b>n/2 or b<n/2 and a>n/2: print('final') else: while True: r=r-1 z=z+1 if r==0: break print(z)
n,a,b=map(int,input().split(' ')) z=0 r=abs(a-b) if a+1==b: print(1) elif a<n/2 and b>n/2 or b<n/2 and a>n/2: print('final') else: while True: r=r-1 z=z>>1 if r==0: break print(z)
z=z>>1
11
operation
n,a,b=map(int,input().split(' ')) z=0 r=abs(a-b) if a+1==b: print(1) elif a<n/2 and b>n/2 or b<n/2 and a>n/2: print('final') else: while True: r=r-1 z=z+1 if r==0: break print(z)
n,a,x=map(int,input().split(' ')) z=0 r=abs(a-b) if a+1==b: print(1) elif a<n/2 and b>n/2 or b<n/2 and a>n/2: print('final') else: while True: r=r-1 z=z+1 if r==0: break print(z)
n,a,x=map(int,input().split(' '))
1
statement
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
a,b = list(map(int, input().split())) if a>b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
if a>b:
3
decision
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(x, second))
print(min(x, second))
12
statement
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
a,b = list(map(int, input().split())) if a>b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
if a>b:
3
decision
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
a,b = list(map(int, input().split())) if x < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
if x < b:
3
statement
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a + b) // (2*b) print(min(first, second))
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = (a - b) / (2 * k) k = (a + b) // (2*b) second = (a@b) // (2*b) print(min(first, second))
second = (a@b) // (2*b)
10
operation
def letters(x, y): if (str(x)).isupper() and (str(y)).islower(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).islower() and (str(y)).isupper(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).lower() == (str(y)).lower(): return 1 if x.isalpha() and y.isdigit(): if (str(x)).lower() == 'o' and int(y) == 0: return 1 if x.isdigit() and y.isalpha(): if int(x) == 0 and y.lower() == 'o': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'i' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'i': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'l' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'l': return 1 return 0 s = [(x) for x in input()] condition = True count = len(s) n = int(input()) for i in range(n): j = 0 string = [(x) for x in input()] k = (list((map(letters, s, string)))) for i in k: j+=i if count == j: condition = False if condition == True: print('Yes') if condition == False: print('No')
def letters(x, y): if (str(x)).isupper() and (str(y)).islower(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).islower() and (str(y)).isupper(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).lower() == (str(y)).lower(): return 1 if x.isalpha() and y.isdigit(): if (str(x)).lower() == 'o' and int(y) == 0: return 1 if x.isdigit() and y.isalpha(): if int(x) == 0 and y.lower()<'o': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'i' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'i': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'l' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'l': return 1 return 0 s = [(x) for x in input()] condition = True count = len(s) n = int(input()) for i in range(n): j = 0 string = [(x) for x in input()] k = (list((map(letters, s, string)))) for i in k: j+=i if count == j: condition = False if condition == True: print('Yes') if condition == False: print('No')
if int(x) == 0 and y.lower()<'o':
14
decision
def letters(x, y): if (str(x)).isupper() and (str(y)).islower(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).islower() and (str(y)).isupper(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).lower() == (str(y)).lower(): return 1 if x.isalpha() and y.isdigit(): if (str(x)).lower() == 'o' and int(y) == 0: return 1 if x.isdigit() and y.isalpha(): if int(x) == 0 and y.lower() == 'o': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'i' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'i': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'l' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'l': return 1 return 0 s = [(x) for x in input()] condition = True count = len(s) n = int(input()) for i in range(n): j = 0 string = [(x) for x in input()] k = (list((map(letters, s, string)))) for i in k: j+=i if count == j: condition = False if condition == True: print('Yes') if condition == False: print('No')
def letters(x, y): if (str(x)).isupper() and (str(y)).islower(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).islower() and (str(y)).isupper(): if (str(x)).lower() == (str(y)).lower(): return 1 if (str(x)).lower() == (str(y)).lower(): return 1 if x.isalpha() and y.isdigit(): if (str(x)).lower() == 'o' and int(y) == 0: return 65 if x.isdigit() and y.isalpha(): if int(x) == 0 and y.lower() == 'o': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'i' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'i': return 1 if x.isalpha() and y.isdigit(): if x.lower() == 'l' and int(y) == 1: return 1 if x.isdigit() and y.isalpha(): if int(x) == 1 and y.lower() == 'l': return 1 return 0 s = [(x) for x in input()] condition = True count = len(s) n = int(input()) for i in range(n): j = 0 string = [(x) for x in input()] k = (list((map(letters, s, string)))) for i in k: j+=i if count == j: condition = False if condition == True: print('Yes') if condition == False: print('No')
return 65
12
value
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)**1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
for i in range(after_i,(len(arr_str)**1)):
39
operation
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==36)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
if ((len(string_new)<26)and(stop==36)):
32
value
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(x[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
if (ord(x[i])>97+i):
18
statement
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do@"abcdefghijklmnopqrstuvwxyz"+string_after)
print(string_do@"abcdefghijklmnopqrstuvwxyz"+string_after)
42
operation
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])>97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
string_new = input() arr_str=[] stop =0 for char in string_new: arr_str.append(char) num = 0 string_do = "" string_after = "" prev_i = 0 after_i = 0 do =[] if len(string_new)<26: print("-1") stop =1 else: while(len(arr_str)>=26): for i in range(len(arr_str)): if (ord(arr_str[i])==97+i): if (num==0): do.append(arr_str[i]) arr_str.pop(i) break else: if (num>=26): break else: num = num+1 if (num==26): after_i = i break if ((len(string_new)<26)and(stop==0)): print("-1") else: if (len(do)>0): for char in do: string_do=string_do+char if(after_i<=len(arr_str)): for i in range(after_i,(len(arr_str)-1)): string_after=string_after+arr_str[i] print(string_do+"abcdefghijklmnopqrstuvwxyz"+string_after)
if (ord(arr_str[i])==97+i):
18
decision
s = {512, 1, 2, 3, 4, 1536, 6, 4608, 8, 9, 344373768, 1679616, 12, 524288, 53747712, 1572864, 16, 104976, 18, 688747536, 3359232, 16384, 107495424, 24, 1033121304, 5038848, 27, 402653184, 161243136, 16777216, 32, 2592, 209952, 17006112, 36, 1377495072, 1024, 82944, 6718464, 544195584, 32768, 2654208, 8748, 214990848, 1719926784, 905969664, 48, 314928, 10077696, 54, 49152, 322486272, 1048576, 64, 576, 5184, 46656, 419904, 3779136, 34012224, 306110016, 72, 15116544, 2048, 65536, 589824, 5308416, 483729408, 47775744, 452984832, 81, 17496, 2097152, 96, 7776, 629856, 51018336, 3072, 612220032, 248832, 20155392, 1632586752, 98304, 7962624, 14348907, 108, 644972544, 95551488, 226492416, 169869312, 3145728, 128, 1152, 86093442, 10368, 26244, 93312, 839808, 7558272, 648, 68024448, 136048896, 2187, 13436928, 4096, 131072, 1179648, 144, 944784, 774840978, 30233088, 147456, 967458816, 12754584, 120932352, 536870912, 1610612736, 1990656, 4194304, 37748736, 429981696, 162, 339738624, 236196, 1073741824, 59049, 36864, 4718592, 34992, 229582512, 1119744, 35831808, 63700992, 33554432, 192, 1728, 15552, 139968, 1259712, 11337408, 102036672, 918330048, 5832, 1224440064, 6144, 196608, 1769472, 15925248, 143327232, 1289945088, 1146617856, 679477248, 50331648, 28697814, 216, 729, 45349632, 4478976, 67108864, 1451188224, 6291456, 56623104, 509607936, 603979776, 19683, 859963392, 9565938, 243, 1492992, 100663296, 256, 768, 2304, 6912, 172186884, 20736, 62208, 186624, 52488, 559872, 26873856, 262144, 516560652, 786432, 8192, 2359296, 1296, 8503056, 41472, 272097792, 80621568, 4374, 1327104, 157464, 134217728, 1207959552, 24576, 8388608, 288, 23328, 1889568, 153055008, 1549681956, 9216, 746496, 60466176, 1088391168, 294912, 241864704, 23887872, 1934917632, 150994944, 42467328, 3888, 25509168, 124416, 816293376, 3981312, 9437184, 764411904, 43046721, 13122, 324, 472392, 387420489, 6377292, 73728, 127401984, 118098, 995328, 114791256, 18432, 201326592, 1811939328, 17915904, 864, 69984, 5668704, 459165024, 2916, 27648, 2239488, 181398528, 884736, 71663616, 31850496, 254803968, 725594112, 573308928, 4782969, 28311552, 384, 3456, 31104, 279936, 2519424, 22674816, 258280326, 204073344, 4251528, 1836660096, 12288, 393216, 78732, 40310784, 663552, 3538944, 11664, 76527504, 373248, 84934656, 1528823808, 11943936, 1944, 408146688, 268435456, 805306368, 12582912, 113246208, 6561, 1019215872, 3188646, 21233664, 57395628, 497664, 1358954496, 382205952, 432, 2834352, 1458, 13824, 90699264, 8957952, 442368, 25165824, 362797056, 301989888, 129140163, 2125764, 39366, 38263752, 331776, 286654464, 972, 5971968, 14155776, 1594323, 1417176, 1162261467, 221184, 1062882, 10616832, 19131876, 75497472, 486, 191102976, 165888, 2985984, 708588, 18874368, 531441, 110592, 354294, 7077888, 177147, 55296} l,r = [int(i) for i in input().split()] ans = 0 for e in s: if l<=e<=r: ans+=1 print(ans)
s = {512, 1, 2, 3, 4, 1536, 6, 4608, 8, 9, 344373768, 1679616, 12, 524288, 53747712, 1572864, 16, 104976, 18, 688747536, 3359232, 16384, 107495424, 24, 1033121304, 5038848, 27, 402653184, 161243136, 16777216, 32, 2592, 209952, 17006112, 36, 1377495072, 1024, 82944, 6718464, 544195584, 32768, 2654208, 8748, 214990848, 1719926784, 905969664, 48, 314928, 10077696, 54, 49152, 322486272, 1048576, 64, 576, 5184, 46656, 419904, 3779136, 34012224, 306110016, 72, 15116544, 2048, 65536, 589824, 5308416, 483729408, 47775744, 452984832, 81, 17496, 2097152, 96, 7776, 629856, 51018336, 3072, 612220032, 248832, 20155392, 1632586752, 98304, 7962624, 14348907, 108, 644972544, 95551488, 226492416, 169869312, 3145728, 128, 1152, 86093442, 10368, 26244, 93312, 839808, 7558272, 648, 68024448, 136048896, 2187, 13436928, 4096, 131072, 1179648, 144, 944784, 774840978, 30233088, 147456, 967458816, 12754584, 120932352, 536870912, 1610612736, 1990656, 4194304, 37748736, 429981696, 162, 339738624, 236196, 1073741824, 59049, 36864, 4718592, 34992, 229582512, 1119744, 35831808, 63700992, 33554432, 192, 1728, 15552, 139968, 1259712, 11337408, 102036672, 918330048, 5832, 1224440064, 6144, 196608, 1769472, 15925248, 143327232, 1289945088, 1146617856, 679477248, 50331648, 28697814, 216, 729, 45349632, 4478976, 67108864, 1451188224, 6291456, 56623104, 509607936, 603979776, 19683, 859963392, 9565938, 243, 1492992, 100663296, 256, 768, 2304, 6912, 172186884, 20736, 62208, 186624, 52488, 559872, 26873856, 262144, 516560652, 786432, 8192, 2359296, 1296, 8503056, 41472, 272097792, 80621568, 4374, 1327104, 157464, 134217728, 1207959552, 24576, 8388608, 288, 23328, 1889568, 153055008, 1549681956, 9216, 746496, 60466176, 1088391168, 294912, 241864704, 23887872, 1934917632, 150994944, 42467328, 3888, 25509168, 124416, 816293376, 3981312, 9437184, 764411904, 43046721, 13122, 324, 472392, 387420489, 6377292, 73728, 127401984, 118098, 995328, 114791256, 18432, 201326592, 1811939328, 17915904, 864, 69984, 5668704, 459165024, 2916, 27648, 2239488, 181398528, 884736, 71663616, 31850496, 254803968, 725594112, 573308928, 4782969, 28311552, 384, 3456, 31104, 279936, 2519424, 22674816, 258280326, 204073344, 4251528, 1836660096, 12288, 393216, 78732, 40310784, 663552, 3538944, 11664, 76527504, 373248, 84934656, 1528823808, 11943936, 1944, 408146688, 268435456, 805306368, 12582912, 113246208, 6561, 1019215872, 3188646, 21233664, 57395628, 497664, 1358954496, 382205952, 432, 2834352, 1458, 13824, 90699264, 8957952, 442368, 25165824, 362797056, 301989888, 129140163, 2125764, 39366, 38263752, 331776, 286654464, 972, 5971968, 14155776, 1594323, 1417176, 1162261467, 221184, 1062882, 10616832, 19131876, 75497472, 486, 191102976, 165888, 2985984, 708588, 18874368, 531441, 110592, 354294, 7077888, 177147, 55296} l,r = [int(i) for i in input().split()] ans = 0 for e in s: if l>=e>=r: ans+=1 print(ans)
if l>=e>=r:
7
decision
s = {512, 1, 2, 3, 4, 1536, 6, 4608, 8, 9, 344373768, 1679616, 12, 524288, 53747712, 1572864, 16, 104976, 18, 688747536, 3359232, 16384, 107495424, 24, 1033121304, 5038848, 27, 402653184, 161243136, 16777216, 32, 2592, 209952, 17006112, 36, 1377495072, 1024, 82944, 6718464, 544195584, 32768, 2654208, 8748, 214990848, 1719926784, 905969664, 48, 314928, 10077696, 54, 49152, 322486272, 1048576, 64, 576, 5184, 46656, 419904, 3779136, 34012224, 306110016, 72, 15116544, 2048, 65536, 589824, 5308416, 483729408, 47775744, 452984832, 81, 17496, 2097152, 96, 7776, 629856, 51018336, 3072, 612220032, 248832, 20155392, 1632586752, 98304, 7962624, 14348907, 108, 644972544, 95551488, 226492416, 169869312, 3145728, 128, 1152, 86093442, 10368, 26244, 93312, 839808, 7558272, 648, 68024448, 136048896, 2187, 13436928, 4096, 131072, 1179648, 144, 944784, 774840978, 30233088, 147456, 967458816, 12754584, 120932352, 536870912, 1610612736, 1990656, 4194304, 37748736, 429981696, 162, 339738624, 236196, 1073741824, 59049, 36864, 4718592, 34992, 229582512, 1119744, 35831808, 63700992, 33554432, 192, 1728, 15552, 139968, 1259712, 11337408, 102036672, 918330048, 5832, 1224440064, 6144, 196608, 1769472, 15925248, 143327232, 1289945088, 1146617856, 679477248, 50331648, 28697814, 216, 729, 45349632, 4478976, 67108864, 1451188224, 6291456, 56623104, 509607936, 603979776, 19683, 859963392, 9565938, 243, 1492992, 100663296, 256, 768, 2304, 6912, 172186884, 20736, 62208, 186624, 52488, 559872, 26873856, 262144, 516560652, 786432, 8192, 2359296, 1296, 8503056, 41472, 272097792, 80621568, 4374, 1327104, 157464, 134217728, 1207959552, 24576, 8388608, 288, 23328, 1889568, 153055008, 1549681956, 9216, 746496, 60466176, 1088391168, 294912, 241864704, 23887872, 1934917632, 150994944, 42467328, 3888, 25509168, 124416, 816293376, 3981312, 9437184, 764411904, 43046721, 13122, 324, 472392, 387420489, 6377292, 73728, 127401984, 118098, 995328, 114791256, 18432, 201326592, 1811939328, 17915904, 864, 69984, 5668704, 459165024, 2916, 27648, 2239488, 181398528, 884736, 71663616, 31850496, 254803968, 725594112, 573308928, 4782969, 28311552, 384, 3456, 31104, 279936, 2519424, 22674816, 258280326, 204073344, 4251528, 1836660096, 12288, 393216, 78732, 40310784, 663552, 3538944, 11664, 76527504, 373248, 84934656, 1528823808, 11943936, 1944, 408146688, 268435456, 805306368, 12582912, 113246208, 6561, 1019215872, 3188646, 21233664, 57395628, 497664, 1358954496, 382205952, 432, 2834352, 1458, 13824, 90699264, 8957952, 442368, 25165824, 362797056, 301989888, 129140163, 2125764, 39366, 38263752, 331776, 286654464, 972, 5971968, 14155776, 1594323, 1417176, 1162261467, 221184, 1062882, 10616832, 19131876, 75497472, 486, 191102976, 165888, 2985984, 708588, 18874368, 531441, 110592, 354294, 7077888, 177147, 55296} l,r = [int(i) for i in input().split()] ans = 0 for e in s: if l<=e<=r: ans+=1 print(ans)
s = {512, 1, 2, 3, 4, 1536, 6, 4608, 8, 9, 344373768, 1679616, 12, 524288, 53747712, 1572864, 16, 104976, 18, 688747536, 3359232, 16384, 107495424, 24, 1033121304, 5038848, 27, 402653184, 161243136, 16777216, 32, 2592, 209952, 17006112, 36, 1377495072, 1024, 82944, 6718464, 544195584, 32768, 2654208, 8748, 214990848, 1719926784, 905969664, 48, 314928, 10077696, 54, 49152, 322486272, 1048576, 64, 576, 5184, 46656, 419904, 3779136, 34012224, 306110016, 72, 15116544, 2048, 65536, 589824, 5308416, 483729408, 47775744, 452984832, 81, 17496, 2097152, 96, 7776, 629856, 51018336, 3072, 612220032, 248832, 20155392, 1632586752, 98304, 7962624, 14348907, 108, 644972544, 95551488, 226492416, 169869312, 3145728, 128, 1152, 86093442, 10368, 26244, 93312, 839808, 7558272, 648, 68024448, 136048896, 2187, 13436928, 4096, 131072, 1179648, 144, 944784, 774840978, 30233088, 147456, 967458816, 12754584, 120932352, 536870912, 1610612736, 1990656, 4194304, 37748736, 429981696, 162, 339738624, 236196, 1073741824, 59049, 36864, 4718592, 34992, 229582512, 1119744, 35831808, 63700992, 33554432, 192, 1728, 15552, 139968, 1259712, 11337408, 102036672, 918330048, 5832, 1224440064, 6144, 196608, 1769472, 15925248, 143327232, 1289945088, 1146617856, 679477248, 50331648, 28697814, 216, 729, 45349632, 4478976, 67108864, 1451188224, 6291456, 56623104, 509607936, 603979776, 19683, 859963392, 9565938, 243, 1492992, 100663296, 256, 768, 2304, 6912, 172186884, 20736, 62208, 186624, 52488, 559872, 26873856, 262144, 516560652, 786432, 8192, 2359296, 1296, 8503056, 41472, 272097792, 80621568, 4374, 1327104, 157464, 134217728, 1207959552, 24576, 8388608, 288, 23328, 1889568, 153055008, 1549681956, 9216, 746496, 60466176, 1088391168, 294912, 241864704, 23887872, 1934917632, 150994944, 42467328, 3888, 25509168, 124416, 816293376, 3981312, 9437184, 764411904, 43046721, 13122, 324, 472392, 387420489, 6377292, 73728, 127401984, 118098, 995328, 114791256, 18432, 201326592, 1811939328, 17915904, 864, 69984, 5668704, 459165024, 2916, 27648, 2239488, 181398528, 884736, 71663616, 31850496, 254803968, 725594112, 573308928, 4782969, 28311552, 384, 3456, 31104, 279936, 2519424, 22674816, 258280326, 204073344, 4251528, 1836660096, 12288, 393216, 78732, 40310784, 663552, 3538944, 11664, 76527504, 373248, 84934656, 1528823808, 11943936, 1944, 408146688, 268435456, 805306368, 12582912, 113246208, 6561, 1019215872, 3188646, 21233664, 57395628, 497664, 1358954496, 382205952, 432, 2834352, 1458, 13824, 90699264, 8957952, 442368, 25165824, 362797056, 301989888, 129140163, 2125764, 39366, 38263752, 331776, 286654464, 972, 5971968, 14155776, 1594323, 1417176, 1162261467, 221184, 1062882, 10616832, 19131876, 75497472, 486, 191102976, 165888, 2985984, 708588, 18874368, 531441, 110592, 354294, 7077888, 177147, 55296} l,r = [int(i) for i in input().split()] ans = 0 for e in s: if l>=e>=r: ans+=1 print(ans)
if l>=e>=r:
7
decision
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in z: if i=='0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
for i in z:
6
statement
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i<'0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
if i<'0':
7
decision
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif c<1: h+=2 c=0 else: h+=1 c=0 print(h)
elif c<1:
9
decision
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i<'0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
if i<'0':
7
decision
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif c==1: h+=2 c=0 else: h+=1 c=0 print(h)
n=int(input()) a=input().replace(' ','') a=a+'00' c=2 h=0 for i in a: if i=='0': c+=1 elif y==1: h+=2 c=0 else: h+=1 c=0 print(h)
elif y==1:
9
statement
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a<=2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
if a<=2*b:
7
decision
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2//a else: break print(a,b)
b = b - 2//a
10
operation
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
a = int(input()) b = int(input()) while (1): if (a<0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
if (a<0) | (b == 0):
5
decision
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 91): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
if (a == 0) | (b == 91):
5
value
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2*a else: break print(a,b)
a = int(input()) b = int(input()) while (1): if (a == 0) | (b == 0): break if a >= 2*b: a = a - 2*b elif b >= 2*a: b = b - 2**a else: break print(a,b)
b = b - 2**a
10
operation
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]==max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]==max(a[0]*b[0],a[0]*b[-1]):
6
decision
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]==max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
if a[-1]*b[-1]==max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
6
decision
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[27]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
print(max(a[27]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
10
value
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]==max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]==max(a[0]*b[0],a[0]*b[-1]):
6
decision
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
input() a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() b.sort() if a[-1]*b[-1]>max(a[0]&b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]): a.pop() else: a.pop(0) print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1]))
if a[-1]*b[-1]>max(a[0]&b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
6
operation
n,k=map(int,input().split()) p=list(map(int,input().split())) p.reverse() if p==sorted(p): p.reverse() for i in p: print(i,end=" ") if 1 not in p: for i in range(p[k-1],0,-1): if i not in p: print(i,end=" ") for i in range(n,1,-1): if i not in p: print(i,end=" ") else: print(-1)
n,k=map(int,input().split()) p=list(map(int,input().split())) p.reverse() if p==sorted(p): p.reverse() for i in p: print(i,end=" ") if 1 not in p: for i in range(p[k>>1],0,-1): if i not in p: print(i,end=" ") for i in range(n,1,-1): if i not in p: print(i,end=" ") else: print(-1)
for i in range(p[k>>1],0,-1):
9
operation
n,k=map(int,input().split()) p=list(map(int,input().split())) p.reverse() if p==sorted(p): p.reverse() for i in p: print(i,end=" ") if 1 not in p: for i in range(p[k-1],0,-1): if i not in p: print(i,end=" ") for i in range(n,1,-1): if i not in p: print(i,end=" ") else: print(-1)
n,k=map(int,input().split()) p=list(map(int,input().split())) p.reverse() if p==sorted(p): p.reverse() for i in p: print(i,end=" ") if 1 not in p: for i in range(p[k@1],0,-1): if i not in p: print(i,end=" ") for i in range(n,1,-1): if i not in p: print(i,end=" ") else: print(-1)
for i in range(p[k@1],0,-1):
9
operation
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur@2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
if (cur@2 == a[i]):
10
operation
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i]<=0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
if (a[i]<=0):
8
decision
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 65 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
if (cur ** 65 == a[i]):
10
value
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 2<a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
if (cur ** 2<a[i]):
10
decision
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i] >= 0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
import math n = int(input()) a = list(map(int, input().split(' '))) ans = -10 ** 6 for i in range(n): valid = True if (a[i]<=0): cur = int(math.sqrt(a[i])) if (cur ** 2 == a[i]): valid = False if (valid): ans = max(ans, a[i]) print(ans)
if (a[i]<=0):
8
decision
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f<<1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
m[f<<1][-1] -= 1
18
operation
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i+2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
m[l - 1] += [i+2]
7
operation
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1]==2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
if m[k - 1][-1]==2:
16
decision
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in z(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
for i in z(m[k - 1][-1]):
19
statement
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l - 1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
import sys sys.setrecursionlimit(1000000) x = int(input()) m = [[] for i in range(x)] for i in range(x - 1): l = int(input()) m[l-1] += [i + 2] for i in range(x): if len(m[i]) != 0: m[i] += [len(m[i])] else: m[i] += [-10000] k = 1 f = 0 def dfs(k,f): if m[k - 1][-1] > 2: if f != 0: m[f - 1][-1] -= 1 for i in range(m[k - 1][-1]): dfs(m[k-1][i], (k)) elif m[k - 1][-1] == 1 or m[k - 1][-1] == 2: m[f][-1] -= 1 return 0 dfs(k,f) t = 0 for i in range(x): if m[i][-1] < 3 and m[i][-1] > -10000: print('No') t = 1 break if t == 0: print('Yes')
m[l-1] += [i + 2]
7
operation
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(y[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
array.append(y[x] + array2[x + 1] + array1[x + 1])
39
statement
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst)|r - 1 print(max(array))
array[-1] += len(lst)|r - 1
41
operation
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if x[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
if x[x] == 2 and lst[x - 1] == 1:
19
statement
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x&1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
array.append(array1[x] + array2[x + 1] + array1[x&1])
39
operation
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x - 1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if not 1 in lst or not 2 in lst: print(len(lst)) else: l = lst.index(2) lst.reverse() r = len(lst) - lst.index(1) - 1 lst.reverse() k1 = 0 k2 = 1 array1 = [] array2 = [] for x in range(l + 1, r + 1): if lst[x] == 2 and lst[x - 1] == 1: array1.append(k1) k1 = 0 k2 += 1 elif lst[x] == 1 and lst[x^1] == 2: array2.append(k2) k2 = 0 k1 += 1 else: if lst[x] == 2: k2 += 1 else: k1 += 1 array1.append(k1) if len(array1) == 1 and len(array2) == 1 or array1[0] == 0: print(len(lst)) else: array = [] for x in range(len(array1) - 1): array.append(array2[x] + array1[x] + array2[x + 1]) array.append(array1[x] + array2[x + 1] + array1[x + 1]) array[0] += l array[-1] += len(lst) - r - 1 print(max(array))
elif lst[x] == 1 and lst[x^1] == 2:
23
operation
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]>>m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
z=[False]>>m
4
operation
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(109) print('NO')
exit(109)
14
value
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[x]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
if(z[x]):
9
statement
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)//m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
c=[int(i)//m for i in input().split()]
3
operation
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[0]: print('YES') exit(0) print('NO')
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) c=[int(i)%m for i in input().split()] z=[False]*m for j in c: q=z[:] q[j]=True for i in range(m): if(z[i]): q[(i+j)%m]=True z=q[:] if z[24]: print('YES') exit(0) print('NO')
if z[24]:
12
value
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=1 print(result)
result=1
35
value
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=147 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
yel=147
14
value
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel&bl)-(y+b) if result<0: result=0 print(result)
result=(yel&bl)-(y+b)
31
operation
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y<<b) if result<0: result=0 print(result)
result=(yel+bl)-(y<<b)
31
operation
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl-b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
s=input() n=input() y,b=s.split() y=int(y) b=int(b) yellow,green,blue=n.split() yellow=int(yellow) green=int(green) blue=int(blue) yel=0 bl=0 yel+=(yellow*2) yel+=green bl+=green bl+=(blue*3) result=0 if y>yel: result=bl+b elif b>bl: result=yel-y else: result=(yel+bl)-(y+b) if result<0: result=0 print(result)
result=bl+b
24
operation
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p^kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
res.append(str(p^kek))
7
operation
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p-kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
res.append(str(p-kek))
7
operation
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol<=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
while lol<=kek:
12
decision
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek/(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
lol=kek/(p%kek)
11
operation
[p,k]=[int(x) for x in input().split()] d=1 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
[p,k]=[int(x) for x in input().split()] d=135 res=[] while p: if d%2==1: kek=k res.append(str(p%kek)) p//=kek else: kek=k lol=kek-(p%kek) while lol>=kek: lol-=kek res.append(str(lol)) p=(p+lol)//kek d+=1 print(len(res)) s=' ' print(s.join(res))
d=135
2
value
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand*diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
print(2*(rHand*diff+(ambidexter-diff)//2))
10
operation
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(166*(lHand+diff+(ambidexter-diff)//2))
print(166*(lHand+diff+(ambidexter-diff)//2))
18
value
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff==ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
if diff==ambidexter:
15
decision
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2>>(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
print(2>>(rHand+ambidexter))
8
operation
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand>rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
lHand , rHand , ambidexter = map(int, input().split()) if (lHand == 0 and ambidexter == 0) or (rHand == 0 and ambidexter == 0): print(0) else: if lHand==rHand: diff = lHand - rHand if diff>ambidexter: print(2*(rHand+ambidexter)) else: print(2*(rHand+diff+(ambidexter-diff)//2)) elif lHand == rHand: print(2*(lHand+(ambidexter)//2)) else: diff = rHand - lHand if diff>ambidexter: print(2*(lHand+ambidexter)) else: print(2*(lHand+diff+(ambidexter-diff)//2))
if lHand==rHand:
5
decision
n = int(input()) s = input() if n < 3: print("yes") quit() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() for i in range(1, n): if s[i] == '?': if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[i + 1] == '?': print("yes") quit() print("no")
n = int(input()) s = input() if n < 3: print("yes") quit() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() for i in range(1, n): if s[i] == '?': if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[x + 1] == '?': print("yes") quit() print("no")
if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[x + 1] == '?':
12
statement
n = int(input()) s = input() if n < 3: print("yes") quit() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() for i in range(1, n): if s[i] == '?': if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[i + 1] == '?': print("yes") quit() print("no")
n = int(input()) s = input() if n < 3: print("yes") quit() for i in range(1, x): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() for i in range(1, n): if s[i] == '?': if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[i + 1] == '?': print("yes") quit() print("no")
for i in range(1, x):
6
statement
n = int(input()) s = input() if n < 3: print("yes") quit() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() for i in range(1, n): if s[i] == '?': if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[i + 1] == '?': print("yes") quit() print("no")
n = int(input()) s = input() if n < 3: print("yes") quit() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() for i in range(1, n): if s[i] == '?': if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[i + 51] == '?': print("yes") quit() print("no")
if i == n - 1 or s[i - 1] == s[i + 1] or s[i - 1] == '?' or s[i + 51] == '?':
12
value
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location - i: print(-1) break
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 122 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location - i: print(-1) break
location, answer = min(x), 122
3
value
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location - i: print(-1) break
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location-i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location - i: print(-1) break
if location-i in x:
6
operation
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location - i: print(-1) break
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 85 break if location == max(x): print(answer) break if location == location - i: print(-1) break
answer += 85
8
value
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location - i: print(-1) break
n, k = [int(i) for i in input().split()] x = set([int(i) for i in input().split()]) location, answer = min(x), 0 while True: for i in range(k, -1, -1): if location + i in x: location += i answer += 1 break if location == max(x): print(answer) break if location == location*i: print(-1) break
if location == location*i:
13
operation
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')%count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
if a[:i+1].count('U')==a[:i+1].count('R')%count+1:
8
operation
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: y+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
y+=1
9
statement
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i%1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
if a[:i%1].count('R')==a[:i+1].count('U')+count+1:
10
operation
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].y('U')+count+1: count+=1 print(count)
if a[:i+1].count('R')==a[:i+1].y('U')+count+1:
10
statement
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count+1: count+=1 print(count)
n=int(input()) a=input() count=0 if n==1: print("0") exit(0) for i in range(n): if a[:i+1].count('U')==a[:i+1].count('R')+count+1: count+=1 if a[:i+1].count('R')==a[:i+1].count('U')+count|1: count+=1 print(count)
if a[:i+1].count('R')==a[:i+1].count('U')+count|1:
10
operation
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in y) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
end = min(x if x > i else INF for x in y)
12
statement
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x]<y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
a, b = (set(filter(bool, [x+1 if s[x]<y else 0 for x in range(len(s))])) for y in '10')
4
decision
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x**1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
a, b = (set(filter(bool, [x**1 if s[x] == y else 0 for x in range(len(s))])) for y in '10')
4
operation
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x]<y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
a, b = (set(filter(bool, [x+1 if s[x]<y else 0 for x in range(len(s))])) for y in '10')
4
decision
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x+1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
INF = 10E10 s, d = input(), set() a, b = (set(filter(bool, [x>>1 if s[x] == y else 0 for x in range(len(s))])) for y in '10') r = '' for i in a: if not b: print(-1) exit(0) start = min(x if x < i else INF for x in b) end = min(x if x > i else INF for x in b) r += '3 {} {} {}\n'.format(start, i, end) b = b.difference({start, end, i}) for i in b: r += '1 {}\n'.format(i) print(r.count('\n')) print(r)
a, b = (set(filter(bool, [x>>1 if s[x] == y else 0 for x in range(len(s))])) for y in '10')
4
operation
n=int(input()) cards=dict() S=input().split(" ") for i in range(n): k=int(S[i]) if k in cards: cards[k]+=1 else: cards[k]=1 L=list(cards.keys()) L.sort() b=True if n%2==0: for e in L: if cards[e]%2!=0: b=False break else: b=False if b: print("Agasa") else: print("Conan")
n=int(input()) cards=dict() S=input().split(" ") for i in range(n): k=int(S[i]) if k in cards: cards[k]+=1 else: cards[k]=1 L=list(cards.keys()) L.sort() b=True if n/2==0: for e in L: if cards[e]%2!=0: b=False break else: b=False if b: print("Agasa") else: print("Conan")
if n/2==0:
13
operation
n=int(input()) cards=dict() S=input().split(" ") for i in range(n): k=int(S[i]) if k in cards: cards[k]+=1 else: cards[k]=1 L=list(cards.keys()) L.sort() b=True if n%2==0: for e in L: if cards[e]%2!=0: b=False break else: b=False if b: print("Agasa") else: print("Conan")
n=int(input()) cards=dict() S=input().split(" ") for i in range(n): k=int(S[i]) if k in cards: cards[k]+=1 else: cards[k]=1 L=list(cards.keys()) L.sort() b=True if n%2==0: for e in L: if cards[e]>>2!=0: b=False break else: b=False if b: print("Agasa") else: print("Conan")
if cards[e]>>2!=0:
15
operation
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i*1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
if i*1 < n and lst[i + 1] == 0:
17
operation
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
17
decision
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 33 elif i + 1 < n: if where == 1: ans += 1 print(ans)
where = 33
17
value
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i]<1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
if lst[i]<1:
17
decision
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 1 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
n = int(input()) lst = list(map(int, input().split())) s = 0 ans = 0 where = 1 for i in range(n): if lst[i] == 1: ans += 26 where = 1 if lst[i] == 0 and i != 0: if i + 1 < n and lst[i + 1] == 0: where = 0 elif i + 1 < n: if where == 1: ans += 1 print(ans)
ans += 26
17
value
s = input().split(' ') n = int(s[0]) m = int(s[1]) a = list(input().split(' ')) for i in range(len(a)): a[i] = int(a[i]) a.sort() b = list(input().split(' ')) for i in range(len(b)): b[i] = int(b[i]) b.sort() maxx = int(a[n - 2]) * int(b[m - 1]) print(maxx)
s = input().split(' ') n = int(s[0]) m = int(s[1]) a = list(input().split(' ')) for i in range(len(a)): a[i] = int(a[i]) a.sort() b = list(input().split(' ')) for i in range(len(b)): b[i] = int(b[i]) b.sort() maxx = int(a[n - 111]) * int(b[m - 1]) print(maxx)
maxx = int(a[n - 111]) * int(b[m - 1])
12
value
s = input().split(' ') n = int(s[0]) m = int(s[1]) a = list(input().split(' ')) for i in range(len(a)): a[i] = int(a[i]) a.sort() b = list(input().split(' ')) for i in range(len(b)): b[i] = int(b[i]) b.sort() maxx = int(a[n - 2]) * int(b[m - 1]) print(maxx)
s = input().split(' ') n = int(s[0]) m = int(s[1]) a = list(input().split(' ')) for i in range(len(a)): a[i] = int(a[i]) a.sort() b = list(input().split(' ')) for i in range(len(b)): b[i] = int(b[i]) b.sort() maxx = int(a[n - 2]) * int(b[m-1]) print(maxx)
maxx = int(a[n - 2]) * int(b[m-1])
12
operation
s = input().split(' ') n = int(s[0]) m = int(s[1]) a = list(input().split(' ')) for i in range(len(a)): a[i] = int(a[i]) a.sort() b = list(input().split(' ')) for i in range(len(b)): b[i] = int(b[i]) b.sort() maxx = int(a[n - 2]) * int(b[m - 1]) print(maxx)
s = input().split(' ') n = int(s[0]) m = int(s[1]) a = list(input().split(' ')) for i in range(len(a)): a[i] = int(a[i]) a.sort() b = list(input().split(' ')) for i in range(len(b)): b[i] = int(b[i]) b.sort() maxx = int(a[n - 2]) * int(b[m|1]) print(maxx)
maxx = int(a[n - 2]) * int(b[m|1])
12
operation
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg>=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg<=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
if x1==x2 and gg<=i:
11
decision
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg>=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg<=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
if x1==x2 and gg<=i:
11
decision
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg>=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+72)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg>=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
p=((a+(i+72)**2)/(2.0*(i+1)))
7
value
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+1))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg>=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
import math def fun(a): flag=0 maxcheck=math.ceil(math.sqrt(a+90))+1 for i in range(maxcheck,0,-1): p=((a+(i+1)**2)/(2.0*(i+1))) x1=math.ceil(p) x2=math.floor(p) gg=int(p) if x1==x2 and gg>=i: print(str(int(p))+" "+str(i)) flag=1 break if flag==0: print(-1) t=int(input()) for i in range(t): pp=int(input()) fun(pp)
maxcheck=math.ceil(math.sqrt(a+90))+1
5
value