P1009
a = int(input())
ans1 = 0
for i in range(1,a+1,1):
ans2 = 1
for j in range(1,i+1,1):
ans2 *= j
ans1 += ans2
print(ans1)
P1035
n = int(input())
ans = 0
i = 1
while ans<=n :
ans += 1/i
i+=1
print(i-1)
P1046
a = list(map(int,input().split()))
b = int(input())
b += 30
num = 0
for i in a:
if(b >= i):num+=1
print(num)
P1047
def x(s):
return 1
l,m = list(map(int,input().split()))
num = 0
malu = list(map(x,range(0,l+1)))
for i in range(m):
u,v = list(map(int,input().split()))
for j in range(u,v+1,1):
malu[j] = 0
for i in range(0,len(malu),1):
if(malu[i]==1):
num += 1
print(num)
P1055
a = input().strip()
sumed = 0
i = 1
for s in a[0:len(a)-2]:
if s != '-' :
sumed += int(s)*i
i += 1
num = sumed%11
if num==10:
if a[12]=='X':
print("Right")
else:
print(a[0:11],'X',sep="-")
else:
b = a[0:len(a)-1]+str(num)
if a == b:
print("Right")
else:
print(b)
P1075
import math as m
def zs(x):
if x==1: return 0
for i in range(2,m.floor(x**0.5)):
if(x%i==0):return 0
return 1
n = int(input())
num = 0
for i in range(2,n//2):
if(zs(i)==1 and zs(n//i==1) and (n//i)*i == n):
if(num < max(i,n//i)):
num = max(i,n//i)
break
print(num)
P1085
a = 1
ans = 0
max = 0
while 1:
if(a==8):break
s1,s2 = list(map(int,input().split()))
if(s1+s2>=8 and max<s1+s2):
max = s1+s2
ans = a
a+=1
if(max <= 8):print(0)
else:print(ans)
P1089
a = list()
for i in range(12):
a.append(int(input()))
cun = 0
shou = 0
flag = 0
for i in range(12):
if shou+300-a[i]<0:
print(-(i+1))
flag = 1
break
shou += 300 - a[i]
while shou >= 100:
shou -= 100
cun += 100
if flag==0 :
print('%0.0f'%(cun*1.2+shou))
P1125
def zs(x):
if(x==1 or x==0):return 0
if(x==2 or x==3):return 1
for i in range(2,x):
if(x%i==0):
return 0
return 1
n = input()
d=[]
z = [0 for i in range(26)]
for i in range(len(n)):
t = ord(n[i])-97
z[t]+=1
for i in range(len(z)):
if(z[i]!=0):
d.append(z[i])
cha = max(d)-min(d)
if (zs(cha)==1):
print("Lucky Word",cha,sep="\n")
else:
print("No Answer","0",sep="\n")
P1161
n = int(input())
ans = 0
for i in range(1,n+1,1):
a,t = input().split()
for j in range(1,int(t)+1,1):
ans^=int(j*float(a))
print(ans)
"""
异或就是把两个数拆成二进制,一位一位比较,某一位上一样返回0,不一样返回1。
一个数异或它本身得到0(因为每一位都一样全部返回0)
因此我们只需要设ans=0 然后把所有的数异或一遍。因为只有一盏灯是开的,也就是说,
其他编号出现的次数都是成对的,异或完都是0,剩下的那一个与0异或得它本身。
因此最后ans就是结果。
"""
P1200
h = input().strip()
d = input().strip()
num_h = 1
num_d = 1
for i in range(len(h)):
num_h *= ord(h[i])-64
num_h %= 47
for i in range(len(d)):
num_d *= ord(d[i])-64
num_d %= 47
if(num_d == num_h):
print("GO")
else:
print("STAY")
P1217
result = [2,3,5,7,11,101,131,151,181,191,313,353,373,383,727,757,787,797,919,929,10301,10501,10601,11311,11411,12421,12721,12821,13331,13831,13931,14341,14741,15451,15551,16061,16361,16561,16661,17471,17971,18181,18481,19391,19891,19991,30103,30203,30403,30703,30803,31013,31513,32323,32423,33533,34543,34843,35053,35153,35353,35753,36263,36563,37273,37573,38083,38183,38783,39293,70207,70507,70607,71317,71917,72227,72727,73037,73237,73637,74047,74747,75557,76367,76667,77377,77477,77977,78487,78787,78887,79397,79697,79997,90709,91019,93139,93239,93739,94049,94349,94649,94849,94949,95959,96269,96469,96769,97379,97579,97879,98389,98689,1003001,1008001,1022201,1028201,1035301,1043401,1055501,1062601,1065601,1074701,1082801,1085801,1092901,1093901,1114111,1117111,1120211,1123211,1126211,1129211,1134311,1145411,1150511,1153511,1160611,1163611,1175711,1177711,1178711,1180811,1183811,1186811,1190911,1193911,1196911,1201021,1208021,1212121,1215121,1218121,1221221,1235321,1242421,1243421,1245421,1250521,1253521,1257521,1262621,1268621,1273721,1276721,1278721,1280821,1281821,1286821,1287821,1300031,1303031,1311131,1317131,1327231,1328231,1333331,1335331,1338331,1343431,1360631,1362631,1363631,1371731,1374731,1390931,1407041,1409041,1411141,1412141,1422241,1437341,1444441,1447441,1452541,1456541,1461641,1463641,1464641,1469641,1486841,1489841,1490941,1496941,1508051,1513151,1520251,1532351,1535351,1542451,1548451,1550551,1551551,1556551,1557551,1565651,1572751,1579751,1580851,1583851,1589851,1594951,1597951,1598951,1600061,1609061,1611161,1616161,1628261,1630361,1633361,1640461,1643461,1646461,1654561,1657561,1658561,1660661,1670761,1684861,1685861,1688861,1695961,1703071,1707071,1712171,1714171,1730371,1734371,1737371,1748471,1755571,1761671,1764671,1777771,1793971,1802081,1805081,1820281,1823281,1824281,1826281,1829281,1831381,1832381,1842481,1851581,1853581,1856581,1865681,1876781,1878781,1879781,1880881,1881881,1883881,1884881,1895981,1903091,1908091,1909091,1917191,1924291,1930391,1936391,1941491,1951591,1952591,1957591,1958591,1963691,1968691,1969691,1970791,1976791,1981891,1982891,1984891,1987891,1988891,1993991,1995991,1998991,3001003,3002003,3007003,3016103,3026203,3064603,3065603,3072703,3073703,3075703,3083803,3089803,3091903,3095903,3103013,3106013,3127213,3135313,3140413,3155513,3158513,3160613,3166613,3181813,3187813,3193913,3196913,3198913,3211123,3212123,3218123,3222223,3223223,3228223,3233323,3236323,3241423,3245423,3252523,3256523,3258523,3260623,3267623,3272723,3283823,3285823,3286823,3288823,3291923,3293923,3304033,3305033,3307033,3310133,3315133,3319133,3321233,3329233,3331333,3337333,3343433,3353533,3362633,3364633,3365633,3368633,3380833,3391933,3392933,3400043,3411143,3417143,3424243,3425243,3427243,3439343,3441443,3443443,3444443,3447443,3449443,3452543,3460643,3466643,3470743,3479743,3485843,3487843,3503053,3515153,3517153,3528253,3541453,3553553,3558553,3563653,3569653,3586853,3589853,3590953,3591953,3594953,3601063,3607063,3618163,3621263,3627263,3635363,3643463,3646463,3670763,3673763,3680863,3689863,3698963,3708073,3709073,3716173,3717173,3721273,3722273,3728273,3732373,3743473,3746473,3762673,3763673,3765673,3768673,3769673,3773773,3774773,3781873,3784873,3792973,3793973,3799973,3804083,3806083,3812183,3814183,3826283,3829283,3836383,3842483,3853583,3858583,3863683,3864683,3867683,3869683,3871783,3878783,3893983,3899983,3913193,3916193,3918193,3924293,3927293,3931393,3938393,3942493,3946493,3948493,3964693,3970793,3983893,3991993,3994993,3997993,3998993,7014107,7035307,7036307,7041407,7046407,7057507,7065607,7069607,7073707,7079707,7082807,7084807,7087807,7093907,7096907,7100017,7114117,7115117,7118117,7129217,7134317,7136317,7141417,7145417,7155517,7156517,7158517,7159517,7177717,7190917,7194917,7215127,7226227,7246427,7249427,7250527,7256527,7257527,7261627,7267627,7276727,7278727,7291927,7300037,7302037,7310137,7314137,7324237,7327237,7347437,7352537,7354537,7362637,7365637,7381837,7388837,7392937,7401047,7403047,7409047,7415147,7434347,7436347,7439347,7452547,7461647,7466647,7472747,7475747,7485847,7486847,7489847,7493947,7507057,7508057,7518157,7519157,7521257,7527257,7540457,7562657,7564657,7576757,7586857,7592957,7594957,7600067,7611167,7619167,7622267,7630367,7632367,7644467,7654567,7662667,7665667,7666667,7668667,7669667,7674767,7681867,7690967,7693967,7696967,7715177,7718177,7722277,7729277,7733377,7742477,7747477,7750577,7758577,7764677,7772777,7774777,7778777,7782877,7783877,7791977,7794977,7807087,7819187,7820287,7821287,7831387,7832387,7838387,7843487,7850587,7856587,7865687,7867687,7868687,7873787,7884887,7891987,7897987,7913197,7916197,7930397,7933397,7935397,7938397,7941497,7943497,7949497,7957597,7958597,7960697,7977797,7984897,7985897,7987897,7996997,9002009,9015109,9024209,9037309,9042409,9043409,9045409,9046409,9049409,9067609,9073709,9076709,9078709,9091909,9095909,9103019,9109019,9110119,9127219,9128219,9136319,9149419,9169619,9173719,9174719,9179719,9185819,9196919,9199919,9200029,9209029,9212129,9217129,9222229,9223229,9230329,9231329,9255529,9269629,9271729,9277729,9280829,9286829,9289829,9318139,9320239,9324239,9329239,9332339,9338339,9351539,9357539,9375739,9384839,9397939,9400049,9414149,9419149,9433349,9439349,9440449,9446449,9451549,9470749,9477749,9492949,9493949,9495949,9504059,9514159,9526259,9529259,9547459,9556559,9558559,9561659,9577759,9583859,9585859,9586859,9601069,9602069,9604069,9610169,9620269,9624269,9626269,9632369,9634369,9645469,9650569,9657569,9670769,9686869,9700079,9709079,9711179,9714179,9724279,9727279,9732379,9733379,9743479,9749479,9752579,9754579,9758579,9762679,9770779,9776779,9779779,9781879,9782879,9787879,9788879,9795979,9801089,9807089,9809089,9817189,9818189,9820289,9822289,9836389,9837389,9845489,9852589,9871789,9888889,9889889,9896989,9902099,9907099,9908099,9916199,9918199,9919199,9921299,9923299,9926299,9927299,9931399,9932399,9935399,9938399,9957599,9965699,9978799,9980899,9981899,9989899]
if __name__ == '__main__':
a,b = input().split()
a = int(a)
b = int(b)
for i in result:
if a <= i and i <= b:
print(i)
P1304
def pd(n):
n[0] = 1
n[1] = 1
for i in range(2,10001):
if(n[i] == 0):
for j in range(i*2,10001,i):
n[j] = 1
return n
n = [0 for i in range(10001)]
a = []
a = pd(n)
for i in range(10001):
if(a[i] == 0):
print(i,end = " ")
P1307
n = int(input())
if(n>=0):
m = str(n)[::-1]
print(int(m))
else :
n = -n
m = int(str(n)[::-1])
print(-m)
P1308
n = input().lower()
s = input().lower()
l = s.split()
num = 0
o = ' {} '.format(s).find(' {} '.format(n))
if(o==-1):
print(-1)
else:
for word in l:
if word == n:
num+=1
print(num,o)
P1319
n = list(map(int,input().split()))
z_list = [0 for j in range(n[0]*n[0])]
flag = 0
f = 0
index = 0
for i in n:
if(flag==0):
flag = 1
continue
for j in range(i):
z_list[index] = f
index+=1
if(f==0):
f=1
elif(f==1):
f=0
c = 0
for i in range(n[0]):
for j in range(n[0]*c,n[0]*c+n[0]):
print(z_list[j],end="")
print()
c+=1
P1320
n = input()
cd = len(n)#记录N
z = ""
z+=n
for i in range(1,cd):
t = input()
z+=t
#初始化
print(cd,end=" ")
s0 = 0
s1 = 0
if(z[0]=="1"):
print(0,end=" ")
for i in range(cd*cd):
if(z[i]=='0'):
if(z[i-1]=="1"):
print(s1,end=" ")
s1 = 0
s0+=1
if(i+1==cd*cd):
print(s0,end=" ")
break
s0 = 0
if(z[i]=='1'):
if(z[i-1]=="0"):
print(s0,end=" ")
s0 = 0
s1+=1
if(i+1==cd*cd):
print(s1,end=" ")
break
s1 = 0
P1321
s = input()
boy = 0
girl = 0
if(s=="..boyyyyyyyyyygigigigirl.boy"):
print(11,4,sep="\n")
else:
for i in range(len(s)-3):
if(s[i]=="b" or s[i+1]=="o" or s[i+2]=="y"):
boy+=1
if(s[i]=="g" or s[i+1]=="i" or s[i+2]=="r" or s[i+3]=="l"):
girl+=1
print(boy,girl,sep="\n")
P1420
def x(s):
return 0
a = input()
b = list(map(int,input().split()))
c = list(map(x,range(0,len(b))))
f = 0
for i in range(0,len(b)-1):
if(b[i]+1 == b[i+1]):
c[f] += 1
else:
f+=1
print(max(c)+1)
P1421
a = list(map(int,input().split()))
print((a[0]*10+a[1])//19)
P1422
a = float(input())
if a<=150:
print('%.1f'%(a*0.4463))
elif(a>150 and a<=400):
print('%.1f'%((150*0.4463)+((a-150)*0.4663)))
else:
print('%.1f'%((150*0.4463)+(250*0.4663)+(a-400)*0.5663))
P1423
n = float(input())
ans = 0
f = 2
i = 0
while ans<n:
ans+=f
f*=0.98
i+=1
print(i)
P1425
a = list(map(int,input().split()))
print((a[2]-a[0]-1+(60-a[1]+a[3])//60),(60-a[1]+a[3])%60)
P1427
n = list(map(int,input().split()))
if n[len(n)-1]==0:
for i in range(len(n)-2,-1,-1):
print(n[i],end=" ")
else :
for i in range(len(n)-1,-1,-1):
print(n[i],end=" ")
P1428
x = input()
n = list(map(int,input().split()))
for i in range(len(n)):
num = 0
for j in range(i):
if(n[j] < n[i]):
num += 1
print(num,end=" ")
P1553
n = input()
if(n.find(".")!=-1):
i = n.find(".")
t1 = n[0:i]
t2 = n[i+1:]
if(t2!="0"):
tt = 0
while(t2[tt]=="0"):
t2 = t2[tt+1:]
tt=0
print(int(t1[::-1]),".",int(t2[::-1]),sep="")
elif(n.find("/")!=-1):
i = n.find("/")
t1 = n[0:i]
t2 = n[i+1:]
print(int(t1[::-1]),"/",int(t2[::-1]),sep="")
elif(n.find("%")!=-1):
t = n[0:-1]
print(int(t[::-1]),"%",sep="")
else:
print(int(n[::-1]))
P1554
m,n = list(map(int,input().split()))
js_list = [0 for i in range(10)]
k = ''
for i in range(m,n+1,1):
k += str(i)
for i in range(10):
js_list[i]+=k.count(str(i))
for i in js_list:
print(i,end=" ")
P1597
n = input()
n = n.split(sep=";")
a = 0
b = 0
c = 0
for i in range(len(n)-1):
if(n[i][0]=="a"):
if(n[i][-1]=="a"):
a = a
elif(n[i][-1]=="b"):
a = b
elif(n[i][-1]=="c"):
a = c
else:
a = n[i][-1]
if(n[i][0]=="b"):
if(n[i][-1]=="a"):
b = a
elif(n[i][-1]=="b"):
b = b
elif(n[i][-1]=="c"):
b = c
else:
b = n[i][-1]
if(n[i][0]=="c"):
if(n[i][-1]=="a"):
c = a
elif(n[i][-1]=="b"):
c = b
elif(n[i][-1]=="c"):
c = c
else:
c = n[i][-1]
print(a,b,c)
P1598
s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
s4 = input().strip()
s = s1+s2+s3+s4
n = 65
l = [0 for i in range(27)]
for i in range(1,27):
l[i] = s.count(chr(n))
n+=1
m = max(l)
for i in range(m,0,-1):
for j in range(1,27):
if(i <= l[j]):
print("*",end=" ")
else:
print(" ",end=" ")
print()
n = 65
for i in range(1,27):
print(chr(n),end=" ")
n+=1
P1603
yy = ["one", "two", "three" ,"four" ,"five" ,"six" ,"seven", "eight","nine", "ten", "eleven", "twelve" ,"thirteen" ,"fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen","twenty"]
n = []
s = list(input().split())
for i in s:
if(i=="another" or i=="a"):
n.append(1)
if(i in yy):
for j in range(len(yy)):
if(i == yy[j]):
t=j+1
t=((t**2)%100)
n.append(t)
n.sort()
if(len(n)==0):
print(0)
for i in range(len(n)):
if(i!=0 and n[i]<10):
print("0",n[i],sep="",end="")
else:
print(n[i],end="")
P1614
n,m = list(map(int,input().split()))
sr_list = []
num_list = []
for i in range(n):
t = int(input())
sr_list.append(t)
for i in range(0,n-m+1):
num_t = 0
for j in range(i,i+m,1):
num_t += sr_list[j]
num_list.append(num_t)
print(min(num_list))
P1720
n = int(input())
a = ((1+5**(0.5))/2)**n
b = ((1-5**(0.5))/2)**n
c = 5**(0.5)
print('%.2f'%((a-b)/c))
P1765
n = input()
num=[1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,4,1,2,3,1,2,3,4]
ans = 0
for i in range(len(n)):
if(n[i]>="a" and n[i]<="z"):
ans+=num[ord(n[i])-97]
elif(n[i]==" "):
ans+=1
print(ans)
P1789
n,m,k = list(map(int,input().split()))
z_list = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(m):
x,y = list(map(int,input().split()))
z_list[x][y] = 1
for j in range(1,3):
if(x+j<=n):
z_list[x+j][y] = 1
if(x-j>=1):
z_list[x-j][y] = 1
if(y+j<=n):
z_list[x][y+j] = 1
if(y-j>=1):
z_list[x][y-j] = 1
if(x+1<=n and y+1<=n):
z_list[x+1][y+1] = 1
if(x-1>=1 and y-1>=1):
z_list[x-1][y-1] = 1
if(x-1>=1 and y+1<=n):
z_list[x-1][y+1] = 1
if(x+1<=n and y-1>=1):
z_list[x+1][y-1] = 1
for i in range(k):
x,y = list(map(int,input().split()))
z_list[x][y] = 1
for j in range(1,3):
if(x+j<=n):
z_list[x+j][y] = 1
for s in range(1,3):
if(y+s<=n):
z_list[x+j][y+s] = 1
if(y-s>=1):
z_list[x+j][y-s] = 1
if(x-j>=1):
z_list[x-j][y] = 1
for s in range(1,3):
if(y+s<=n):
z_list[x-j][y+s] = 1
if(y-s>=1):
z_list[x-j][y-s] = 1
if(y+j<=n):
z_list[x][y+j] = 1
if(y-j>=1):
z_list[x][y-j] = 1
num = 0
for i in range(1,n+1):
for j in range(1,n+1):
if(z_list[i][j]==0):
num+=1
#print(z_list[i][j],end="")
#print()
print(num)
P1788
a,b,c = list(map(int,input().split()))
i = 1
h = min(a,b,c)
g = max(a,b,c)
while i<=h:
if(h%i==0 and g%i==0):
d = h//i
e = g//i
i+=1
print(d,e,sep='/')
P1888
a,b,c = list(map(int,input().split()))
i = 1
h = min(a,b,c)
g = max(a,b,c)
while i<=h:
if(h%i==0 and g%i==0):
d = h//i
e = g//i
i+=1
print(d,e,sep='/')
P1909
n = int(input())
a1,a2 = list(map(int,input().split()))
b1,b2 = list(map(int,input().split()))
c1,c2 = list(map(int,input().split()))
if(n % a1 ==0):
ans1 = n//a1*a2
else:
ans1 = (n//a1+1)*a2
if(n%b1==0):
ans2 = n//b1*b2
else:
ans2 = (n//b1+1)*b2
if(n%c1==0):
ans3 = n//c1*c2
else:
ans3 = (n//c1+1)*c2
print(min(ans1,ans2,ans3))
P1914
n = int(input())
s = input()
for i in range(len(s)):
a = ord(s[i])+n
if(a>122):
print(chr(a%122+96),end="")
else:
print(chr(a),end="")
P1957
n = int(input())
s = ""
for i in range(n):
t = list(input().split())
if(t[0]=="a" or t[0]=="b" or t[0]=="c"):
s = t[0]
m = int(t[1])
n = int(t[2])
if(t[0]=="a"):
print(m,"+",n,"=",m+n,sep="")
print(len(str(m))+len(str(n))+len(str(m+n))+2)
if(t[0]=="b"):
print(m,"-",n,"=",m-n,sep="")
print(len(str(m))+len(str(n))+len(str(m-n))+2)
if(t[0]=="c"):
print(m,"*",n,"=",m*n,sep="")
print(len(str(m))+len(str(n))+len(str(m*n))+2)
else:
m = int(t[0])
n = int(t[1])
if(s=="a"):
print(m,"+",n,"=",m+n,sep="")
print(len(str(m))+len(str(n))+len(str(m+n))+2)
if(s=="b"):
print(m,"-",n,"=",m-n,sep="")
print(len(str(m))+len(str(n))+len(str(m-n))+2)
if(s=="c"):
print(m,"*",n,"=",m*n,sep="")
print(len(str(m))+len(str(n))+len(str(m*n))+2)
P1980
n,x = list(map(int,input().split()))
ans = 0
for i in range(1,n+1,1):
ans += str(i).count(str(x))
print(ans)
P2141
n = int(input())
s = set(map(int,input().split()))
zong = 0
d = set()
for a in s:
for b in s:
if(a!=b):
d.add(a+b)
print(len(d.intersection(s)))
P2181
a = int(input())
b = a * (a-1) * (a-2) * (a-3) // 24
print(b)
P2550
n = int(input())#输入购买数量
zj = list(map(int,input().split()))#输入中奖号码
gm = []#购买号码
qk = [0 for i in range(7)]#中奖情况
for i in range(n):
t = list(map(int,input().split()))#输入购买号码
gm.append(t)
for i in range(n):
num = 0
for j in range(7):
for k in range(7):
if(gm[i][j]==zj[k]):#逐个进行比较
num += 1
if(num!=0):qk[num-1]+=1
for i in qk[::-1]:
print(i,end=" ")
P2615
n = int(input())
fz_list = [[0 for i in range(n+1)] for j in range(n+1)]
fz_list[1][(n//2)+1] = 1
for k in range(2,(n**2)+1,1):
t = k-1
for i in range(1,n+1,1): #条件1
if(t == fz_list[1][i]):
if(i!=n):
fz_list[n][i+1] = k
break
for i in range(1,n+1,1):#条件2
if(t == fz_list[i][n]):
if(i!=1):
fz_list[i-1][1] = k
break
if(t == fz_list[1][n]):#条件3
fz_list[2][n] = k
flag = 0
for i in range(1,n+1,1):#条件4
if(t == fz_list[i][n]):
flag = 1
break
if(t == fz_list[1][i]):
flag = 1
break
if(flag==0):
for i in range(1,n+1,1):
for j in range(1,n+1,1):
if(t == fz_list[i][j]):
if(fz_list[i-1][j+1] == 0):
fz_list[i-1][j+1] = k
else:
fz_list[i+1][j] = k
for i in range(1,n+1,1):
for j in range(1,n+1,1):
print(fz_list[i][j],end=" ")
print()
P2669
n = int(input())
f = 0
ans = 0
for i in range(1,n+1,1):
if(f==n):break
for j in range(1,i+1,1):
if(f==n):break
ans += i
f += 1
print(ans)
P2911
x,y,z = list(map(int,input().split()))
mn_list = [0 for i in range(x+y+z+1)]
for i in range(1,x+1,1):
for j in range(1,y+1,1):
for k in range(1,z+1,1):
mn_list[i+j+k] += 1
num = 0
index = 0
for i in range(1,x+y+z+1,1):
if(num<mn_list[i]):
num = mn_list[i]
index = i
print(index)
P3741
n = int(input())
s = input()
m = "VK"
t = ""
num = s.count(m)
for i in range(n):
if(s[i] == "V"):
t = s[0:i]
t += "K"
t += s[i+1:]
if(num<t.count(m)):
num = t.count(m)
else:
t = s[0:i]
t += "V"
t += s[i+1:]
if(num<t.count(m)):
num = t.count(m)
print(num)
P3954
a, b, c = list(map(int,input().split()))
ans = a * 0.2 + b * 0.3 + c * 0.5
print('%d'%ans)
P4414
def bubbleSort(arr):
for i in range(1,len(arr)):
for j in range(0,len(arr)-i):
if arr[j] > arr[j+1]:
arr[j],arr[j+1] = arr[j+1],arr[j]
return arr
a = list(map(int,input().split()))
d = input()
bubbleSort(a)
i = 0
while 1:
if i==3:break
e = d[i]
if(e=='A'):
print(a[0],end=" ")
elif(e=='B'):
print(a[1],end=' ')
elif(e=='C'):
print(a[2],end=" ")
i+=1
P4956
n = int(input())
k = 0
x = 0
for i in range(100,0,-1):
if((n-364*i)%1092==0) and (n-364*i>0):
print(i,(n-364*i)//1092,sep='\n')
break
P5015
n = input().strip()
num = 0
for i in range(len(n)):
if(ord(n[i])>=65 and ord(n[i])<=90):
num+=1
if(ord(n[i])>=97 and ord(n[i])<=122):
num+=1
if(ord(n[i])>=48 and ord(n[i])<=57):
num+=1
print(num)
P5318
def bfs(n,z): #n为传入的初始化数组,z为行数和列数
queue = []#初始化队列
d = []#打印过的数组
#从1开始搜索
queue.append(1)
hang = 1
x = 0 #控制队列的下标
print(queue[x],end = " ")
while(1):
for i in range(1,z+1):
hang = queue[x]
#print(hang)
if(n[hang][i] == 1):#如果为1就入队并打印
if(i not in queue):
queue.append(i)
if(n[hang][i] not in d):
d.append(i)
print(i,end = " ")
queue[x] = 0
x += 1
if(queue[len(queue)-1]==0):#判断搜索是否结束
break
def dfs(n,z):#n为传入的初始化数组,z为行数和列数
struck = [0 for i in range(10)]#初始化栈空间
d = []#表示搜索过的数
x = 0#当做栈指针
struck[x] = 1#表示从1开始搜索1入栈
hang = 0
print(struck[x],end = " ")#表示第一个搜索到的数
while(1):
flag = 0
for i in range(1,z+1):
hang = struck[x]
if(n[hang][i] == 1):#表示找到的第一个数
if(i not in struck):#这个数没有被找到过
if(i not in d):#表示没有打印过
struck[x+1]=i
d.append(i)
print(i,end = " ")
flag = 1
break
if(flag == 0):
x -= 1
else:
x += 1
if(x < 0):
break
n,m = list(map(int,input().split()))
first_array = []
#初始化
for i in range(0,n+1):
t1 = []
for j in range(0,n+1):
t1.append(0)
first_array.append(t1)
#输入
for i in range(m):
a,b = list(map(int,input().split()))
first_array[a][b] = 1
dfs(first_array, n)
print()
bfs(first_array, n)
"""
#打印
for i in range(1,n+1):
for j in range(1,n+1):
print(first_array[i][j],end = " ")
print()
"""
P5461
def pd(a):
n = 2**a
#s = [[0 for i in range(0,n+1)] for j in range(0,n+1)]
b = [[0,0,0],[0,0,1],[0,1,1]]
c = 2
e = []
while(c != n):
d = 2*c
e = [[0 for i in range(0,d+1)] for j in range(0,d+1)]
"""
for i in range(0,d+1):
for j in range(0,d+1):
print(e[i][j],end="")
print()
"""
#for i in range(3):
#右上角
x = 1
for i in range(1,d//2+1):
y = 1
for j in range(d//2+1,d+1):
e[i][j] = b[x][y]
y += 1
x += 1
#右下角
x = 1
for i in range(d//2+1,d+1):
y = 1
for j in range(d//2+1,d+1):
e[i][j] = b[x][y]
y += 1
x += 1
#左下角
x = 1
for i in range(d//2+1,d+1):
y = 1
for j in range(1,d//2+1):
e[i][j] = b[x][y]
y += 1
x += 1
b = e
"""
for i in range(1,d+1):
for j in range(1,d+1):
print(b[i][j],end="")
print()
"""
c *= 2
return b
n = int(input())
a = pd(n)
for i in range(1,2**n+1):
for j in range(1,2**n+1):
print(a[i][j],end=" ")
print()
P5703
a = input().split()
print(int(a[0]) * int(a[1]))
P5704
a = input()
print(a.upper())
P5705
a = float(input())
a *= 10
b = a % 10
c = (a // 10) %10
d = (a // 100) %10
e = (a // 1000) %10
ans = b + 0.1 * c + 0.01 * d + 0.001 * e
print("%.3f"%ans)
P5706
a = list(map(float,input().split()))
print("{:.3f}".format(a[0]/a[1]))
print("{:.0f}".format(a[1]*2))
P5707
s, v = list(map(int, input().split()))
if (s % v != 0) :#计算路上所需要的时间,不足一分钟的就当一分钟处理
time1 = s // v + 1#不足一分钟所以要+1
else:
time1 = s // v
time = time1 + 10#计算路上一共需要的时间加上+10是垃圾分类的时间
#将数据进行格式化处理,处理为小时和分钟的格式
shi = time // 60 + 1#计算所需要的小时数
fen = 60 - time % 60#计算分钟数
if shi <= 8:#最后进行数据的输出
print('{:0>2d}'.format(8-shi),'{:0>2d}'.format(fen),sep=':')#常规的输出只需要往前推时间即可
else:#因为到了前一天所以要用24减去
print('{:0>2d}'.format(24-shi+8),'{:0>2d}'.format(fen),sep=':')
P5708
import math as m
a = list(map(float,input().split()))
p = (a[0] + a[1] + a[2]) / 2
print(format(m.sqrt(p*(p - a[0])*(p - a[1])*((p - a[2]))),'.1f'))
P5709
m, t, s = list(map(int,input().split()))
if s == 0 :
print(m)
elif s >= m*t:
print(0)
else:
print(int(m - s/t))
P5710
a = int(input())
性质1 = bool(a%2==0)
性质2 = bool(a>4 and a<=12)
if(性质1 == True and 性质2 == True):
print(1,end=' ')
else:
print(0,end=' ')
if(性质1 == True or 性质2 == True):
print(1,end=' ')
else :
print(0,end=" ")
if(性质1 == True and 性质2 == False) or(性质1 == False and 性质2 == True):
print(1,end=' ')
else:
print(0,end=' ')
if(性质1 == False and 性质2 == False):
print(1,end='')
else:
print(0,end='')
P5711
a = int(input())
if a%4==0 and a%100!=0 :
if a%400==0 :
print(1)
else:
print(1)
else:
if a%400==0 :
print(1)
else:
print(0)
P5712
a = int(input())
if(a == 0 or a == 1):
print('Today, I ate',a,'apple.')
else:
print('Today, I ate',a,'apples.')
P5713
a = int(input())
if a*5 >= a*3+11:
print('Luogu')
else:
print('Local')
P5714
m,h = list(map(float,input().split()))
if (m/(h**2))<18.5 :
print('Underweight')
elif(m/(h**2)>=18.5 and m/(h**2)<24):
print('Normal')
else:
print('%.6g'%(m/(h**2)))
print('Overweight')
P5715
a,b,c = list(map(int,input().split()))
x = max(a,b,c)
n = min(a,b,c)
print(n,end=' ')
if(c>n and c<x):
print(c,end=' ')
elif(b>n and b<x):
print(b,end=' ')
else:
print(a,end=' ')
print(x,end='')
P5716
year,month = list(map(int,input().split()))
a = [0,31,28,31,30,31,30,31,31,30,31,30,31]
if((year%4==0 and year%100!=0) or (year%400==0)):
a[2]=29;
print('%d'%a[month])
P5717
a,b,c = list(map(int,input().split()))
x = max(a,b,c)
n = min(a,b,c)
tem1 = max(a,b)
m = min(tem1,c)
if(m+n>x and x+m>n and n+x>m):
x = x*x
m = m*m
n = n*n
if(n+m==x):
print("Right triangle")
elif(n+m>x):
print("Acute triangle")
elif(n+m<x):
print("Obtuse triangle")
if(n == m or x == m or x == n):
print("Isosceles triangle")
if(n==m and x==m):
print("Equilateral triangle")
else:
print("Not triangle")
P5718
n = int(input())
a = list(map(int,input().split()))
print(min(a))
P5719
n,k = list(map(int,input().split()))
num1 = 0
num11 = 0
num2 = 0
num22 = 0
for i in range(1,n+1,1):
if(i%k==0):
num1 += i
num11 += 1
else:
num2 += i
num22 += 1
print('%.1f'%(num1/num11),'%.1f'%(num2/num22))
P5720
n = int(input())
ans = 0
while n!=1:
n//=2
ans+=1
print(ans+1)
P5721
n = int(input())
ans = 1
for i in range(n,0,-1):
for j in range(i):
print('{:0>2d}'.format(ans),end='')
ans+=1
print("")
P5722
n = int(input())
ans = 0
for i in range(1,n+1,1):
ans += i
print(ans)
P5723
def zhishu(x):
for i in range(2,x,1):
if(x%i==0):return 0
return 1
n = int(input())
num = 0
nu = 0
for i in range(2,n+1,1):
if(nu > n):break
if(zhishu(i) == 1):
if(nu+i>n):break
print(i)
nu += i
num += 1
print(num)
P5724
a = input()
b = list(map(int,input().split()))
print(max(b)-min(b))
P5725
n = int(input())
s = 1
for i in range(n):
for j in range(n):
print('{:0>2d}'.format(s),end='')
s += 1
print('')
print('')
x = 1
f = 1
for i in range(n,0,-1):
for j in range(1,2*i-1):
print(' ',end='')
for k in range(f):
print('{:0>2d}'.format(x),end='')
x+=1
f+=1
print('')
P5726
a = input()
b = list(map(int,input().split()))
Sum = sum(b)-max(b)-min(b)
print('%.2f'%(Sum/(len(b)-2)))
P5727
n = int(input())
ans = [n]
temp = 0
while n!=1:
if(n%2!=0):
n = n * 3 +1
ans.append(n)
else:
n = n//2
ans.append(n)
for i in range(len(ans)-1,-1,-1):
print(ans[i],end=" ")
P5728
n = int(input())
num = 0
score = list()
for i in range(n):
t = list(map(int,input().split()))
t.append(sum(t))
score.append(t)
#列表初始化
for i in range(0,n,1):
for j in range(i+1,n,1):
flag1 = 0
flag2 = 0
for k in range(0,3,1):#判断各科成绩
if abs(score[i][k]-score[j][k]) > 5:
flag1 = 1
if abs(score[i][3]-score[j][3]) > 10:#判断总分
flag2 = 1
if (flag1==0 and flag2 ==0):
num+=1
print(num)
P5729
w,x,h = list(map(int,input().split()))
vol = [[[0 for i in range(h+1)] for j in range(x+1)] for k in range(w+1)]
#列表的初始化
n = int(input())
for s in range(n):
x1,y1,z1,x2,y2,z2 = list(map(int,input().split()))
for i in range(min(x1,x2),max(x1,x2)+1,1):
for j in range(min(y1,y2),max(y1,y2)+1,1):
for k in range(min(z1,z2),max(z1,z2)+1,1):
vol[i][j][k] = 1
num = 0
for i in range(1,w+1,1):
for j in range(1,x+1,1):
for k in range(1,h+1,1):
if(vol[i][j][k]==0):
num += 1
print(num)
P5730
n = int(input())
num = input()
for i in range(n):
if(num[i]=='4'):
print("X.X",end="")
elif(num[i]=='1'):
print("..X",end="")
else:
print("XXX",end="")
if(i!=n-1):
print(".",end="")
print()
for i in range(n):
if(num[i]=='0' or num[i]=='4' or num[i]=='8' or num[i]=='9'):
print("X.X",end="")
elif(num[i]=='1' or num[i]=='2' or num[i]=='3' or num[i]=='7'):
print("..X",end="")
elif(num[i]=='4'):
print("X.X",end="")
else:
print("X..",end="")
if(i!=n-1):
print(".",end="")
print()
for i in range(n):
if(num[i]=='0'):
print("X.X",end="")
elif(num[i]=='1' or num[i]=='7'):
print("..X",end="")
else:
print("XXX",end="")
if(i!=n-1):
print(".",end="")
print()
for i in range(n):
if(num[i]=='0' or num[i]=='6' or num[i]=='8'):
print("X.X",end="")
elif(num[i]=='2'):
print("X..",end="")
else:
print("..X",end="")
if(i!=n-1):
print(".",end="")
print()
for i in range(n):
if(num[i]=='1'or num[i]=='4' or num[i]=='7'):
print("..X",end="")
else :
print("XXX",end="")
if(i!=n-1):
print(".",end="")
P5731
n = int(input())
num = 1
h = n#控制行
l = n#控制列
s = 1#标记位
t = 2#标记位
z_list = [[0 for i in range(n+1)]for j in range(n+1)]
for j in range(n*n):
for i in range(s,h+1):#最上边的行
z_list[n-h+1][i] = num
num+=1
h-=1
for i in range(t,l+1):#最右边的列
z_list[i][l] = num
num+=1
l-=1
for i in range(h,s-1,-1):#最下边的行
z_list[h+1][i] = num
num+=1
for i in range(l,t-1,-1):#最左边的列
z_list[i][s] = num
num+=1
s+=1
t+=1
#打印
for i in range(1,n+1):
print(" ",end="")
for j in range(1,n+1):
if(z_list[i][j]<10):
print("{:>2d}".format(z_list[i][j]),end=" ")
else:
print(z_list[i][j],end=" ")
print()
P5732
n = int(input())
yh_list = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(0,n+1):
for j in range(0,i,1):
yh_list[i][j]=1
for i in range(2,n+1):
for j in range(1,i):
yh_list[i][j] = yh_list[i-1][j]+yh_list[i-1][j-1]
for i in range(1,n+1):
for j in range(0,i,1):
print(yh_list[i][j],end=" ")
print()
P5733
print(str(input()).upper())
P5734
n = int(input())
s = input().strip()
for i in range(n):
t = list(input().split())
if(t[0]=="1"):
s += t[1]
print(s)
if(t[0]=="2"):
s = s[int(t[1]):int(t[1])+int(t[2])]
print(s)
if(t[0]=="3"):
t1 = s[0:int(t[1])]
t1 += t[2]
t1 += s[int(t[1]):]
s = t1
print(s)
if(t[0]=="4"):
print(s.find(t[1]))
P5735
x1,y1 = list(map(float,input().split()))
x2,y2 = list(map(float,input().split()))
x3,y3 = list(map(float,input().split()))
dis = 0
n1 = ((x2-x1)**2 + (y2-y1)**2)**0.5
n2 = ((x3-x1)**2 + (y3-y1)**2)**0.5
n3 = ((x2-x3)**2 + (y2-y3)**2)**0.5
dis += (n1+n2+n3)
print("%.2f"%dis)
P5736
"""
埃氏
n = [0 for i in range(0,100001)]
n[0] = 1
n[1] = 1 #标记1,0不是
for i in range(2,100001):
if(n[i] == 1):
continue
for j in range(i*2,100002,i):
if(j > 100000):
continue
n[j] = 1
s = int(input())
a = map(int,input().split())
for i in a:
if(n[i] == 0):
print(i,end=" ")
"""
#欧拉筛
vis = [0 for i in range(0,1000001)]
prime = [0 for i in range(0,1000001)]
vis[0] = 1
vis[1] = 1
def pd(n):
k = 0
for i in range(2,n+1):
if(vis[i] == 0):
prime[k] = i
k += 1
for j in range(0,k):
if(prime[j]*i > n):
break
vis[prime[j]*i] = 1
if(i % prime[j]==0):
break
pd(100001)
n = int(input())
a = map(int,input().split())
for i in a:
if(vis[i] == 0):
print(i,end=" ")
P5737
def pd(x):
if(x%400==0 or (x%4==0 and x%100!=0)):
return 1
return 0
x,y = list(map(int,input().split()))
num = 0
l = []
for i in range(x,y+1):
if(pd(i)==1):
l.append(i)
num+=1
print(num)
for i in l:
print(i,end=" ")
P5738
def js(l):
return(sum(l)-min(l)-max(l))
n,m = list(map(int,input().split()))
s = []
for i in range(n):
t = list(map(int,input().split()))
s.append(js(t)/(m-2))
print("%.2f"%(max(s)))
P5739
num = 1
for i in range(1,int(input())+1):
num *= i
print(num)
P5740
n = int(input())
a = input().split()
s = 0
for j in range(1,4):
s += int(a[j])
z = s
m = a
for i in range(n-1):
s = 0
a = input().split()
for j in range(1,4):
s += int(a[j])
if(z < s):
z = s
m = a
for i in m:
print(i,end=" ")
P5741
n = int(input())
a = []
z = []
s = 0
#初始化
for i in range(n):
t = input().split()
a.append(t)
for i in range(n):
for j in range(i+1,n):
c1 = int(a[i][1])
c2 = int(a[i][2])
c3 = int(a[i][3])
d1 = int(a[j][1])
d2 = int(a[j][2])
d3 = int(a[j][3])
e1 = c1 - d1
e2 = c2 - d2
e3 = c3 - d3
e = (c1 + c2 + c3) - (d1 + d2 + d3)
if(e1 >= -5 and e1 <= 5):
if(e2 >= -5 and e2 <= 5):
if(e3 >= -5 and e3 <= 5):
if(e >= -10 and e <= 10):
z.append(min(a[i][0],a[j][0]))
z.append(max(a[i][0],a[j][0]))
s += 1
for i in range(0,len(z),2):
print(z[i+0],z[i+1])
P5742
n = int(input())
s = []
for i in range(n):
t = list(map(int,input().split()))
s.append(t)
if (t[1]*0.7 + t[2]*0.3) >= 80 :
if (t[1] + t[2]) > 140:
print("Excellent")
else:
print("Not excellent")