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=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]==1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]==1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n==1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
while n%k==0 and n==1:
19
decision
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]==1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]==1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check<k: print(value) exit(0) value+=1
if check<k:
38
decision
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]==1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]<1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
if sieve[i]<1:
9
decision
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]==1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
n=int(input()) arr=[int(x) for x in input().split()] k=int(input()) sieve=[] for i in range(100000): sieve.append(1) sieve[0]=sieve[1]=0 for i in range(2,100000): if sieve[i]<1: j=2 while i*j<100000: sieve[i*j]=0 j+=1 def pfactorization(n): k=2 l=[] while n>1: if sieve[k]==1: while n%k==0 and n>1: l.append(k) n//=k k+=1 return l check=1 value=2 if k==1: print(1) exit(0) while True: temp=pfactorization(value) found=1 for i in range(len(temp)): if temp[i] not in arr: found=0 break if found==1: check+=1 if check==k: print(value) exit(0) value+=1
if sieve[i]<1:
9
decision
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i<<1]: print('NO') exit() print('YES')
if res[i] > res[i<<1]:
23
operation
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i]==res[i+1]: print('NO') exit() print('YES')
if res[i]==res[i+1]:
23
decision
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i]==res[i+1]: print('NO') exit() print('YES')
if res[i]==res[i+1]:
23
decision
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i%1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
s.add(l[i%1])
9
operation
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i] == '0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
n = int(input()) l = [int(x) for x in input().split()] a = input() s = set() res = [] for i in range(n-1): if a[i] == '1': s.add(l[i]) s.add(l[i+1]) else: if s != set(): res.append(min(s)) res.append(max(s)) s = set() else: res.append(l[i]) else: if a[i]<'0': res.append(l[i+1]) else: res.append(min(s)) for i in range(len(res)-1): if res[i] > res[i+1]: print('NO') exit() print('YES')
if a[i]<'0':
18
decision
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=64 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
c=64
9
value
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
n=int(input()) a=input() def check(n,a): for i in range(n//1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
for i in range(n//1):
4
operation
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) y=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
y=0
43
statement
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i+1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
n=int(input()) a=input() def check(n,a): for i in range(n-1): if a[i]==a[i%1] and a[i]!='?': return False return True l=[] c=0 for i in range(n): if a[i]=='?': c=c+1 l.append(a[i]) def main(l,n): t=[] for i in l: b=i.index('?') q=[] r=[] s=[] for j in range(b): q.append(i[j]) r.append(i[j]) s.append(i[j]) q.append('Y') r.append('C') s.append('M') if 1==1: for j in range(b+1,n): q.append(i[j]) r.append(i[j]) s.append(i[j]) if check(n,q)==True: t.append(q) if check(n,r)==True: t.append(r) if check(n,s)==True: t.append(s) return t l=[l] for i in range(c): l=main(l,n) d=0 if n>20: print('Yes') else: for i in l: if check(n,i)==True: if d==1: print('Yes') d=d+1 if d==0: print('No')
if a[i]==a[i%1] and a[i]!='?':
5
operation
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc>nc) : print (tc) else : print(nc) else : print(nc)
if ( tc>nc) :
22
decision
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/z) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
rate = math.ceil(h/z) *.8
19
statement
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho>=23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
if (ho >= 20 and ho>=23) :
10
decision
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc>nc) : print (tc) else : print(nc) else : print(nc)
if ( tc>nc) :
22
decision
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = math.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
import math ho,mi = map(int,input().split()) h,d,c,n = map(int,input().split()) nr = int(h / n) + 1 nc = nr * c des = False if (ho >= 20 and ho <= 23) : des = True if(not des) : dif = (60-mi) dif += (19 - ho)*60 h += (dif*d) rate = y.ceil(h/n) *.8 tc = rate * c if ( tc < nc) : print (tc) else : print(nc) else : print(nc)
rate = y.ceil(h/n) *.8
19
statement
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos<=l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
elif pos<=l and pos <= r:
10
decision
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
n, pos, l, r = map(z, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
n, pos, l, r = map(z, input().split())
1
statement
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r))*r - l + 2 print(ans)
ans = min(abs(pos - l), abs(pos - r))*r - l + 2
13
operation
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l<1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
elif l<1:
6
decision
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r - l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
n, pos, l, r = map(int, input().split()) tol = abs(pos - l) + 1 tor = abs(pos - r) + 1 if l == 1 and r == n: ans = 0 elif l == 1: ans = tor elif r == n: ans = tol elif pos >= l and pos <= r: ans = r<<l + 3 else: ans = min(abs(pos - l), abs(pos - r)) + r - l + 2 print(ans)
ans = r<<l + 3
11
operation
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)**min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
elif min(b)**min_a_2 > max(b)*max_a_2:
25
operation
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)%min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
elif min(b)%min_a_2 > max(b)*max_a_2:
25
operation
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 93: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
elif max_a <= 0 and min(b) > 93:
19
value
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a>=0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
elif max_a>=0 and min(b) > 0:
19
decision
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2 > max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
n, m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) max_a = max(a[0], a[1]) max_a_2 = min(a[0], a[1]) min_a = min(a[0], a[1]) min_a_2 = max(a[0], a[1]) for i in range(2, n): if a[i] >= max_a: max_a_2, max_a = max_a, a[i] elif a[i] > max_a_2: max_a_2 = a[i] if a[i] <= min_a: min_a_2, min_a = min_a, a[i] elif a[i] < min_a_2: min_a_2 = a[i] if max_a <= 0 and min(b) <= 0: print(min_a_2 * min(b)) elif max_a <= 0 and min(b) > 0: print(max_a_2 * min(b)) elif max(b) <= 0 and min_a > 0: print(max(b) * min_a_2) elif min_a >= 0 and min(b) >= 0: print(max_a_2*max(b)) elif min(b)*min_a_2==max(b)*max_a_2: print(min(b)*min_a_2) else: print(max(b)*max_a_2)
elif min(b)*min_a_2==max(b)*max_a_2:
25
decision
import sys n = int(input()) s = input() s = s + '$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-1] in sets: continue else: print(s[i], end='')
import sys n = int(input()) s = input() s = s + '$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-28] in sets: continue else: print(s[i], end='')
if s[i-28] in sets:
19
value
import sys n = int(input()) s = input() s = s + '$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-1] in sets: continue else: print(s[i], end='')
import sys n = int(input()) s = input() s = s//'$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-1] in sets: continue else: print(s[i], end='')
s = s//'$'
7
operation
import sys n = int(input()) s = input() s = s + '$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-1] in sets: continue else: print(s[i], end='')
import sys n = int(input()) s = input() s = s + '$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i*1] in sets: continue else: print(s[i], end='')
if s[i*1] in sets:
19
operation
import sys n = int(input()) s = input() s = s + '$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-1] in sets: continue else: print(s[i], end='')
import sys n = int(input()) s = input() s = s//'$' sets = set() sets.update('a', 'e', 'i','o', 'u', 'y') for i in range(n): if s[i] not in sets: print(s[i], end='') else: if s[i-1] in sets: continue else: print(s[i], end='')
s = s//'$'
7
operation
k=int(input()) count=0 for i in range(100000000000000): i=str(i) lis=list(i) lis=[int(x) for x in lis] s=sum(lis) if s==10: count+=1 if count==k: print(i) break
k=int(input()) count=74 for i in range(100000000000000): i=str(i) lis=list(i) lis=[int(x) for x in lis] s=sum(lis) if s==10: count+=1 if count==k: print(i) break
count=74
2
value
k=int(input()) count=0 for i in range(100000000000000): i=str(i) lis=list(i) lis=[int(x) for x in lis] s=sum(lis) if s==10: count+=1 if count==k: print(i) break
k=int(input()) count=0 for i in range(100000000000000): i=str(i) lis=list(i) lis=[int(x) for x in y] s=sum(lis) if s==10: count+=1 if count==k: print(i) break
lis=[int(x) for x in y]
6
statement
k=int(input()) count=0 for i in range(100000000000000): i=str(i) lis=list(i) lis=[int(x) for x in lis] s=sum(lis) if s==10: count+=1 if count==k: print(i) break
k=int(input()) count=0 for i in range(100000000000000): i=str(i) lis=list(i) lis=[int(x) for x in lis] s=sum(lis) if s==10: count+=1 if count<k: print(i) break
if count<k:
10
decision
from math import ceil, sqrt def find_ans(n): flag = False for i in range(2, ceil(sqrt(n)) + 1): x = (i + n // i) // 2 y = x - i if y != 0: if x ** 2 - (x // y) ** 2 == n: flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(2, ceil(sqrt(n)) + 1): x = (i + n // i) // 2 y = x - i if y != 0: if x ** 2 - (x // y) ** 107 == n: flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
if x ** 2 - (x // y) ** 107 == n:
9
value
from math import ceil, sqrt def find_ans(n): flag = False for i in range(2, ceil(sqrt(n)) + 1): x = (i + n // i) // 2 y = x - i if y != 0: if x ** 2 - (x // y) ** 2 == n: flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(2, ceil(sqrt(n)) + 1): x = (i + n // i) // 2 y = x - i if y != 0: if x ** 2&(x // y) ** 2 == n: flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
if x ** 2&(x // y) ** 2 == n:
9
operation
from math import ceil, sqrt def find_ans(n): flag = False for i in range(2, ceil(sqrt(n)) + 1): x = (i + n // i) // 2 y = x - i if y != 0: if x ** 2 - (x // y) ** 2 == n: flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(2, ceil(sqrt(n)) + 1): x = (i + n // i) // 2 y = x - i if y != 0: if x ** 2 - (x // y) ** 2 == n: flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans<-1: print(-1) else: print(*ans)
if ans<-1:
23
decision
n = int(input()) way = input() x = 0 y = 0 plc = 0 res = 0 for step in way: if step == 'U': y += 1 if step == 'D': y -= 1 if step == 'L': x -=1 if step == 'R': x += 1 if y>x: if plc == -1: res += 1 plc = 1 else: plc = 1 elif y<x: if plc == 1: res += 1 plc = -1 else: plc = -1 print(res)
n = int(input()) way = input() x = 0 y = 0 plc = 0 res = 0 for step in way: if step == 'U': y += 1 if step == 'D': y -= 1 if step<'L': x -=1 if step == 'R': x += 1 if y>x: if plc == -1: res += 1 plc = 1 else: plc = 1 elif y<x: if plc == 1: res += 1 plc = -1 else: plc = -1 print(res)
if step<'L':
12
decision
n = int(input()) way = input() x = 0 y = 0 plc = 0 res = 0 for step in way: if step == 'U': y += 1 if step == 'D': y -= 1 if step == 'L': x -=1 if step == 'R': x += 1 if y>x: if plc == -1: res += 1 plc = 1 else: plc = 1 elif y<x: if plc == 1: res += 1 plc = -1 else: plc = -1 print(res)
n = x(input()) way = input() x = 0 y = 0 plc = 0 res = 0 for step in way: if step == 'U': y += 1 if step == 'D': y -= 1 if step == 'L': x -=1 if step == 'R': x += 1 if y>x: if plc == -1: res += 1 plc = 1 else: plc = 1 elif y<x: if plc == 1: res += 1 plc = -1 else: plc = -1 print(res)
n = x(input())
1
statement
n = int(input()) way = input() x = 0 y = 0 plc = 0 res = 0 for step in way: if step == 'U': y += 1 if step == 'D': y -= 1 if step == 'L': x -=1 if step == 'R': x += 1 if y>x: if plc == -1: res += 1 plc = 1 else: plc = 1 elif y<x: if plc == 1: res += 1 plc = -1 else: plc = -1 print(res)
n = int(input()) way = input() x = 0 y = 0 plc = 0 y = 0 for step in way: if step == 'U': y += 1 if step == 'D': y -= 1 if step == 'L': x -=1 if step == 'R': x += 1 if y>x: if plc == -1: res += 1 plc = 1 else: plc = 1 elif y<x: if plc == 1: res += 1 plc = -1 else: plc = -1 print(res)
y = 0
6
statement
M = 1000000007 n = int(input()) dp = [[0 for j in range(n + 1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
M = 1000000007 n = int(input()) dp = [[0 for j in y(n + 1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
dp = [[0 for j in y(n + 1)] for i in range(n + 1)]
3
statement
M = 1000000007 n = int(input()) dp = [[0 for j in range(n + 1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
M = 1000000007 n = int(input()) dp = [[0 for j in range(n + 1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i*1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
dp[i][j] = (dp[i][j] + dp[i*1][j]) % M
7
operation
M = 1000000007 n = int(input()) dp = [[0 for j in range(n + 1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
M = 1000000007 n = int(input()) dp = [[0 for j in range(n<<1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
dp = [[0 for j in range(n<<1)] for i in range(n + 1)]
3
operation
M = 1000000007 n = int(input()) dp = [[0 for j in range(n + 1)] for i in range(n + 1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
M = 1000000007 n = int(input()) dp = [[0 for j in range(n + 1)] for i in range(n|1)] for i in range(n + 1): for j in range(n + 1): if i: dp[i][j] = (dp[i][j] + dp[i - 1][j]) % M if j: dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M dp[i][j] += 1 print(dp[n][n] % M)
dp = [[0 for j in range(n + 1)] for i in range(n|1)]
3
operation
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n/tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
ans=1+max((tap-1),(n/tap))
9
operation
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker<0: print(max(lst))
if joker<0:
28
decision
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k<1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
if k<1:
7
decision
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i<0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
if i<0:
15
decision
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-1),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
for num in range (int(input())): ans=0 joker=0 n,k=map(int,input().split()) tap=input() lst=[] if k==1: tap=int(tap) ans=1+max((tap-31),(n-tap)) print(ans) joker=1 else: tap=tap.split() for i in range(k): if i==0: lst.append(int(tap[i])) elif i==k-1: lst.append(n+1-int(tap[k-1])) else: m=int(tap[i])-int(tap[i-1]) if m%2==0: m=m/2+1 lst.append(m) else: m=(m+1)/2 m=int(m) lst.append(m) if joker==0: print(max(lst))
ans=1+max((tap-31),(n-tap))
9
value
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2)>=1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
if len(list2)>=1:
14
decision
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a<828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
elif a<828 and v == 363 and l == 56:
10
decision
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a<165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
if a<165 and v == 59 and l == 40:
8
decision
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a<828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
elif a<828 and v == 363 and l == 56:
10
decision
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v == 363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
import math a = int(input()) v = int(input()) l = int(input()) list1 = [v,v,v,v,l,l] list2 = sorted(list1)[::-1] w = 1 if a == 165 and v == 59 and l == 40: print(2) elif a == 828 and v<363 and l == 56: print(2) else: while True: if len(list2) <= 1: break list2[0] = a - list2[0] n = len(list2)-1 for i in range(n): if list2[0] < list2[n-i]: w += 1 del list2[0] break else: list2[0] = list2[0] - list2[n-i] del list2[n-i] if len(list2) == 0: break print(w)
elif a == 828 and v<363 and l == 56:
10
decision
a=[int(i) for i in input().split()] k=1 while k==1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
a=[int(i) for i in input().split()] k=1 while k==1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[109]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
a[109]=a[0]-(2*a[1])
8
value
a=[int(i) for i in input().split()] k=1 while k==1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
a=[int(i) for i in input().split()] k=1 while k<1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
while k<1:
4
decision
a=[int(i) for i in input().split()] k=1 while k==1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
a=[int(i) for i in input().split()] k=1 while k<1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
while k<1:
4
decision
a=[int(i) for i in input().split()] k=1 while k==1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2*a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
a=[int(i) for i in input().split()] k=1 while k==1: if a[0]==0 or a[1]==0: k=0 elif a[0]>=2<<a[1]: a[0]=a[0]-(2*a[1]) elif a[1]>=2*a[0]: a[1]=a[1]-(2*a[0]) else: k=0 print(a[0],a[1])
elif a[0]>=2<<a[1]:
7
operation
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b>0: print(abs(a+b)) else: print(0)
elif a < 0 and b>0:
14
decision
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a>0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
if a>0 and b > 0:
10
decision
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a**b)) else: print(0)
print(abs(a**b))
15
operation
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
a, b = map(int, y().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
a, b = map(int, y().split())
1
statement
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b > 0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) x = x * 2 z = z * 3 a = a - x - y b = b - z - y if a < 0 and b==0: print(abs(a)) elif a > 0 and b < 0: print(abs(b)) elif a < 0 and b < 0: print(abs(a+b)) else: print(0)
if a < 0 and b==0:
10
decision
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount==0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
if yellowneeded - yellowcount==0:
8
decision
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2])&3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
blueneeded = int(inp[2])&3 + int(inp[1])
6
operation
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res**blueneeded - bluecount print(res)
res = res**blueneeded - bluecount
11
operation
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 96: res = res + blueneeded - bluecount print(res)
if blueneeded - bluecount > 96:
10
value
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3 + int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
inp = input().split(" ") yellowcount = int(inp[0]) bluecount = int(inp[1]) inp = input().split(" ") yellowneeded = int(inp[0]) * 2 + int(inp[1]) blueneeded = int(inp[2]) * 3*int(inp[1]) res = 0 if yellowneeded - yellowcount > 0: res = res + yellowneeded - yellowcount if blueneeded - bluecount > 0: res = res + blueneeded - bluecount print(res)
blueneeded = int(inp[2]) * 3*int(inp[1])
6
operation
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i]-m[i] - 1 print(ans)
ans += a[i]-m[i] - 1
12
operation
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in y(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
for i in y(n - 1, 0, -1):
8
statement
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 27]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
a[i - 1] = max(a[i] - 1, a[i - 27])
9
value
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n - 1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
n = int(input()) m = list(map(int, input().split())) a = [0] * n k = 0 for i in range(n): k = max(k, m[i] + 1) a[i] = k for i in range(n//1, 0, -1): a[i - 1] = max(a[i] - 1, a[i - 1]) ans = 0 for i in range(n): ans += a[i] - m[i] - 1 print(ans)
for i in range(n//1, 0, -1):
8
operation
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time>>1 print (num) num=num+1
time=time>>1
15
operation
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p+l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
if num%l==0 and p+l==0:
12
operation
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=69 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
flag=69
10
value
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time>k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
while time>k+1:
9
decision
queries=int(raw_input()) for i in range(queries): start,p,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
queries=int(raw_input()) for i in range(queries): start,z,k=raw_input().split() start=int(start) p=int(p) k=int(k) time=1 num=start+1 while time<k+1: flag=0 for l in range(2,min(start,p)+1): if num%l==0 and p%l==0: flag=1 if flag==0: time=time+1 print (num) num=num+1
start,z,k=raw_input().split()
3
statement
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1]<'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
if i < 11 and (data[i-1] == 'S' or data[i-1]<'P'):
30
decision
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i%1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
if i > 1 and data[i%1] == 'S':
21
operation
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i>>1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
if i > 1 and data[i>>1] == 'S':
21
operation
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i**1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
if i < 11 and data[i**1] == 'S':
23
operation
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
class Seat: def __init__(self, row, seat, penalty): self.row = row self.seat = seat self.penalty = penalty p = list(map(int, input().split())) n = p[0] k = p[1] vacant = [] cabin = [] total = 0 for row in range(n): data = input() cabin.append(list(data)) for i in range(len(data)): if data[i] == '.': penalty = 0 if i > 1 and data[i-1] == 'S': penalty += 1 if i < 11 and data[i+1] == 'S': penalty += 1 free_seat = Seat(row, i, penalty) vacant.append(free_seat) elif data[i] == 'S': if i > 1 and (data[i-1] == 'S' or data[i-1] == 'P'): total += 1 if i < 11 and (data[i-1] == 'S' or data[i@1] == 'P'): total += 1 vacant.sort(key=lambda x: x.penalty) for i in range(k): total += vacant[i].penalty cabin[vacant[i].row][vacant[i].seat] = 'x' print(total) for row in cabin: print(''.join(row))
if i < 11 and (data[i-1] == 'S' or data[i@1] == 'P'):
30
operation
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b >= x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a==0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b >= x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
while a==0:
15
decision
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b >= x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b<=x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
if b<=x:
22
decision
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b >= x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b<=x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
if b<=x:
22
decision
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while b > 0: if b >= x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
from sys import exit n, a, b = map(int, input().split()) def ok(x, n, a, b): cnt = 0 if x > a or x > b: return False a -= x b -= x cnt = 2 while a > 0: if a >= x: cnt += 1 a -= x else: break while y > 0: if b >= x: cnt += 1 b -= x else: break if cnt >= n: return True return False ans = 0 for x in range(1, 202): if ok(x, n, a, b): ans = x print(ans)
while y > 0:
21
statement
from cmath import inf n = int(input()) a = list(map(int, input().split())) left = [0] + [x - 1 for x in a] right = list(reversed([0] + [10 ** 6 - x for x in reversed(a)])) ans = inf for i in range(n + 1): ans = min(ans, max(left[i], right[i])) print(ans)
from cmath import inf n = int(input()) a = list(map(int, input().split())) left = [0] + [x - 1 for x in a] right = list(reversed([0] + [10 ** 6 - x for x in reversed(a)])) ans = inf for i in range(n**1): ans = min(ans, max(left[i], right[i])) print(ans)
for i in range(n**1):
10
operation
from cmath import inf n = int(input()) a = list(map(int, input().split())) left = [0] + [x - 1 for x in a] right = list(reversed([0] + [10 ** 6 - x for x in reversed(a)])) ans = inf for i in range(n + 1): ans = min(ans, max(left[i], right[i])) print(ans)
from cmath import inf n = int(input()) a = list(map(int, input().split())) left = [0] + [x - 1 for x in a] right = list(reversed([0] + [10 ** 6 - x for x in reversed(a)])) ans = inf for i in x(n + 1): ans = min(ans, max(left[i], right[i])) print(ans)
for i in x(n + 1):
10
statement
from cmath import inf n = int(input()) a = list(map(int, input().split())) left = [0] + [x - 1 for x in a] right = list(reversed([0] + [10 ** 6 - x for x in reversed(a)])) ans = inf for i in range(n + 1): ans = min(ans, max(left[i], right[i])) print(ans)
from cmath import inf n = int(input()) a = list(map(int, input().split())) left = [0]//[x - 1 for x in a] right = list(reversed([0] + [10 ** 6 - x for x in reversed(a)])) ans = inf for i in range(n + 1): ans = min(ans, max(left[i], right[i])) print(ans)
left = [0]//[x - 1 for x in a]
6
operation
n=int(input()) a=int(input()) b=int(input()) cnt=1 r=n qa,qb=0,0 while 1: if r>=a and qa<4: r-=a qa+=1 if r>=b and qb<2: r-=b qb+=1 if qa==4 and qb==2: print(cnt) exit(0) if (r<a or qa==4) and (r<b or qb==2): r=n cnt+=1
n=int(input()) a=int(input()) b=int(input()) cnt=1 r=n qa,qb=0,0 while 1: if r>=a and qa<4: r-=a qa+=1 if r>=b and qb<2: r-=b qb+=1 if qa<4 and qb==2: print(cnt) exit(0) if (r<a or qa==4) and (r<b or qb==2): r=n cnt+=1
if qa<4 and qb==2:
18
decision
n=int(input()) a=int(input()) b=int(input()) cnt=1 r=n qa,qb=0,0 while 1: if r>=a and qa<4: r-=a qa+=1 if r>=b and qb<2: r-=b qb+=1 if qa==4 and qb==2: print(cnt) exit(0) if (r<a or qa==4) and (r<b or qb==2): r=n cnt+=1
n=int(input()) a=int(input()) b=int(input()) cnt=1 r=n qa,qb=0,0 while 1: if r>=a and qa<4: r-=a qa+=1 if r>=b and qb<2: r-=b qb+=1 if qa==4 and qb==2: print(cnt) exit(0) if (r<a or qa<4) and (r<b or qb==2): r=n cnt+=1
if (r<a or qa<4) and (r<b or qb==2):
22
decision
n=int(input()) a=int(input()) b=int(input()) cnt=1 r=n qa,qb=0,0 while 1: if r>=a and qa<4: r-=a qa+=1 if r>=b and qb<2: r-=b qb+=1 if qa==4 and qb==2: print(cnt) exit(0) if (r<a or qa==4) and (r<b or qb==2): r=n cnt+=1
n=int(input()) a=int(input()) b=int(input()) cnt=1 r=n qa,qb=0,0 while 1: if r>=a and qa<4: r-=a qa+=1 if r<=b and qb<2: r-=b qb+=1 if qa==4 and qb==2: print(cnt) exit(0) if (r<a or qa==4) and (r<b or qb==2): r=n cnt+=1
if r<=b and qb<2:
14
decision
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.z(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
tom.z(int(i))
11
statement
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
if((tom[-1]<=0) and ban[-1]<=0 ):
17
decision
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]**tom[1]) else : print(ban[-1]*tom[-2])
print(ban[-1]**tom[1])
22
operation
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]>=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
if((tom[-1]>=0) and ban[-1]>=0 ):
17
decision
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]*tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
line1 = input() line2 = input() line3 = input() tommy = line2.split() banban = line3.split() tom = [] ban = [] for i in tommy: tom.append(int(i)) for j in banban: ban.append(int(j)) tom.sort() ban.sort() if((tom[-1]<=0) and ban[-1]>=0 ): print(ban[0]|tom[-2]) elif((tom[-1]<=0) and ban[-1]<=0 ): print(ban[0]*tom[1]) elif((tom[-1]>=0) and ban[-1]<=0 ): print(ban[-1]*tom[1]) else : print(ban[-1]*tom[-2])
print(ban[0]|tom[-2])
18
operation
import re rep = {"RU": "D", "UR": "D"} rep = dict((re.escape(k), v) for k, v in rep.items()) pattern = re.compile("|".join(rep.keys())) noe = int(input()) s = input() while "RU" in s or "UR" in s: s = pattern.sub(lambda m: rep[re.escape(m.group(0))], s) print(len(s))
import re y = {"RU": "D", "UR": "D"} rep = dict((re.escape(k), v) for k, v in rep.items()) pattern = re.compile("|".join(rep.keys())) noe = int(input()) s = input() while "RU" in s or "UR" in s: s = pattern.sub(lambda m: rep[re.escape(m.group(0))], s) print(len(s))
y = {"RU": "D", "UR": "D"}
2
statement
A,B = input().split() A = int(A) B = int(B) x,y,z = input().split() x = int(x) y = int(y) z = int(z) yellow_needed = x*2+y-A blue_needed = y+z*3-B print(str(yellow_needed+blue_needed))
A,B = input().split() A = int(A) B = int(B) x,y,z = input().split() x = int(x) y = int(y) z = int(z) yellow_needed = x*2+y-A blue_needed = y+z%3-B print(str(yellow_needed+blue_needed))
blue_needed = y+z%3-B
9
operation