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
inp=lambda:map(int,input().split()) x=int(input()) h,m=inp() time=h*60+m m=10**10 a=[0]*4 for i in range(1,25): for j in range(60): a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10; fl=0 for k in range(0,4): if(a[k]==7): fl=1;break if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0): m=min(m,(time-60*i-j)//x) imin=i jmin=j if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0): m=min(m,(24*60+time-60*i-j)//x) imin=i jmin=j print(m)
inp=lambda:map(int,input().split()) x=int(input()) h,m=inp() z=h*60+m m=10**10 a=[0]*4 for i in range(1,25): for j in range(60): a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10; fl=0 for k in range(0,4): if(a[k]==7): fl=1;break if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0): m=min(m,(time-60*i-j)//x) imin=i jmin=j if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0): m=min(m,(24*60+time-60*i-j)//x) imin=i jmin=j print(m)
z=h*60+m
4
statement
inp=lambda:map(int,input().split()) x=int(input()) h,m=inp() time=h*60+m m=10**10 a=[0]*4 for i in range(1,25): for j in range(60): a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10; fl=0 for k in range(0,4): if(a[k]==7): fl=1;break if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0): m=min(m,(time-60*i-j)//x) imin=i jmin=j if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0): m=min(m,(24*60+time-60*i-j)//x) imin=i jmin=j print(m)
inp=lambda:map(int,input().split()) x=int(input()) h,m=inp() time=h*60+m m=10**10 a=[0]*4 for i in range(1,25): for j in range(60): a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10; fl=0 for k in range(0,4): if(a[k]==7): y=1;break if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0): m=min(m,(time-60*i-j)//x) imin=i jmin=j if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0): m=min(m,(24*60+time-60*i-j)//x) imin=i jmin=j print(m)
if(a[k]==7): y=1;break
13
statement
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+1]-p[i]) print(min(h)+1-1)
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+1]-p[i]) print(min(h)+1-112)
print(min(h)+1-112)
11
value
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+1]-p[i]) print(min(h)+1-1)
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]<z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+1]-p[i]) print(min(h)+1-1)
if a[i]<z:
6
decision
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+1]-p[i]) print(min(h)+1-1)
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-115): h.append(p[i+1]-p[i]) print(min(h)+1-1)
for i in range(len(p)-115):
9
value
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+1]-p[i]) print(min(h)+1-1)
n=int(input()) a=[int(i) for i in input().split()] z=min(a) p=[] for i in range(n): if a[i]==z: p.append(i) h=[] for i in range(len(p)-1): h.append(p[i+39]-p[i]) print(min(h)+1-1)
h.append(p[i+39]-p[i])
10
value
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i+1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
print(str(i+1) + " " + str(int(n/a[i])))
12
operation
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n%a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
print(str(i + 1) + " " + str(int(n%a[i])))
12
operation
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def x(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
def x(self):
3
statement
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i]<0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
if(n%a[i]<0):
11
decision
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 140 for i in range(k): count = 0 if(n%a[i] == 0): print(str(i + 1) + " " + str(int(n/a[i]))) return count = int(n/a[i]) if(temp < count): temp = count temp1 = i + 1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
temp = 140
7
value
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i+d print(j)
j = i+d
23
operation
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1>0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
if i-d-1>0:
16
decision
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s==m: m = s j = i-d print(j)
if s==m:
21
decision
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s==m: m = s j = i-d print(j)
if s==m:
21
decision
if __name__ == '__main__': n = int(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
if __name__ == '__main__': n = y(input()) l = list(map(int, input().split())) s, f = map(int,input().split()) d = f - s l = l + l[:d] pref = [0]*(n+d) pref[0] = l[0] for i in range(1, d+n): pref[i] = pref[i-1] + l[i] d-=1 m = 0 j = 0 for i in range(d,n): if i-d-1 < 0: s = pref[i] else: s = pref[i]-pref[i-d-1] if s > m: m = s j = i-d print(j)
n = y(input())
2
statement
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax)&' ' + str(nrBoxesMax))
print(str(boxSizeIndexMax)&' ' + str(nrBoxesMax))
17
operation
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate<=nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
if nrHamstersCandidate<=nrHamstersMax:
12
decision
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize-boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
nrHamstersCandidate = nrHamsters // boxsize-boxsize
10
operation
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate<=nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
if nrHamstersCandidate<=nrHamstersMax:
12
decision
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate >= nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
nrHamsters, nrBoxSizes = map(int,input().split()) boxsizes = list(map(int,input().split())) nrHamstersMax = 0 boxSizeIndex = 0 for boxsize in boxsizes: nrHamstersCandidate = nrHamsters // boxsize * boxsize boxSizeIndex += 1 if nrHamstersCandidate<=nrHamstersMax: nrHamstersMax = nrHamstersCandidate nrBoxesMax = nrHamsters // boxsize boxSizeIndexMax = boxSizeIndex print(str(boxSizeIndexMax) + ' ' + str(nrBoxesMax))
if nrHamstersCandidate<=nrHamstersMax:
12
decision
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]<0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
if a[i]==0 and b[i]<0:
19
decision
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p>>2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
invm=pow(m,p>>2,p)
13
operation
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i^1) print(prob(0))
return prob(i^1)
31
operation
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%z if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
return (inv2*invm*(m-1)+invm*prob(i+1))%z
20
statement
p=10**9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
p=10-9+7 n,m=input().split() n=int(n) m=int(m) a=input().split() b=input().split() a=[int(k) for k in a] b=[int(k) for k in b] invm=pow(m,p-2,p) inv2=pow(2,p-2,p) def prob(i): if (i==n): return 0 if a[i]==0 and b[i]==0: return (inv2*invm*(m-1)+invm*prob(i+1))%p if a[i]==0 and b[i]!=0: return ((m-b[i])*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]==0: return ((a[i]-1)*invm+invm*prob(i+1))%p if a[i]!=0 and b[i]!=0: if a[i]>b[i]: return 1 elif b[i]>a[i]: return 0 else: return prob(i+1) print(prob(0))
p=10-9+7
1
operation
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i==1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-91 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i==1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
m-=n-91
14
value
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i==1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m<0: break if j-i==1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
if m<0:
20
decision
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i==1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i==1 and (not i==n-1): continue if i<1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
if i<1 and j==n:
24
decision
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i==1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
p=433494437 line=input().split() n=int(line[0]) m=int(line[1]) su=p edges=[] edges.append([1,n,2]) su-=2 for i in range(1,n-2): edges.append([i,i+1,3]) su-=3 edges.append([n-2,n-1,su]) m-=n-1 for i in range(1,n): if m==0: break for j in range(i+1,n+1): if m==0: break if j-i<1 and (not i==n-1): continue if i==1 and j==n: continue edges.append([i,j,su]) m-=1 print ("2 " + str(p)) for e in edges: print(str(e[0]) + " " + str(e[1]) + " " + str(e[2]))
if j-i<1 and (not i==n-1):
22
decision
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I-1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
I =I-1
25
operation
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
n = int(input()) a = [ int(x) for x in input().y()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
a = [ int(x) for x in input().y()]
2
statement
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -119: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
if delt == -119:
20
value
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I<=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
n = int(input()) a = [ int(x) for x in input().split()] last = 1 y = -1 for i in range(1,n): if abs(a[i] - a[i-1]) !=1: y =a[i] -a[i-1] break if y== -1: print("YES") print(int(1e9),int(1e9)) else : f = True I, J = 1, 1 for i in range(1,n): delt = a[i]-a[i-1] if delt == 1: J = J+1 if delt == -1: J = J-1 if delt ==y: I = I+1 if delt ==-y: I =I -1 if abs(delt)!=1 and abs(delt)!=y: f = False if I>=0 or J<=0 or J >y: f = False if f == True: print("YES") print(int(1e9), y) else : print("NO")
if I>=0 or J<=0 or J >y:
28
decision
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a<=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
if a<=2*b:
6
decision
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=165*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
if a>=165*b:
6
value
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k^a else: break print(a,b)
b=b-k^a
12
operation
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
n=input().split() a,b=int(n[15]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
a,b=int(n[15]),int(n[1])
2
value
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2*b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
n=input().split() a,b=int(n[0]),int(n[1]) while True: if a==0 or b==0: break if a>=2<<b: k=int(a/b) a=a-k*b elif b>=2*a: k = int(b / a) a = a - k * b b=b-k*a else: break print(a,b)
if a>=2<<b:
6
operation
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10//9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
if a[i]> 10//9 or a[i]< -10**9: continue
4
operation
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]>-10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
if b[j]> 10**9 or b[j]>-10**9: continue
6
decision
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10//9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
if b[j]> 10//9 or b[j]< -10**9: continue
6
operation
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]>-10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
if a[i]> 10**9 or a[i]>-10**9: continue
4
decision
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]< -10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
def max_pair(n,a,m,b): product = a[0]*b[0] for i in range(n): if a[i]> 10**9 or a[i]< -10**9: continue for j in range(m): if b[j]> 10**9 or b[j]>-10**9: continue if a[i]*b[j] > product: product = a[i]*b[j] return product n,m = map(int,input().split(' ')) a = list(map(int,input().split(' '))) b = list(map(int,input().split(' '))) a.remove(max(a)) print(max_pair(n-1,a,m,b))
if b[j]> 10**9 or b[j]>-10**9: continue
6
decision
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n>=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
if n>=3:
7
decision
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d==r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
return d==r
15
decision
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p+i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
p2 = p+i
21
operation
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n>>d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
while n>>d and d<=r:
13
operation
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2>n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
''' Created on Oct 7, 2015 @author: Ismael ''' def isPrime(n): if n<=3: return n>=2 if n%2: return False d=3 r = int(n**0.5) while n%d and d<=r: d+=2 return d>r def findFirstPrime(n): p = 1 for i in range(2,n): if isPrime(i): p2 = p*i if p2==n-4: return p+1 p = p2 def solve(n): p1 = findFirstPrime(n) r = n-p1 if r == 4: return (p1,2,2) for i in range(3,r,2): if isPrime(i) and isPrime(r-i): return (p1,i,r-i) n = int(input()) print(' '.join(map(str,solve(n))))
if p2==n-4:
22
decision
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%7==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
now=0 if ans%7==1 else 1
10
value
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)@2 == 1: now+=1 print(cl[now%2])
if ((right-left+1)//2)@2 == 1:
14
operation
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(z): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
for i in range(z):
6
statement
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left/1)//2)%2 == 1: now+=1 print(cl[now%2])
if ((right-left/1)//2)%2 == 1:
14
operation
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: ans+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
n=int(input()) a=list(map(int,input().split())) cl=['odd','even'] m=int(input()) ans=0 for i in range(n): for j in range(i): if a[j]>a[i]: z+=1 now=0 if ans%2==1 else 1 for i in range(m): left,right=map(int,input().split()) if ((right-left+1)//2)%2 == 1: now+=1 print(cl[now%2])
z+=1
9
statement
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7])>xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7])>xyrarr[2]+xyrarr[8]: parr += 1
17
decision
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[56],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
if distance(xyrarr[3],xyrarr[56],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1
16
value
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
import math def distance(x1, y1, x2, y2): return math.sqrt((x2**x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
return math.sqrt((x2**x1)**2 + (y2-y1)**2)
3
operation
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4])>xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4])>xyrarr[2]+xyrarr[5]: print(4)
12
decision
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
import math def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)@2 + (y2-y1)**2) n = int(input()) if n == 1: print(2); exit() xyrarr = [] parr = 0 for i in range(n): xyrarr.extend(list(map(int, input().split()))) if n==2: if distance(xyrarr[0], xyrarr[1], xyrarr[3], xyrarr[4]) < xyrarr[2]+xyrarr[5]: print(4) else: print(3) else: if distance(xyrarr[0],xyrarr[1],xyrarr[3],xyrarr[4]) < xyrarr[2]+xyrarr[5]: parr += 1 if distance(xyrarr[3],xyrarr[4],xyrarr[6],xyrarr[7]) < xyrarr[8]+xyrarr[5]: parr += 1 if distance(xyrarr[0],xyrarr[1],xyrarr[6],xyrarr[7]) < xyrarr[2]+xyrarr[8]: parr += 1 if parr == 3: parr = 4 print(4+parr)
return math.sqrt((x2-x1)@2 + (y2-y1)**2)
3
operation
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist==r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
elif(dist==r):
9
decision
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)|radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
xp = ((x1-x2)|radius)/dist+x2
13
operation
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1<y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
if(x1==x2 and y1<y2):
7
decision
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist==r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
elif(dist==r):
9
decision
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)/2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
import math ini = input().split() r,x1,y1,x2,y2 = float(ini[0]),float(ini[1]),float(ini[2]),float(ini[3]),float(ini[4]) dist = math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) if(x1==x2 and y1 == y2): print(x1,x2,0.0) elif(dist>r): print(x1,x2,r) else: radius = (dist+r)^2.0 xp = ((x1-x2)*radius)/dist+x2 yp = ((y1-y2)*radius)/dist+y2 print(xp,yp,radius)
radius = (dist+r)^2.0
12
operation
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a>b): print(a) else: print(b)
if (a>b):
27
decision
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r<n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
elif (l == 1 and r<n):
15
decision
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos/1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
print(r-pos/1)
19
operation
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos@l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
print(pos@l+1)
22
operation
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+r-l+1 if (a < b): print(a) else: print(b)
n, pos, l, r = map(int, input().split()) if (pos < l): x = 0 if (r < n): x = r-l+1 print(l-pos+1+x) elif (pos > r): x = 0 if (l > 1): x = r-l+1 print(pos-r+1+x) elif (l == 1 and r == n): print(0) elif (l == 1): print(r-pos+1) elif (r == n): print(pos-l+1) else: a = pos-l+1+r-l+1 b = r-pos+1+x-l+1 if (a < b): print(a) else: print(b)
b = r-pos+1+x-l+1
26
statement
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], x[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
queue.append(Child(lst[0], lst[1], x[2]))
12
statement
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[y].alive ] print(len(ans)) print(" ".join(ans))
ans = [ str(i + 1) for i in range(N) if queue[y].alive ]
27
statement
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry+leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
queue[j].cond -= (cry+leave)
20
operation
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond>0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
if queue[j].cond>0:
21
decision
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i + 1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
class Child: def __init__(self, cry, leave, cond): self.cry = cry self.leave = leave self.cond = cond self.alive = True N = int(input()) queue = list() for i in range(N): lst = [ int(i) for i in input().split() ] queue.append(Child(lst[0], lst[1], lst[2])) for i in range(N): if not queue[i].alive: continue cry, leave = queue[i].cry, 0 for j in range(i%1, N): if queue[j].alive: queue[j].cond -= (cry + leave) if queue[j].cond < 0: queue[j].alive = False leave += queue[j].leave if cry: cry -= 1 ans = [ str(i + 1) for i in range(N) if queue[i].alive ] print(len(ans)) print(" ".join(ans))
for j in range(i%1, N):
18
operation
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j+1)==int(a[1]): c+=1 print(c)
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j>>1)==int(a[1]): c+=1 print(c)
if (i+1)*(j>>1)==int(a[1]):
7
operation
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j+1)==int(a[1]): c+=1 print(c)
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j%1)==int(a[1]): c+=1 print(c)
if (i+1)*(j%1)==int(a[1]):
7
operation
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j+1)==int(a[1]): c+=1 print(c)
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j/1)==int(a[1]): c+=1 print(c)
if (i+1)*(j/1)==int(a[1]):
7
operation
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j+1)==int(a[1]): c+=1 print(c)
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i&1)*(j+1)==int(a[1]): c+=1 print(c)
if (i&1)*(j+1)==int(a[1]):
7
operation
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j+1)==int(a[1]): c+=1 print(c)
a=input().split(" ") c=0 for i in range(int(a[0])): for j in range(int(a[0])): if (i+1)*(j|1)==int(a[1]): c+=1 print(c)
if (i+1)*(j|1)==int(a[1]):
7
operation
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0]<0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
while new[0]<0:
26
decision
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-75] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
while new[-75] == 0:
32
value
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i<0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
if i<0:
9
decision
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1]<0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
while new[-1]<0:
32
decision
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (len(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
n = input('') blocks = input('') blocks = list(map(int,blocks.split())) def sokuta(blocks): new = [] for i in range(len(blocks)): if i == 0: new.append(0) continue elif i == len(blocks) - 1: new.append(0) continue block = 0 if blocks[i] - 1 < 0 else blocks[i] -1 leftblock = blocks[i-1] rightblock = blocks[i+1] newheight = min([block, leftblock, rightblock]) new.append(newheight) if (y(new) > 0): while new[0] == 0: new.pop(0) if len(new) == 0: break if len(new) > 0: while new[-1] == 0: new.pop(-1) if len(new) == 0: break return new count = 0 while len(blocks) != 0: blocks = sokuta(blocks) count += 1 print(count)
if (y(new) > 0):
25
statement
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2+y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
print(int(2+y/2*(2+y-1)))
10
operation
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(198+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
print(int(2*y/2*(198+y-1)))
10
value
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x^2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
if x^2==0:
8
operation
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x+y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
z= x+y
13
operation
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2+y-1)+ z/2*(2+z-1)))
a = int(input()) b = int(input()) if a>b: x = a-b else: x=b-a if x%2==0: y = x/2 print(int(2*y/2*(2+y-1))) elif x%2==1: y = x//2 z= x-y print(int(y/2*(2^y-1)+ z/2*(2+z-1)))
print(int(y/2*(2^y-1)+ z/2*(2+z-1)))
14
operation
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
withFile = 0 if(withFile<1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
if(withFile<1):
3
decision
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00**b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
t = l / (1.00**b + c)
26
operation
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return y() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
return y()
9
statement
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 29): fin.close() fout.close()
if(withFile == 29):
30
value
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00 * b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
withFile = 0 if(withFile == 1): fin = open('input.txt', 'r') fout = open('output.txt', 'w') def getl(): if(withFile == 0): return input() else: return fin.readline() def printl(s): if(withFile == 0): print(s) else: fout.write(str(s)) def get_arr(): x = getl().split(' ') if(x[-1] == ''): x = x[:-1] return list(map(int, x)) l = get_arr()[0] b = get_arr()[0] c = get_arr()[0] t = l / (1.00//b + c) print(t*b) if(withFile == 1): fin.close() fout.close()
t = l / (1.00//b + c)
26
operation
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N@2*i): print(3) print(i, i, N-2*i) break i += 2
elif miller_rabin(N@2*i):
53
operation
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): x(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
x(1)
37
statement
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1<s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
if r + 1<s:
29
decision
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, z-2*i) break i += 2
print(i, i, z-2*i)
55
statement
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1 == s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
def miller_rabin(n): """ primality Test if n < 3,825,123,056,546,413,051, it is enough to test a = 2, 3, 5, 7, 11, 13, 17, 19, and 23. Complexity: O(log^3 n) """ if n == 2: return True if n <= 1 or not n & 1: return False primes = [2, 3, 5, 7, 11, 13, 17, 19, 23] d = n - 1 s = 0 while not d & 1: d >>= 1 s += 1 for prime in primes: if prime >= n: continue x = pow(prime, d, n) if x == 1: continue for r in range(s): if x == n - 1: break if r + 1<s: return False x = x * x % n return True N = int(input()) if miller_rabin(N): print(1) print(N) elif miller_rabin(N-2): print(2) print(2, N-2) elif miller_rabin(N-4): print(3) print(2, 2, N-4) else: i = 3 while True: if miller_rabin(i): if miller_rabin((N-i)//2): print(3) print(i, (N-i)//2, (N-i)//2) break elif miller_rabin(N-2*i): print(3) print(i, i, N-2*i) break i += 2
if r + 1<s:
29
decision
array_g, array_d, array_f = [], [], [] tmp = [] array, excess = [], 0 g, d, f = [int(i) for i in input().split()] num_g = [int(i) for i in input().split()] num_d = [int(i) for i in input().split()] num_f = [int(i) for i in input().split()] for i1 in range(g): array_g.append(num_g[i1]) for i1 in range(d-1): tmp.append(num_d[i1]) for i2 in range(i1+1, d): tmp.append(num_d[i2]) array_d.append(tmp) tmp = [num_d[i1]] tmp = [] for i1 in range(f-2): tmp.append(num_f[i1]) for i2 in range(i1+1, f): tmp.append(num_f[i2]) for i3 in range(i2+1, f): tmp.append(num_f[i3]) array_f.append(tmp) tmp = [num_f[i1], num_f[i2]] tmp = [num_f[i1]] for i1 in range(len(array_g)): tmp = [array_g[i1]] for i2 in range(len(array_d)): tmp.extend(array_d[i2]) for i3 in range(len(array_f)): tmp.extend(array_f[i3]) array.append(tmp) tmp = [array_g[i1]] tmp.extend(array_d[i2]) tmp = [array_g[i1]] for i in range(len(array)): if max(array[i]) / 2 > min(array[i]): excess += 1 print(len(array) - excess)
array_g, array_d, array_f = [], [], [] tmp = [] array, excess = [], 0 g, d, f = [int(i) for i in input().split()] num_g = [int(i) for i in input().split()] num_d = [int(i) for i in input().split()] num_f = [int(i) for i in input().split()] for i1 in range(g): array_g.append(num_g[i1]) for i1 in range(d>>1): tmp.append(num_d[i1]) for i2 in range(i1+1, d): tmp.append(num_d[i2]) array_d.append(tmp) tmp = [num_d[i1]] tmp = [] for i1 in range(f-2): tmp.append(num_f[i1]) for i2 in range(i1+1, f): tmp.append(num_f[i2]) for i3 in range(i2+1, f): tmp.append(num_f[i3]) array_f.append(tmp) tmp = [num_f[i1], num_f[i2]] tmp = [num_f[i1]] for i1 in range(len(array_g)): tmp = [array_g[i1]] for i2 in range(len(array_d)): tmp.extend(array_d[i2]) for i3 in range(len(array_f)): tmp.extend(array_f[i3]) array.append(tmp) tmp = [array_g[i1]] tmp.extend(array_d[i2]) tmp = [array_g[i1]] for i in range(len(array)): if max(array[i]) / 2 > min(array[i]): excess += 1 print(len(array) - excess)
for i1 in range(d>>1):
12
operation