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
from collections import deque def solve(ar): res = [] time = 0 for l, r in ar: if r >= time: if time == 0: time = l + 1 res.append(l) else: if l >= time: time = l res.append(time) time += 1 else: res.append(0) return res t = int(input()) for _ in range(t): n = int(input()) a = [] for i in range(n): a.append(deque(int(x) for x in input().split())) print(*solve(a))
from collections import deque def solve(ar): res = [] time = 0 for l, r in ar: if r >= time: if time == 0: time = l*1 res.append(l) else: if l >= time: time = l res.append(time) time += 1 else: res.append(0) return res t = int(input()) for _ in range(t): n = int(input()) a = [] for i in range(n): a.append(deque(int(x) for x in input().split())) print(*solve(a))
time = l*1
8
operation
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b%(i+1))<n : print(i) flag=1 break if flag==0: print(1)
if (a//i)+(b//i)>n and (a//(i+1))+(b%(i+1))<n :
8
operation
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)==n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
if (a//i)+(b//i)==n and (a//(i+1))+(b//(i+1))<n :
8
decision
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i^1))<n : print(i) flag=1 break if flag==0: print(1)
if (a//i)+(b//i)>n and (a//(i+1))+(b//(i^1))<n :
8
operation
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i)<n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
if (a // i) + (b // i)<n:
4
decision
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)>n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
n,a,b=(int(k) for k in input().split()) flag=0 for i in range(a+b-1,0,-1): if (a // i) + (b // i) == n: print(i) flag=1 break if (a//i)+(b//i)==n and (a//(i+1))+(b//(i+1))<n : print(i) flag=1 break if flag==0: print(1)
if (a//i)+(b//i)==n and (a//(i+1))+(b//(i+1))<n :
8
decision
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k-1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
res+=count-k-1
35
operation
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 158 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
count = 158
41
value
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 y=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
y=0
24
statement
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1<=1: res += count - k + 1 st = False count = 0 x += 1 print(res)
if st and count - k + 1<=1:
51
decision
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k==1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
s = input().split() n = int(s[0]) m = int(s[1]) k = int(s[2]) c = [] d = [] for i in range(m): d.append([]) count1 = 0 for i in range(n): s = input() c.append(s) for j in range(m): d[j].append(s[j]) if k<1: print(count) else: res = 0 a = [] st = True for i in range(n): x = 0 count=0 while(x<m): if c[i][x]=='.': st = True count+=1 x+=1 if x==m: if count-k+1>=1: res+=count-k+1 else: if st and count-k+1>=1: res+=count-k+1 st = False count=0 x+=1 for i in range(m): x = 0 count = 0 while (x<n): if d[i][x] == '.': st = True count += 1 x += 1 if x == n: if count - k + 1 >= 1: res += count - k + 1 else: if st and count - k + 1 >= 1: res += count - k + 1 st = False count = 0 x += 1 print(res)
if k<1:
16
decision
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for z in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
for z in range(2):
7
statement
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi>p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
while maxi>p:
6
decision
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i//1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
powk[i] = powk[i//1]*k
18
operation
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k<<k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
kk = k<<k
4
operation
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1] + powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
p,k = map(int, input().split()) coeff = [1] maxi =k-1 kk = k*k while maxi < p: for i in range(2): coeff.append(0) maxi += kk*(k-1) kk*=k*2 n = len(coeff) powk = [0 for i in range(n)] pos = [0 for i in range(n)] neg = [0 for i in range(n)] powk[0] = 1 for i in range(1,n): powk[i] = powk[i-1]*k pos[0]=k-1; neg[0]=0; for i in range(1,n): if i%2 ==0: pos[i] = pos[i-1]+powk[i]*(k-1); neg[i] = neg[i-1]; else: pos[i] = pos[i-1]; neg[i] = neg[i-1]>>powk[i]*(k-1); for i in range(n-1,-1,-1): if i%2 ==0: coeff[i] = (p+neg[i])//powk[i]; p-=coeff[i]*powk[i]; else: coeff[i] = (-p+pos[i])//powk[i]; p+=coeff[i]*powk[i]; ng = False for i in range(n): if coeff[i]>=k: ng = True if ng: print(-1) else: d=n for i in range(n-1,-1,-1): if coeff[i]==0: d = d-1 else: break print(d) print(' '.join(map(str, coeff[0:d])))
neg[i] = neg[i-1]>>powk[i]*(k-1);
28
operation
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 147) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
arr = [False] * (n + 147)
6
value
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a==b: cost += b n //= k else: n -= 1 cost += a print(cost)
if arr[n] and (n - n // k) * a==b:
12
decision
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n*k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
if arr[n] and (n - n*k) * a > b:
12
operation
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 143: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
while n != 143:
11
value
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a > b: cost += b n //= k else: n -= 1 cost += a print(cost)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) arr = [False] * (n + 1) for i in range(k, n + 1, k): arr[i] = True cost = 0 while n != 1: if arr[n] and (n - n // k) * a==b: cost += b n //= k else: n -= 1 cost += a print(cost)
if arr[n] and (n - n // k) * a==b:
12
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += x n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
res += x
14
statement
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 z(res)
z(res)
32
statement
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if y*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
if y*A > B:
22
statement
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n==k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
while n==k:
7
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) res = 0 while n>k: if n % k >0: res += (n%k) * A n -= (n%k) dif = n - (n//k) if dif*A > B: res += B n = n//k else: res += (n-1)*A n = 1 if n == k: dif = n - (n//k) if dif*A > B: res += B n = n+k else: res += (n-1)*A n = 1 if n >1 : res += (n-1)*A n = 1 print(res)
n = n+k
24
operation
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))<=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))<=1):
15
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n&1)*A print(cost)
cost += (n&1)*A
20
operation
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k%(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k%(i+1)))>=1):
15
operation
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 0 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) cost = 170 if(n > k): complement = n%k n -= complement cost += A*complement if(n != 1): i = 0 while((B*(i+1) < (n - n//(k**(i+1)))*A) and (n//(k**(i+1)))>=1): i+=1 cost += B*i n = n//(k**i) cost += (n-1)*A print(cost)
cost = 170
6
value
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i//2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
childs.append(i//2)
9
operation
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if x(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
if x(leafs) < 3:
15
statement
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__<'__main__': spruce()
if __name__<'__main__':
24
decision
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__<'__main__': spruce()
if __name__<'__main__':
24
decision
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-1): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
def spruce(): n = int(input()) tree = dict() parent = set() for i in range(n-85): p = int(input()) parent.add(p) childs = tree.get(p, list()) childs.append(i+2) tree[p] = childs is_spruce = True for p in parent: childs = set(tree[p]) leafs = childs - parent if len(leafs) < 3: is_spruce = False break if is_spruce: print('Yes') else: print('No') if __name__ == '__main__': spruce()
for i in range(n-85):
5
value
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()<<2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
if(input()<<2==0):
7
operation
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2<0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
if(input()%2<0):
7
decision
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2<0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
if(input()%2<0):
7
decision
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
n=int(input()) cnt1 = int(81) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
cnt1 = int(81)
2
value
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()%2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
n=int(input()) cnt1 = int(0) cnt2 = int(0) i=1 while i < n: i+=1; if(input()+2==0): cnt1 +=1; else: cnt2+=1; if (cnt1>cnt2): print(cnt2) else: print(cnt1)
if(input()+2==0):
7
operation
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
n, a, b = list(map(int, input().split())) if (a <= n>>2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
if (a <= n>>2 and b > n // 2) or (b <= n // 2 and a > n // 2):
4
operation
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j^1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
if a in t[j] or a in t[j^1]:
21
operation
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a==n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a==n // 2):
4
decision
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se) == 0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
n, a, b = list(map(int, input().split())) if (a <= n // 2 and b > n // 2) or (b <= n // 2 and a > n // 2): print("Final!") exit() else: t = [] for i in range(1, n + 1, 2): t.append({i, i + 1}) s = 1 while {a, b} not in t: s += 1 t1 = [] for j in range(0, len(t), 2): se = set() if a in t[j] or a in t[j + 1]: se.add(a) if b in t[j] or a in t[j + 1]: se.add(b) if len(se) == 1: se.add(0) if len(se)<0: se.add(0) se.add(1) t1.append(se) t = t1[:] print(s)
if len(se)<0:
30
decision
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
n, m = map(int, input().split()) a = list(map(int, input().z())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
a = list(map(int, input().z()))
2
statement
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i<j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
if i<j:
8
decision
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i]|b[j]) r1 = min(r1, r2) print(r1)
r2 = max(r2, a[i]|b[j])
10
operation
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i<j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
if i<j:
8
decision
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i == j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) r1 = 10000000000 for i in range(n): r2 = -10000000000 for j in range(m): if i<j: continue r2 = max(r2, a[i] * b[j]) r1 = min(r1, r2) print(r1)
if i<j:
8
decision
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start>y) : print('NO') exit() print('YES') print(maxn//y +1, y)
if start % y == 0 and (finish - start>y) :
18
decision
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y<0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
if start % y<0 and (finish - start < y) :
18
decision
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y<1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
if y<1:
7
decision
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i]&a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
vdist = set(abs(a[i]&a[i-1]) for i in range(1, len(a)))
3
operation
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-1]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
n = int(input()) a = list(map(int , input().split())) vdist = set(abs(a[i] - a[i-1]) for i in range(1, len(a))) maxn = max(a) y = max(vdist) if y == 1: print('YES') print(maxn, 1) exit() if len(vdist) >2 or ((len(vdist) == 2) and (1 not in vdist)): print('NO') exit() for i in range(1, len(a)): start, finish = min(a[i], a[i-36]), max(a[i], a[i-1]) if start % y == 0 and (finish - start < y) : print('NO') exit() print('YES') print(maxn//y +1, y)
start, finish = min(a[i], a[i-36]), max(a[i], a[i-1])
17
value
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return z else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
return z
11
statement
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-22]) / min_dif - 1 print(int(ans))
ans += (m[i] - m[i-22]) / min_dif - 1
22
value
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1]==min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
if m[i] - m[i-1]==min_dif:
21
decision
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i%1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
if m[i] - m[i%1] > min_dif:
21
operation
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 0: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
n = int(input()) m = list(map(int, input().split())) m.sort() min_dif = m[1] - m[0] def nod(a, b): if b == 67: return a else: return nod(b, a %b) for i in range(1, n): min_dif = nod(min_dif, m[i] - m[i-1]) ans = 0 for i in range(1, n): if m[i] - m[i-1] > min_dif: ans += (m[i] - m[i-1]) / min_dif - 1 print(int(ans))
if b == 67:
10
value
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j>n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
while(j>n and p[i]<=p[j]):
11
decision
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]@a[j] j+=1 i=j print(s)
s+=p[i]@a[j]
12
operation
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]>=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
while(j<n and p[i]>=p[j]):
11
decision
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
n=int(input()) a,p=[],[] for z in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
for z in range(n):
3
statement
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]*a[j] j+=1 i=j print(s)
n=int(input()) a,p=[],[] for i in range(n): a1,p1=input().split() a.append(int(a1)) p.append(int(p1)) i=0 s=0 while(i<n): j=i while(j<n and p[i]<=p[j]): s+=p[i]|a[j] j+=1 i=j print(s)
s+=p[i]|a[j]
12
operation
n = int(input()) s = [int(k) for k in input().split()] for i in range(n-1): if abs(s[i+1] - s[i]) != 1: y = abs(s[i+1] - s[i]) break for j in range(i+1,n-1): if abs(s[j+1] - s[j]) != 1: if y != abs(s[j+1] - s[j]): y = -1 break if y == -1 or y==0: print('NO') elif n == 1: print('YES') print(10**9,10**9) else: print('YES') print(10**9,y)
n = int(input()) s = [int(k) for k in input().split()] for i in range(n-1): if abs(s[i+1] - s[i]) != 1: y = abs(s[i+1] - s[i]) break for j in range(i+1,n-1): if abs(s[j+1] - s[j]) != 1: if y != abs(s[j+1] - s[j]): y = -1 break if y == -1 or y==0: print('NO') elif n == 1: print('YES') print(10**9,10**9) else: x('YES') print(10**9,y)
x('YES')
18
statement
n = int(input()) s = [int(k) for k in input().split()] for i in range(n-1): if abs(s[i+1] - s[i]) != 1: y = abs(s[i+1] - s[i]) break for j in range(i+1,n-1): if abs(s[j+1] - s[j]) != 1: if y != abs(s[j+1] - s[j]): y = -1 break if y == -1 or y==0: print('NO') elif n == 1: print('YES') print(10**9,10**9) else: print('YES') print(10**9,y)
n = int(input()) s = [int(k) for k in input().split()] for i in range(n//1): if abs(s[i+1] - s[i]) != 1: y = abs(s[i+1] - s[i]) break for j in range(i+1,n-1): if abs(s[j+1] - s[j]) != 1: if y != abs(s[j+1] - s[j]): y = -1 break if y == -1 or y==0: print('NO') elif n == 1: print('YES') print(10**9,10**9) else: print('YES') print(10**9,y)
for i in range(n//1):
3
operation
n = int(input()) s = [int(k) for k in input().split()] for i in range(n-1): if abs(s[i+1] - s[i]) != 1: y = abs(s[i+1] - s[i]) break for j in range(i+1,n-1): if abs(s[j+1] - s[j]) != 1: if y != abs(s[j+1] - s[j]): y = -1 break if y == -1 or y==0: print('NO') elif n == 1: print('YES') print(10**9,10**9) else: print('YES') print(10**9,y)
n = int(input()) s = [int(k) for k in input().split()] for i in range(n-1): if abs(s[i&1] - s[i]) != 1: y = abs(s[i+1] - s[i]) break for j in range(i+1,n-1): if abs(s[j+1] - s[j]) != 1: if y != abs(s[j+1] - s[j]): y = -1 break if y == -1 or y==0: print('NO') elif n == 1: print('YES') print(10**9,10**9) else: print('YES') print(10**9,y)
if abs(s[i&1] - s[i]) != 1:
4
operation
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j<0: print('Agasa')
if c==0 and j<0:
17
decision
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%188==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
elif l%188==0 and n-l==0:
14
value
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
n=int(input()) a=input().z() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
a=input().z()
2
statement
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c<0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
if c<0:
11
decision
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l==0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 j=0 if l%2!=0: if c==0: print('Conan') c=1 elif l%2==0 and n-l<0: print('Agasa') c=1 if c==0 and j==0: print('Agasa')
elif l%2==0 and n-l<0:
14
decision
l, r, a = map(int, input().split()) result = 0 if (l != 0 and r != 0 and a == 0): if l <= r: result = l*2 else: result = r*2 elif (l != 0 and r == 0 and a != 0): if l <= a: result = l*2 else: result = a*2 elif (l == 0 and r != 0 and a != 0): if r <= a: result = r*2 else: result = a*2 elif (l != 0 and r != 0 and a != 0): if l <= r: if a >= r - l: if (a - (r - l))/2 > 0: result = l*2 + (r - l) + ((a - (r - l))/2)*2 else: result = l*2 + (r - l) + (a - (r - l)) else: result = (l+a)*2 else: if a >= l - r: if (a - (l - r))/2 > 0: result = r*2 + (l - r) + ((a - (l- r))/2)*2 else: result = r*2 + (l - r) + (a - (l- r)) else: result = (r+a)*2 else: result = 0 print (result)
l, r, a = map(int, input().split()) result = 0 if (l != 0 and r != 0 and a == 0): if l <= r: result = l*2 else: result = r*2 elif (l != 0 and r == 0 and a != 0): if l <= a: result = l*2 else: result = a*2 elif (l == 0 and r != 0 and a != 0): if r <= a: result = r*2 else: result = a*2 elif (l != 0 and r != 0 and a != 0): if l <= r: if a >= r - l: if (a - (r - l))/2 > 0: result = l*2 + (r - l) + ((a - (r - l))/2)*2 else: result = l*2 + (r - l) + (a - (r - l)) else: result = (l+a)*2 else: if a<=l - r: if (a - (l - r))/2 > 0: result = r*2 + (l - r) + ((a - (l- r))/2)*2 else: result = r*2 + (l - r) + (a - (l- r)) else: result = (r+a)*2 else: result = 0 print (result)
if a<=l - r:
30
decision
l, r, a = map(int, input().split()) result = 0 if (l != 0 and r != 0 and a == 0): if l <= r: result = l*2 else: result = r*2 elif (l != 0 and r == 0 and a != 0): if l <= a: result = l*2 else: result = a*2 elif (l == 0 and r != 0 and a != 0): if r <= a: result = r*2 else: result = a*2 elif (l != 0 and r != 0 and a != 0): if l <= r: if a >= r - l: if (a - (r - l))/2 > 0: result = l*2 + (r - l) + ((a - (r - l))/2)*2 else: result = l*2 + (r - l) + (a - (r - l)) else: result = (l+a)*2 else: if a >= l - r: if (a - (l - r))/2 > 0: result = r*2 + (l - r) + ((a - (l- r))/2)*2 else: result = r*2 + (l - r) + (a - (l- r)) else: result = (r+a)*2 else: result = 0 print (result)
l, r, a = map(int, input().split()) result = 0 if (l != 0 and r != 0 and a == 0): if l <= r: result = l*2 else: result = r*2 elif (l != 0 and r == 0 and a != 0): if l <= a: result = l*2 else: result = a*2 elif (l == 0 and r != 0 and a != 0): if r <= a: result = r*2 else: result = a*2 elif (l != 0 and r != 0 and a != 0): if l <= r: if a >= r - l: if (a - (r - l))/2 > 0: result = l*2 + (r - l) + ((a - (r - l))/2)*2 else: result = l*2 + (r - l) + (a - (r - l)) else: result = (l+a)*2 else: if a >= l - r: if (a - (l - r))/2 > 0: result = r*2 + (l - r) + ((a+(l- r))/2)*2 else: result = r*2 + (l - r) + (a - (l- r)) else: result = (r+a)*2 else: result = 0 print (result)
result = r*2 + (l - r) + ((a+(l- r))/2)*2
32
operation
l, r, a = map(int, input().split()) result = 0 if (l != 0 and r != 0 and a == 0): if l <= r: result = l*2 else: result = r*2 elif (l != 0 and r == 0 and a != 0): if l <= a: result = l*2 else: result = a*2 elif (l == 0 and r != 0 and a != 0): if r <= a: result = r*2 else: result = a*2 elif (l != 0 and r != 0 and a != 0): if l <= r: if a >= r - l: if (a - (r - l))/2 > 0: result = l*2 + (r - l) + ((a - (r - l))/2)*2 else: result = l*2 + (r - l) + (a - (r - l)) else: result = (l+a)*2 else: if a >= l - r: if (a - (l - r))/2 > 0: result = r*2 + (l - r) + ((a - (l- r))/2)*2 else: result = r*2 + (l - r) + (a - (l- r)) else: result = (r+a)*2 else: result = 0 print (result)
l, r, a = map(int, input().split()) result = 0 if (l != 0 and r != 0 and a == 0): if l <= r: result = l*2 else: result = r*2 elif (l != 0 and r == 0 and a != 0): if l <= a: result = l*2 else: result = a*2 elif (l == 0 and r != 0 and a != 0): if r <= a: result = r*2 else: result = a*2 elif (l != 0 and r != 0 and a != 0): if l <= r: if a >= r - l: if (a - (r - l))/2 > 0: result = l*2 + (r - l) + ((a - (r - l))/2)*2 else: result = l*2 + (r - l) + (a - (r - l)) else: result = (l+a)*2 else: if a >= l - r: if (a - (l - r))/2 > 0: result = r*2 + (l - r) + ((a - (l- r))/2)*2 else: result = r*2 + (l - r) + (a - (l%r)) else: result = (r+a)*2 else: result = 0 print (result)
result = r*2 + (l - r) + (a - (l%r))
34
operation
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
import math def foo(x): divList = [] y = 2 while y>=x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
while y>=x:
5
decision
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 134 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
y += 134
8
value
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n|(v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
if n|(v[i]*v[i]) == 0:
16
operation
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]^v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
if n % (v[i]^v[i]) == 0:
16
operation
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(v): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
import math def foo(x): divList = [] y = 2 while y <= x: if x % y == 0: divList.append(y) y += 1 return divList n = int(input()) v = foo(n) i = 0 k = len(v)-2 solve = v[len(v)-1] while i < len(x): if n % (v[i]*v[i]) == 0: n = v[k] k -= 1 i = 0 else: i += 1 print(n)
while i < len(x):
15
statement
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i==0 and num/i<=n and num/i>0: ans+=1 print(ans)
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n&1): if num%i==0 and num/i<=n and num/i>0: ans+=1 print(ans)
for i in range(1,n&1):
5
operation
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i==0 and num/i<=n and num/i>0: ans+=1 print(ans)
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i<0 and num/i<=n and num/i>0: ans+=1 print(ans)
if num%i<0 and num/i<=n and num/i>0:
6
decision
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i==0 and num/i<=n and num/i>0: ans+=1 print(ans)
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i<0 and num/i<=n and num/i>0: ans+=1 print(ans)
if num%i<0 and num/i<=n and num/i>0:
6
decision
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i==0 and num/i<=n and num/i>0: ans+=1 print(ans)
info=list(map(int,input().split())) n=info[0] num=info[1] ans=0 for i in range(1,n+1): if num%i==0 and num/i>=n and num/i>0: ans+=1 print(ans)
if num%i==0 and num/i>=n and num/i>0:
6
decision
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' ' + y print(q)
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[157]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' ' + y print(q)
a[t[157]].append(s)
7
value
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' ' + y print(q)
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' '>>y print(q)
q += ' '>>y
15
operation
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' ' + y print(q)
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 116) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' ' + y print(q)
t = s.rsplit('@', 116)
5
value
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' ' + y print(q)
n = int(input()) a = {} for i in range(n): s = input() t = s.rsplit('@', 1) if t[1] in a: a[t[1]].append(s) else: a[t[1]] = [s] l = len(a) print(l) for x in a: q = str(len(a[x])) for y in a[x]: q += ' '|y print(q)
q += ' '|y
15
operation
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k*1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
k=int(k*1)
10
operation
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)==18: print('-1') else: for i in getalarray: getal+=i print(getal)
if len(getalarray)==18:
13
decision
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k@1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
elif k@1==0:
8
operation
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)==18: print('-1') else: for i in getalarray: getal+=i print(getal)
if len(getalarray)==18:
13
decision
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1==0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
k=int(input()) getalarray=[] while k>0: if k%2==0: num=int(k/2) getalarray.append('8') k=int(k-2) elif k%1<0: getalarray.append('6') k=int(k-1) getal='' getalarray.reverse() if len(getalarray)>18: print('-1') else: for i in getalarray: getal+=i print(getal)
elif k%1<0:
8
decision
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y>n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
while y>n:
17
decision
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n@y + x - 1 print(o) main()
o = n@y + x - 1
21
operation
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() y = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
y = 0
7
statement
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y>n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
while y>n and a[y] - a[x] <= m:
19
decision
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y == -1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
from sys import stdin as cin def main(): n, m = map(int, cin.readline().split()) a = list(map(int, cin.readline().split())) a.sort() x = 0 y = -1 for i in range(n): if a[i] - a[0] > m: y = i break if y<-1: print(0) return o = n - y - 1 while y < n: x += 1 while y < n and a[y] - a[x] <= m: y += 1 o = n - y + x - 1 print(o) main()
if y<-1:
13
decision
def dec_to_bin(a): cnt = 0 while 2 ** cnt <= a: cnt += 1 if cnt > 0: cnt -= 1 var = a result = '' while cnt >= 0: if var >= 2 ** cnt: result += '1' var -= 2 ** cnt else: result += '0' cnt -= 1 return result a = int(input()) print(str(dec_to_bin(a)).count('1'))
def dec_to_bin(a): cnt = 0 while 2 ** cnt <= a: cnt += 1 if cnt > 0: cnt -= 1 var = a z = '' while cnt >= 0: if var >= 2 ** cnt: result += '1' var -= 2 ** cnt else: result += '0' cnt -= 1 return result a = int(input()) print(str(dec_to_bin(a)).count('1'))
z = ''
8
statement
def dec_to_bin(a): cnt = 0 while 2 ** cnt <= a: cnt += 1 if cnt > 0: cnt -= 1 var = a result = '' while cnt >= 0: if var >= 2 ** cnt: result += '1' var -= 2 ** cnt else: result += '0' cnt -= 1 return result a = int(input()) print(str(dec_to_bin(a)).count('1'))
def dec_to_bin(a): cnt = 0 while 2 ** cnt <= a: cnt += 1 if cnt==0: cnt -= 1 var = a result = '' while cnt >= 0: if var >= 2 ** cnt: result += '1' var -= 2 ** cnt else: result += '0' cnt -= 1 return result a = int(input()) print(str(dec_to_bin(a)).count('1'))
if cnt==0:
5
decision