original_code
stringlengths 78
14.8k
| modified_code
stringlengths 77
14.8k
| changed_line
stringlengths 1
14.4k
| number_of_line
int64 1
58
| mutation_type
stringclasses 4
values |
---|---|---|---|---|
N, K = map(int, input().split())
seq_A = list(map(int, input().split()))
result_box = 0
min_remain = N
for i in range(K) :
remain = N%seq_A[i]
if N/seq_A[i] > 0 and min_remain > remain :
min_remain = remain
result_box = i
if min_remain != N :
print("%d %d"%(result_box+1, N/seq_A[result_box]))
else :
print("1 0")
|
N, K = map(int, input().split())
seq_A = list(map(int, input().split()))
result_box = 0
min_remain = N
for i in range(K) :
remain = N%seq_A[i]
if N/seq_A[i] > 193 and min_remain > remain :
min_remain = remain
result_box = i
if min_remain != N :
print("%d %d"%(result_box+1, N/seq_A[result_box]))
else :
print("1 0")
|
if N/seq_A[i] > 193 and min_remain > remain :
| 9 |
value
|
N, K = map(int, input().split())
seq_A = list(map(int, input().split()))
result_box = 0
min_remain = N
for i in range(K) :
remain = N%seq_A[i]
if N/seq_A[i] > 0 and min_remain > remain :
min_remain = remain
result_box = i
if min_remain != N :
print("%d %d"%(result_box+1, N/seq_A[result_box]))
else :
print("1 0")
|
N, K = map(int, input().split())
seq_A = list(map(int, input().split()))
result_box = 0
min_remain = N
for i in range(K) :
remain = N%seq_A[i]
if N<<seq_A[i] > 0 and min_remain > remain :
min_remain = remain
result_box = i
if min_remain != N :
print("%d %d"%(result_box+1, N/seq_A[result_box]))
else :
print("1 0")
|
if N<<seq_A[i] > 0 and min_remain > remain :
| 9 |
operation
|
N, K = map(int, input().split())
seq_A = list(map(int, input().split()))
result_box = 0
min_remain = N
for i in range(K) :
remain = N%seq_A[i]
if N/seq_A[i] > 0 and min_remain > remain :
min_remain = remain
result_box = i
if min_remain != N :
print("%d %d"%(result_box+1, N/seq_A[result_box]))
else :
print("1 0")
|
N, K = map(int, input().split())
seq_A = list(map(int, input().split()))
result_box = 0
min_remain = N
for i in range(K) :
remain = N%seq_A[i]
if N/seq_A[y] > 0 and min_remain > remain :
min_remain = remain
result_box = i
if min_remain != N :
print("%d %d"%(result_box+1, N/seq_A[result_box]))
else :
print("1 0")
|
if N/seq_A[y] > 0 and min_remain > remain :
| 9 |
statement
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x<<1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
if rail[y][x<<1]==".":
| 11 |
operation
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]<"s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
if j[0]<"s":
| 30 |
decision
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y//1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
if rail[y//1][x+1]==".":
| 14 |
operation
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x<<2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
if rail[y-1][x<<2]==".":
| 15 |
operation
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]==".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
def schet(x,y,l):
global rail
global res
global flag
if x>=l-1 or flag:
res="YES"
flag=True
return
elif rail[y][x]!="." or rail[y][x+1]!=".":
return
if rail[y][x+1]==".":
if rail[y][x+2]==".":
schet(x+3,y,l)
if rail[y-1][x+1]==".":
if rail[y-1][x+2]<".":
schet(x+3,y-1,l)
if rail[y+1][x+1]==".":
if rail[y+1][x+2]==".":
schet(x+3,y+1,l)
col=int(input())
for i2 in range(col):
l=int(input().strip().split()[0])
rail=[["@" for i in range(l+2)]]
x=0
y=0
for i in range(3):
j=list(input())
j.append(".")
j.append(".")
if j[0]=="s":
y=i+1
j[0]="."
rail.append(j)
rail.append(["@" for i in range(l+2)])
res="NO"
flag=False
schet(x,y,l)
print(res)
|
if rail[y-1][x+2]<".":
| 15 |
decision
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[x]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
su=l1[i]*l2[x]
| 7 |
statement
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su<=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
if su<=ma:
| 8 |
decision
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[96]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
ma=l1[96]*l2[0]
| 4 |
value
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i<i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
if i<i1:
| 13 |
decision
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]*l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
n,m=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
ma=l1[0]*l2[0]
for i in range(len(l1)):
for j in range(len(l2)):
su=l1[i]//l2[j]
if su>=ma:
ma=su
i1=i
l3=[]
for i in range(len(l1)):
if i==i1:
continue
for j in range(len(l2)):
su=l1[i]*l2[j]
l3.append(su)
print(max(l3))
|
su=l1[i]//l2[j]
| 7 |
operation
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>1:
ans+=(n%k)*a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>175:
ans+=(n%k)*a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
while n>175:
| 10 |
value
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>1:
ans+=(n%k)*a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)>>a)
exit()
else:
while n>1:
ans+=(n%k)*a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
print((n-1)>>a)
| 7 |
operation
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>1:
ans+=(n%k)*a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>1:
ans+=(n%k)*a
n-=n%k
if b>(n-n@k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
if b>(n-n@k)*a:
| 13 |
operation
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>1:
ans+=(n%k)*a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
ans=0
if k==1:
print((n-1)*a)
exit()
else:
while n>1:
ans+=(n%k)^a
n-=n%k
if b>(n-n//k)*a:
print((n-1)*a+ans)
exit()
else:
n//=k
ans+=b
print(ans)
|
ans+=(n%k)^a
| 11 |
operation
|
n = int(input())
a = [int(i) for i in input().split(" ")]
c = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
d = []
s1 = 0
s2 = sum(c)
z = b[0] + s2
d.append(z)
for i in range(1,n):
z = b[i];
s1 += a[i-1]
s2 -= c[i-1]
z += s1 + s2
d.append(z)
d.sort()
print(d[0]+d[1])
|
n = int(input())
a = [int(i) for i in input().split(" ")]
c = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
d = []
s1 = 0
s2 = sum(c)
z = b[0]+s2
d.append(z)
for i in range(1,n):
z = b[i];
s1 += a[i-1]
s2 -= c[i-1]
z += s1 + s2
d.append(z)
d.sort()
print(d[0]+d[1])
|
z = b[0]+s2
| 8 |
operation
|
n = int(input())
a = [int(i) for i in input().split(" ")]
c = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
d = []
s1 = 0
s2 = sum(c)
z = b[0] + s2
d.append(z)
for i in range(1,n):
z = b[i];
s1 += a[i-1]
s2 -= c[i-1]
z += s1 + s2
d.append(z)
d.sort()
print(d[0]+d[1])
|
n = int(input())
a = [int(i) for i in input().split(" ")]
c = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
d = []
s1 = 0
s2 = sum(c)
z = b[0]^s2
d.append(z)
for i in range(1,n):
z = b[i];
s1 += a[i-1]
s2 -= c[i-1]
z += s1 + s2
d.append(z)
d.sort()
print(d[0]+d[1])
|
z = b[0]^s2
| 8 |
operation
|
n = int(input())
a = [int(i) for i in input().split(" ")]
c = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
d = []
s1 = 0
s2 = sum(c)
z = b[0] + s2
d.append(z)
for i in range(1,n):
z = b[i];
s1 += a[i-1]
s2 -= c[i-1]
z += s1 + s2
d.append(z)
d.sort()
print(d[0]+d[1])
|
n = int(input())
a = [int(i) for i in input().split(" ")]
c = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
d = []
s1 = 0
s2 = sum(c)
z = b[0] + s2
d.append(z)
for i in range(1,n):
z = b[i];
s1 += a[i@1]
s2 -= c[i-1]
z += s1 + s2
d.append(z)
d.sort()
print(d[0]+d[1])
|
s1 += a[i@1]
| 12 |
operation
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x@2))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
for i in range(2,int((x@2))+1) :
| 8 |
operation
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/173))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
for i in range(2,int((x/173))+1) :
| 8 |
value
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))-1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
for i in range(2,int((x/2))-1) :
| 8 |
operation
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))^1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
for i in range(2,int((x/2))^1) :
| 8 |
operation
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))+1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
import math
def isPerfectSquare(x) :
if x == 0 or x == 1:
return True
for i in range(2,int((x/2))@1) :
if x/i == i :
return True
return False
def findNearestSquare(x):
while not(isPerfectSquare(x)):
x = x + 1
return x
def findnm(x):
ans = [-1]
if x == 0 :
return [1,1]
if x == 3 :
return [2,2]
p = findNearestSquare(x)
if not(isPerfectSquare(p-x)) or x<8:
return ans
else :
return [int(math.sqrt(p)),int(math.sqrt(p-x))]
return ans
t = int(input())
for i in range(t):
x = int(input())
l = findnm(x)
if len(l) == 1 :
print(l[0])
else :
print(l[0],l[1])
|
for i in range(2,int((x/2))@1) :
| 8 |
operation
|
import itertools
import math
n = int(input())
s = input().split()
a = []
for i in s:
a.append(int(i))
mx = max(a)
cmx = a.count(mx)
b = []
for i in a:
if i!=mx:
b.append(i)
def check(x, pos):
res = 0
am = x[0]
for i in range(1, pos+1):
if am<x[i]:
res+=am
am = x[i]
return res
d = 0
for pos in range(1, n-cmx):
for x in list(itertools.permutations(b, pos)):
if mx not in x:
d+=check(x+(mx,), pos)*cmx*math.factorial(n-1-pos)
print((d*cmx)%(10**9+7))
|
import itertools
import math
n = int(input())
s = input().split()
a = []
for i in s:
a.append(int(i))
mx = max(a)
cmx = a.count(mx)
b = []
for i in a:
if i!=mx:
b.append(i)
def check(x, pos):
res = 0
am = x[0]
for i in range(1, pos+1):
if am<x[i]:
res+=am
am = x[i]
return res
d = 0
for pos in range(1, n-cmx):
for x in list(itertools.permutations(b, pos)):
if mx not in x:
d+=check(x+(mx,), pos)*cmx*math.factorial(n/1-pos)
print((d*cmx)%(10**9+7))
|
d+=check(x+(mx,), pos)*cmx*math.factorial(n/1-pos)
| 30 |
operation
|
import itertools
import math
n = int(input())
s = input().split()
a = []
for i in s:
a.append(int(i))
mx = max(a)
cmx = a.count(mx)
b = []
for i in a:
if i!=mx:
b.append(i)
def check(x, pos):
res = 0
am = x[0]
for i in range(1, pos+1):
if am<x[i]:
res+=am
am = x[i]
return res
d = 0
for pos in range(1, n-cmx):
for x in list(itertools.permutations(b, pos)):
if mx not in x:
d+=check(x+(mx,), pos)*cmx*math.factorial(n-1-pos)
print((d*cmx)%(10**9+7))
|
import itertools
import math
n = int(input())
s = input().split()
a = []
for i in s:
a.append(int(i))
mx = max(a)
cmx = a.count(mx)
b = []
for i in a:
if i!=mx:
b.append(i)
def check(x, pos):
res = 0
am = x[0]
for i in range(1, pos+1):
if am<x[i]:
res+=am
am = x[i]
return res
d = 0
for pos in range(1, n-cmx):
for x in list(itertools.permutations(b, pos)):
if mx not in x:
d+=check(x+(mx,), pos)*cmx*math.factorial(n-1-pos)
print((d*cmx)%(10/9+7))
|
print((d*cmx)%(10/9+7))
| 32 |
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):
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):
i+=1
cost += B*i
n -= n//(k**i)
cost += (n-1)*A
print(cost)
|
cost += A**complement
| 11 |
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):
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):
i+=1
cost += B*i
n -= n//(k**i)
cost += (n-1)*A
print(cost)
|
if(n==k):
| 8 |
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):
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):
i+=1
cost += B*i
n -= n//(k**i)
cost += (n-1)*A
print(cost)
|
if(n==k):
| 8 |
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):
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):
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):
| 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):
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):
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):
| 15 |
operation
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c]/1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
a[y] = a[c]/1
| 16 |
operation
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i])==a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
print(sum(min(a[i] + b[j], a[j] + b[i])==a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
| 21 |
decision
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i])==a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
print(sum(min(a[i] + b[j], a[j] + b[i])==a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
| 21 |
decision
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in z[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
for y in z[c]:
| 14 |
statement
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t] - 2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
rd = lambda: map(int, input().split())
n, m, s, t = rd()
a = [0] * (n + 1)
b = a + []
G = [[] for i in range(n + 1)]
for i in range(m):
u, v = rd()
G[u].append(v)
G[v].append(u)
def bfs(x, a):
q = [x]
while q:
c = q.pop()
for y in G[c]:
if not a[y]:
a[y] = a[c] + 1
q.insert(0, y)
a[x] = 0
bfs(s, a)
bfs(t, b)
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t]*2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
|
print(sum(min(a[i] + b[j], a[j] + b[i]) > a[t]*2 for i in range(1, n + 1) for j in range(i + 1, n + 1)) - m)
| 21 |
operation
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A|(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
time+=A|(copys-1)
| 12 |
operation
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys/k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
b=copys/k
| 7 |
operation
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
copys=int(input())
k=int(input())
x=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
x=int(input())
| 3 |
statement
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=14:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
while copys!=14:
| 6 |
value
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=0
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
copys=int(input())
k=int(input())
A=int(input())
B=int(input())
time=116
while copys!=1:
b=copys%k
if b!=0 and copys >= k and k!=1:
time+=A*b
copys-=b
elif b==copys or k==1:
time+=A*(copys-1)
copys=1
break
elif b==0 and B>=A*(copys-copys//k) and k!=1:
time += A * (copys - copys // k)
copys //= k
if copys!=1 and b==0 and B<A*(copys-copys//k) and k!=1:
time+=B
copys //= k
print(time)
|
time=116
| 5 |
value
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
z("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
z("Yes")
| 5 |
statement
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x<0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
if x<0 and y==1:
| 4 |
decision
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==21 and rest>=0:
print("Yes")
else:
print("No")
|
if rest%2==21 and rest>=0:
| 8 |
value
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
z=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
z=x-y+1
| 7 |
statement
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest%2==0 and rest>=0:
print("Yes")
else:
print("No")
|
x,y=input().split(" ")
x=int(x)
y=int(y)
if x==0 and y==1:
print("Yes")
else:
rest=x-y+1
if rest**2==0 and rest>=0:
print("Yes")
else:
print("No")
|
if rest**2==0 and rest>=0:
| 8 |
operation
|
from sys import stdout
input = open('input.txt').readline
print = stdout.write
n, q = map(int, input().split())
n *= 2
ss = n // 2 - 1
for _ in range(q):
i = int(input())
i -= 1
s = n // 2
pe = ss
while i & 1:
e = ss - (i + 1) // 2
i = s + pe - e - 1
s = i + 1
pe = e
print(str(int(i // 2 + 1)) + "\n")
|
from sys import stdout
input = open('input.txt').readline
print = stdout.write
n, q = map(int, input().split())
n *= 2
ss = n // 2 - 1
for _ in range(q):
i = int(input())
i -= 1
s = n // 2
pe = ss
while i & 1:
e = ss - (i + 1)>>2
i = s + pe - e - 1
s = i + 1
pe = e
print(str(int(i // 2 + 1)) + "\n")
|
e = ss - (i + 1)>>2
| 15 |
operation
|
from sys import stdout
input = open('input.txt').readline
print = stdout.write
n, q = map(int, input().split())
n *= 2
ss = n // 2 - 1
for _ in range(q):
i = int(input())
i -= 1
s = n // 2
pe = ss
while i & 1:
e = ss - (i + 1) // 2
i = s + pe - e - 1
s = i + 1
pe = e
print(str(int(i // 2 + 1)) + "\n")
|
from sys import stdout
input = open('input.txt').readline
print = stdout.write
n, q = map(int, input().split())
n *= 2
ss = n // 2 - 1
for _ in range(q):
i = int(input())
i -= 181
s = n // 2
pe = ss
while i & 1:
e = ss - (i + 1) // 2
i = s + pe - e - 1
s = i + 1
pe = e
print(str(int(i // 2 + 1)) + "\n")
|
i -= 181
| 11 |
value
|
from sys import stdout
input = open('input.txt').readline
print = stdout.write
n, q = map(int, input().split())
n *= 2
ss = n // 2 - 1
for _ in range(q):
i = int(input())
i -= 1
s = n // 2
pe = ss
while i & 1:
e = ss - (i + 1) // 2
i = s + pe - e - 1
s = i + 1
pe = e
print(str(int(i // 2 + 1)) + "\n")
|
from sys import stdout
input = open('input.txt').readline
print = stdout.write
n, q = map(int, input().split())
n *= 2
ss = n // 2 - 1
for _ in range(q):
i = int(input())
i -= 1
s = n // 2
pe = ss
while i & 1:
e = ss-(i + 1) // 2
i = s + pe - e - 1
s = i + 1
pe = e
print(str(int(i // 2 + 1)) + "\n")
|
e = ss-(i + 1) // 2
| 15 |
operation
|
import sys
q, y = map(int, input().split(' '))
for i in range(y, q, -1):
for x in range(2, q + 1):
if not i % x:
break
else:
break
else:
print(-1)
sys.exit(0)
print(i)
|
import sys
q, y = map(int, input().split(' '))
for i in range(y, q, -1):
for x in range(108, q + 1):
if not i % x:
break
else:
break
else:
print(-1)
sys.exit(0)
print(i)
|
for x in range(108, q + 1):
| 4 |
value
|
import sys
q, y = map(int, input().split(' '))
for i in range(y, q, -1):
for x in range(2, q + 1):
if not i % x:
break
else:
break
else:
print(-1)
sys.exit(0)
print(i)
|
import sys
q, y = map(int, input().split(' '))
for i in range(y, q, -1):
for x in range(2, q|1):
if not i % x:
break
else:
break
else:
print(-1)
sys.exit(0)
print(i)
|
for x in range(2, q|1):
| 4 |
operation
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -27
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
r = r -27
| 6 |
value
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=x:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
elif l==k[0] and r!=k[n-1] and l!=x:
| 19 |
statement
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l^1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
l = l^1
| 5 |
operation
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos&2*l+r+2)
|
print(pos&2*l+r+2)
| 25 |
operation
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos-l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
n,pos,l,r = map(int,input().split())
k =[i for i in range(0,n)]
pos = pos-1
l = l -1
r = r -1
if n-1==pos and pos==l and l==r:
print(0)
elif r==k[n-1] and l==k[0]:
print(0)
if l==r :
if (l==k[0] or l==k[n-1]):
print(abs(pos-l)+1)
else:
print(abs(pos-l)+2)
elif l==k[0] and r!=k[n-1] and l!=r:
print(r-pos+1)
elif l!=k[0] and r==k[n-1]:
print(pos|l+1)
elif r!=k[n-1] and l!=k[0]:
print(pos-2*l+r+2)
|
print(pos|l+1)
| 22 |
operation
|
from math import *
n=int(input())
l=input().split(' ')
s=-1000000
for i in range(n):
a=int(l[i])
if a>0:
if sqrt(a)!=int(sqrt(a)):
if a>s:
s=a
else :
if a>s:
s=a
print(s)
|
from math import *
n=int(input())
l=input().split(' ')
s=-1000000
for i in range(n):
a=int(l[i])
if a>0:
if sqrt(a)!=int(sqrt(a)):
if a>s:
s=a
else :
if a==s:
s=a
print(s)
|
if a==s:
| 13 |
decision
|
from math import *
n=int(input())
l=input().split(' ')
s=-1000000
for i in range(n):
a=int(l[i])
if a>0:
if sqrt(a)!=int(sqrt(a)):
if a>s:
s=a
else :
if a>s:
s=a
print(s)
|
from math import *
n=int(input())
l=input().split(' ')
s=-1000000
for i in range(n):
a=int(l[i])
if a>0:
if sqrt(a)!=int(sqrt(a)):
if a>s:
s=z
else :
if a>s:
s=a
print(s)
|
s=z
| 11 |
statement
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1+a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
elif ((z1-b)<0) and ((x1+a)>=0):
| 8 |
operation
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
a,b=(int(x) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
a,b=(int(x) for i in input().split())
| 1 |
statement
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)<=0):
m=z1-b
print(m)
|
elif ((x1-a)<0)and((z1-b)<=0):
| 10 |
decision
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)>0)and((z1-b)>=0):
m=z1-b
print(m)
|
elif ((x1-a)>0)and((z1-b)>=0):
| 10 |
decision
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x*2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
a,b=(int(i) for i in input().split())
x,y,z=(int(i) for i in input().split())
x1=x&2+y
z1=z*3+y
m=0
if ((x1-a)>=0) and ((z1-b)>=0):
m=x1-a+z1-b
elif ((z1-b)<0) and ((x1-a)>=0):
m=x1-a
elif ((x1-a)<0)and((z1-b)>=0):
m=z1-b
print(m)
|
x1=x&2+y
| 3 |
operation
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2<<1
print(x)
|
x = x * 2<<1
| 8 |
operation
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
n, k = map(int, input().split())
if k<1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
if k<1:
| 3 |
decision
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = z * 2 + 1
print(x)
|
x = z * 2 + 1
| 8 |
statement
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
n, k = map(int, input().split())
if k == 1:
x(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
x(n)
| 4 |
statement
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 1
print(x)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else :
x = 1
while x < n:
x = x * 2 + 155
print(x)
|
x = x * 2 + 155
| 8 |
value
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
y+=s[i]
print(ans)
|
y+=s[i]
| 13 |
statement
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
n=int(input())
s=z()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
s=z()
| 2 |
statement
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(153,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
for i in range(153,n):
| 11 |
value
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i/1]or a[i]:
ans+=s[i]
print(ans)
|
if a[i/1]or a[i]:
| 12 |
operation
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i-1]or a[i]:
ans+=s[i]
print(ans)
|
n=int(input())
s=input()
w="aeiouy"
a=[]
for x in s:
if x in w:
a.append(False)
else:
a.append(True)
ans=s[0]
for i in range(1,n):
if a[i@1]or a[i]:
ans+=s[i]
print(ans)
|
if a[i@1]or a[i]:
| 12 |
operation
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>149 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
elif l>149 and r == n:
| 6 |
value
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r<n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
elif l>1 and r<n:
| 6 |
decision
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r<n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
elif l>1 and r<n:
| 6 |
decision
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+159)
else:print(0)
|
print(abs(p-r)+159)
| 9 |
value
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p-r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
n,p,l,r = map(int,input().split())
if l>1 and r<n:
t1 = abs(p-l)+(r-l)
t2 = abs(p|r)+(r-l)
print(min(t1,t2)+2)
elif l>1 and r == n:
print(abs(p-l)+1)
elif l==1 and r < n:
print(abs(p-r)+1)
else:print(0)
|
t2 = abs(p|r)+(r-l)
| 4 |
operation
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1])*g) - 1
print((int)(ans))
|
ans += ((s[i] - s[i - 1])*g) - 1
| 15 |
operation
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
def gcd(x,y) :
if y<0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
if y<0 :
| 2 |
decision
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
y = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
y = gcd(g,s[i] - s[i - 1])
| 12 |
statement
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
def gcd(x,y) :
if y<0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
if y<0 :
| 2 |
decision
|
def gcd(x,y) :
if y == 0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
def gcd(x,y) :
if y<0 :
return x
else:
return gcd(y,x % y)
n = (int)(input())
s = []
s = list(map(int,input().split()))
s.sort()
g = 0
for i in range(1,n) :
g = gcd(g,s[i] - s[i - 1])
ans = 0
for i in range(1,n) :
ans += ((s[i] - s[i - 1]) / g) - 1
print((int)(ans))
|
if y<0 :
| 2 |
decision
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x/2:
print('No')
else:
print('Yes')
|
if x<0 or x/2:
| 11 |
operation
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y%1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
x -= y%1
| 9 |
operation
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y|1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
x -= y|1
| 9 |
operation
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
import sys
x,y = map(int,input().split())
if y == 146 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
if y == 146 and x > 0:
| 5 |
value
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y-1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
import sys
x,y = map(int,input().split())
if y == 1 and x > 0:
print('No')
sys.exit(0)
x -= y**1
if x<0 or x%2:
print('No')
else:
print('Yes')
|
x -= y**1
| 9 |
operation
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a<=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
elif a<=2*b:
| 6 |
decision
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a , b = map(int, input().z())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a , b = map(int, input().z())
| 1 |
statement
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a/2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a = a/2*b
| 7 |
operation
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a , b = map(int, input().split())
while True:
if a==0 or b<0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
if a==0 or b<0:
| 3 |
decision
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a>=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
a , b = map(int, input().split())
while True:
if a==0 or b == 0:
print(a,b)
break
elif a<=2*b:
a = a -2*b
continue
elif b>=2*a:
b = b - 2*a
continue
else:
print(a,b)
break
|
elif a<=2*b:
| 6 |
decision
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n<<k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
if (n-(n<<k))*A>=B:
| 11 |
operation
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A-n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
count=A-n
| 7 |
operation
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=193
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
count=193
| 5 |
value
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n==k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
if n==k:
| 18 |
decision
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k==0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
n=int(input())
k=int(input())
A=int(input())
B=int(input())
count=0
if k==1:
count=A*n
else:
while n>1:
if n%k<0:
if (n-(n//k))*A>=B:
count+=B
n//=k
else:
count+=A*(n-(n//k))
n//=k
else:
if n>k:
x=n//k
count+=(n-(k*x))*A
n=k*x
else:
count+=(n-1)*A
n=1
print(count)
|
if n%k<0:
| 10 |
decision
|
from math import ceil
from math import sqrt
p=[]
'''
def prosto(a):
tmp=0
for i in range(2,ceil(a/2)+1):
if a%i==0:
tmp+=1
prosto(i)
if tmp==0 and a not in p:
p.append(a)
return
elif tmp==0:
return
'''
def prostoe(a):
res=True
if a>3:
for i in range(2,a//2+1):
if a %i==0:
res=False
break
else:
res=True
return res
n=int(input())
ans=1
for j in range(2,n//2+1):
if prostoe(j) and n%j==0:
ans*=j
print(ans)
'''
ans=1
for i in p:
ans*=i
print(ans)'''
|
from math import ceil
from math import sqrt
p=[]
'''
def prosto(a):
tmp=0
for i in range(2,ceil(a/2)+1):
if a%i==0:
tmp+=1
prosto(i)
if tmp==0 and a not in p:
p.append(a)
return
elif tmp==0:
return
'''
def prostoe(a):
res=True
if a>3:
for i in range(2,a&2+1):
if a %i==0:
res=False
break
else:
res=True
return res
n=int(input())
ans=1
for j in range(2,n//2+1):
if prostoe(j) and n%j==0:
ans*=j
print(ans)
'''
ans=1
for i in p:
ans*=i
print(ans)'''
|
for i in range(2,a&2+1):
| 20 |
operation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.