├── problem 1159 Sum of Consecutive Even Numbers.py ├── problem 1000 Hello World.py ├── problem 1001 Extremely Basic.py ├── problem 1002 Area of a Circle.py ├── problem 1003 Simple Sum.py ├── problem 1004 Simple Product.py ├── problem 1005 Average 1.py ├── problem 1006 Average 3.py ├── problem 1007 Difference.py ├── problem 1008 Salary.py ├── problem 1009 Salary with Bonus.py ├── problem 1010 Simple Calculate.py ├── problem 1011 Sphere.py ├── problem 1012 Area.py ├── problem 1013 The Greatest.py ├── problem 1014 Consumption.py ├── problem 1015 Distance Between Two Points.py ├── problem 1016 Distance.py ├── problem 1017 Fuel Spent.py ├── problem 1018 Banknotes.py ├── problem 1019 Time Conversion.py ├── problem 1020 Age in Days.py ├── problem 1021 Banknotes and Coins.py ├── problem 1035 Selection Test 1.py ├── problem 1036 Bhaskara's Formula.py ├── problem 1037 Interval.py ├── problem 1038 Snack.py ├── problem 1040 Average 3.py ├── problem 1041 Coordinates of a Point.py ├── problem 1042 Simple Sort.py ├── problem 1043 Triangle.py ├── problem 1044 Multiples.py ├── problem 1045 Triangle Types.py ├── problem 1046 Game Time.py ├── problem 1047 Game Time With Minutes.py ├── problem 1048 Salary Increase.py ├── problem 1049 animal.py ├── problem 1050 DDD.py ├── problem 1051 Taxes.py ├── problem 1052 Month.py ├── problem 1059 Even Numbers.py ├── problem 1060 Positive Numbers.py ├── problem 1061 Event Time.py ├── problem 1064 Positives and Average.py ├── problem 1065 Even Between five Numbers.py ├── problem 1066 Even,Odd,Positive and Negative.py ├── problem 1067 Odd Numbers.py ├── problem 1070 Six Odd Numbers.py ├── problem 1071 Sum of Consecutive Odd Numbers l.py ├── problem 1073 Even Square.py ├── problem 1074 Even Or Odd.py ├── problem 1075 Remaining 2.py ├── problem 1078 Multiplication Table.py ├── problem 1079 Weighted Averages.py ├── problem 1080 Highest and Position.py ├── problem 1094 Experiments.py ├── problem 1095 Sequence IJ 1.py ├── problem 1096 Sequence IJ 2.py ├── problem 1097 Sequence IJ 3.py ├── problem 1098 Sequence IJ 4.py ├── problem 1099 Sum of Consecutive Odd Number ll.py ├── problem 1101 Sequence of Numbers and Sum.py ├── problem 1113 Ascending and Descending.py ├── problem 1114 Fixed Password.py ├── problem 1115 Quandrant.py ├── problem 1116 Dividing X by Y.py ├── problem 1117 Score Validation.py ├── problem 1118 Several Scores with Validation.py ├── problem 1131 Grenais.py ├── problem 1132 Multiples of 13.py ├── problem 1133 Rest of a Division.py ├── problem 1134 Type of Fuel.py ├── problem 1142 PUM.py ├── problem 1143 Squared and Cubic.py ├── problem 1144 Logical Sequence.py ├── problem 1145 Logical Sequence 2.py ├── problem 1146 Growing Sequences.py ├── problem 1149 Summing Consecutive Integers.py ├── problem 1150 Exceeding Z.py ├── problem 1151 East Fibonacci.py ├── problem 1153 Simple Factorial.py ├── problem 1154 Ages.py ├── problem 1155 S Sequence.py ├── problem 1157 Divisors l.py ├── problem 1158 Sum of Consecutive Odd Numbers lll.py ├── problem 1160 Population Increase.py ├── problem 1161 Factorial Sum.py ├── problem 1164 Perfect Number.py ├── problem 1165 Prime Number.py ├── problem 1172 Array Replacement l.py ├── problem 1173 Array fill l.py ├── problem 1174 Array Selecion l.py ├── problem 1175 Array Change l.py ├── problem 1176 Fibonacci Array.py ├── problem 1177 Array Fill ll.py ├── problem 1178 Array Fill lll.py ├── problem 1179 Array Fill lv.py ├── problem 1180 Lowest Number And Position.py ├── problem 1181 Line in Array.py ├── problem 1182 Column in Array.py ├── problem 1197 Back to High School Physich.py ├── problem 1198 Hashmat the Brave Warrior.py ├── problem 1564 Brazil World Cup.py ├── problem 1589 Bob Conduit.py ├── problem 1759 Ho Ho Ho.py ├── problem 1864 Our Days Are Never Coming Back.py ├── problem 1865 Mjolnir.py ├── problem 1866 Bill.py ├── problem 1957coverting to hexidecimal.py ├── problem 1962 a long,long time ago.py ├── problem 2057 Time Zone.py ├── problem 2147 Galopeira.py ├── problem1156 S Sequence ll.py └── problem1921 Guilherme and His Kites.py /problem 1159 Sum of Consecutive Even Numbers.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | b = 0 3 | sum = 0 4 | x=int(input()) 5 | if(x==0): 6 | break 7 | if(x%2!=0): 8 | x+=1 9 | for a in range(5): 10 | sum=sum+x 11 | x=x+2 12 | print(sum) -------------------------------------------------------------------------------- /problem 1000 Hello World.py: -------------------------------------------------------------------------------- 1 | print("Hello World!") -------------------------------------------------------------------------------- /problem 1001 Extremely Basic.py: -------------------------------------------------------------------------------- 1 | a=int(input()) 2 | b=int(input()) 3 | print("X =",a+b) -------------------------------------------------------------------------------- /problem 1002 Area of a Circle.py: -------------------------------------------------------------------------------- 1 | raio = float(input()) 2 | area = (raio * raio) * 3.14159 3 | print("A=%0.4f" %area) -------------------------------------------------------------------------------- /problem 1003 Simple Sum.py: -------------------------------------------------------------------------------- 1 | a=int(input()) 2 | b=int(input()) 3 | print("SOMA =",a+b) -------------------------------------------------------------------------------- /problem 1004 Simple Product.py: -------------------------------------------------------------------------------- 1 | a=float(input()) 2 | b=int(input()) 3 | print("PROD =",int(a*b)) -------------------------------------------------------------------------------- /problem 1005 Average 1.py: -------------------------------------------------------------------------------- 1 | a=float(input()) 2 | b=float(input()) 3 | average = (a *3.5 + b*7.5)/(3.5+7.5) 4 | print("MEDIA = %0.5f" %average) -------------------------------------------------------------------------------- /problem 1006 Average 3.py: -------------------------------------------------------------------------------- 1 | a=float(input()) 2 | b=float(input()) 3 | c = float(input()) 4 | average = (a *2 + b*3 +c*5)/(2+3+5) 5 | print("MEDIA = %0.1f" %average) -------------------------------------------------------------------------------- /problem 1007 Difference.py: -------------------------------------------------------------------------------- 1 | a=int(input()) 2 | b=int(input()) 3 | c=int(input()) 4 | d=int(input()) 5 | sum = ((a*b)-(c*d)) 6 | print("DIFERENCA =",sum) -------------------------------------------------------------------------------- /problem 1008 Salary.py: -------------------------------------------------------------------------------- 1 | a= int(input()) 2 | b= int(input()) 3 | c=float(input()) 4 | print("NUMBER =",a) 5 | mult=b*c 6 | print("SALARY = U$ %0.2f"%mult) 7 | -------------------------------------------------------------------------------- /problem 1009 Salary with Bonus.py: -------------------------------------------------------------------------------- 1 | name = input() 2 | a = float(input()) 3 | b = float(input()) 4 | total = a+(b*15)/100 5 | print("TOTAL = R$ %0.2f"%total) 6 | -------------------------------------------------------------------------------- /problem 1010 Simple Calculate.py: -------------------------------------------------------------------------------- 1 | x = input().split(" ") 2 | y= input().split(" ") 3 | a,b,c = x 4 | d,e,f= y 5 | total = (int(b) * float(c)) + (int(e) * float(f)) 6 | print("VALOR A PAGAR: R$ %0.2f" %total) -------------------------------------------------------------------------------- /problem 1011 Sphere.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | total = (4/3.0*3.14159*n*n*n) 3 | print("VOLUME = %0.3f"%total) -------------------------------------------------------------------------------- /problem 1012 Area.py: -------------------------------------------------------------------------------- 1 | a,b,c = list(map(float,input().split())) 2 | triangle=0.5*a*c 3 | circle=3.14159*c*c 4 | trapezium=(a+b)/2.0*c 5 | square=b*b 6 | rectangle=a*b 7 | print("TRIANGULO: %.3lf"%triangle) 8 | print("CIRCULO: %.3f"%circle) 9 | print("TRAPEZIO: %.3f"%trapezium) 10 | print("QUADRADO: %.3f"%square) 11 | print("RETANGULO: %.3f"%rectangle) -------------------------------------------------------------------------------- /problem 1013 The Greatest.py: -------------------------------------------------------------------------------- 1 | a,b,c=list(map(int,input().split())) 2 | print("{} eh o maior".format(max(a,b,c))) -------------------------------------------------------------------------------- /problem 1014 Consumption.py: -------------------------------------------------------------------------------- 1 | a=int(input()) 2 | b=float(input()) 3 | total=a/b 4 | print("%0.3f km/l"%total) -------------------------------------------------------------------------------- /problem 1015 Distance Between Two Points.py: -------------------------------------------------------------------------------- 1 | import math 2 | x1,y1=list(map(float,input().split())) 3 | x2,y2=list(map(float,input().split())) 4 | distance = math.sqrt(pow(x2-x1,2)+pow(y2-y1,2)) 5 | print("%0.4f"%distance) -------------------------------------------------------------------------------- /problem 1016 Distance.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | print("{} minutos".format(n*2)) -------------------------------------------------------------------------------- /problem 1017 Fuel Spent.py: -------------------------------------------------------------------------------- 1 | a=int(input()) 2 | b=int(input()) 3 | print("%0.3f"%((a*b)/12.0)) -------------------------------------------------------------------------------- /problem 1018 Banknotes.py: -------------------------------------------------------------------------------- 1 | notes = int(input()) 2 | print(notes) 3 | print("{} nota(s) de R$ 100,00".format(int(notes/100))) 4 | aux = (notes%100) 5 | print("{} nota(s) de R$ 50,00".format(int(aux/50))) 6 | aux = (aux%50) 7 | print("{} nota(s) de R$ 20,00".format(int(aux/20))) 8 | aux = (aux%20) 9 | print("{} nota(s) de R$ 10,00".format(int(aux/10))) 10 | aux = (aux%10) 11 | print("{} nota(s) de R$ 5,00".format(int(aux/5))) 12 | aux = (aux%5) 13 | print("{} nota(s) de R$ 2,00".format(int(aux/2))) 14 | aux = (aux%2) 15 | print("{} nota(s) de R$ 1,00".format(int(aux/1))) 16 | -------------------------------------------------------------------------------- /problem 1019 Time Conversion.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | print("{}:{}:{}".format(int(n/3600),int(n%3600/60),int(n%60))) -------------------------------------------------------------------------------- /problem 1020 Age in Days.py: -------------------------------------------------------------------------------- 1 | n= int(input()) 2 | a = n / 365 3 | rA = n % 365 4 | rM = rA % 30 5 | m = rA / 30 6 | d = rM % 30 7 | print("{} ano(s)".format(int(a))) 8 | print("{} mes(es)".format(int(m))) 9 | print("{} dia(s)".format(int(d))) -------------------------------------------------------------------------------- /problem 1021 Banknotes and Coins.py: -------------------------------------------------------------------------------- 1 | A=float(input()) 2 | N=A 3 | a=N/100 4 | b=N%100 5 | c=b/50 6 | d=b%50 7 | e=d/20 8 | f=d%20 9 | g=f/10 10 | h=f%10 11 | i=h/5 12 | j=h%5 13 | k=j/2 14 | l=j%2 15 | 16 | E=A*100 17 | B=(int(E)) 18 | m=B%100 19 | n=m/50 20 | o=m%50 21 | p=o/25 22 | q=o%25 23 | r=q/10 24 | s=q%10 25 | t=s/5 26 | u=s%5 27 | print("NOTAS:") 28 | print("{} nota(s) de R$ 100.00".format(int(a))) 29 | print("{} nota(s) de R$ 50.00".format(int(c))) 30 | print("{} nota(s) de R$ 20.00".format(int(e))) 31 | print("{} nota(s) de R$ 10.00".format(int(g))) 32 | print("{} nota(s) de R$ 5.00".format(int(i))) 33 | print("{} nota(s) de R$ 2.00".format(int(k))) 34 | print("MOEDAS:") 35 | print("{} moeda(s) de R$ 1.00".format(int(l))) 36 | print("{} moeda(s) de R$ 0.50".format(int(n))) 37 | print("{} moeda(s) de R$ 0.25".format(int(p))) 38 | print("{} moeda(s) de R$ 0.10".format(int(r))) 39 | print("{} moeda(s) de R$ 0.05".format(int(t))) 40 | print("{} moeda(s) de R$ 0.01".format(int(u))) -------------------------------------------------------------------------------- /problem 1035 Selection Test 1.py: -------------------------------------------------------------------------------- 1 | A,B,C,D=list(map(int,input().split())) 2 | if(B>C and D>A and C+D>A+B and C>=0 and D>=0 and A%2==0): 3 | print("Valores aceitos") 4 | else: 5 | print("Valores nao aceitos") -------------------------------------------------------------------------------- /problem 1036 Bhaskara's Formula.py: -------------------------------------------------------------------------------- 1 | A,B,C = list(map(float,input().split())) 2 | d = B * B - 4 * A * C 3 | e = pow(d, .5) 4 | if (d < 0 or A == 0): 5 | print("Impossivel calcular") 6 | else: 7 | f = (-B + e) / (2 * A) 8 | g = (-B - e) / (2 * A) 9 | print("R1 = %.5lf"%f) 10 | print("R2 = %.5lf"%g) 11 | -------------------------------------------------------------------------------- /problem 1037 Interval.py: -------------------------------------------------------------------------------- 1 | a = float(input()) 2 | if(a<0 or a>100): 3 | print("Fora de intervalo") 4 | elif(a>=0 and a<=25): 5 | print("Intervalo [0,25]") 6 | elif(a>25 and a<=50): 7 | print("Intervalo (25,50]") 8 | elif (a>50 and a<=75): 9 | print("Intervalo (50,75]") 10 | elif (a>75 and a<=100): 11 | print("Intervalo (75,100]") 12 | -------------------------------------------------------------------------------- /problem 1038 Snack.py: -------------------------------------------------------------------------------- 1 | X,Y=list(map(int,input().split())) 2 | if(X == 1): 3 | price = (float) (4.00 * Y) 4 | elif(X == 2): 5 | price = (float) (4.50 * Y) 6 | elif(X == 3): 7 | price = (float) (5.00 * Y) 8 | elif (X == 4): 9 | price = (float) (2.00 * Y); 10 | elif (X == 5): 11 | price = (float) (1.50 * Y) 12 | print("Total: R$ %.2f"%price) -------------------------------------------------------------------------------- /problem 1040 Average 3.py: -------------------------------------------------------------------------------- 1 | n1,n2,n3,n4=list(map(float,input().split())) 2 | a=(((n1*2)+(n2*3)+(n3*4)+(n4*1))/10); 3 | print("Media: %.1lf"%a) 4 | if(a>=7.0): 5 | print("Aluno aprovado.") 6 | elif(a<5.0): 7 | print("Aluno reprovado.") 8 | elif(a>=5.0 and a<=6.9): 9 | print("Aluno em exame.") 10 | n5=float(input()) 11 | print("Nota do exame: %.1lf"%n5) 12 | b=(a+n5)/2 13 | if(b>=5.0): 14 | print("Aluno aprovado.") 15 | if (b<=4.9): 16 | print("Aluno reprovado.") 17 | print("Media final: %.1lf"%b) -------------------------------------------------------------------------------- /problem 1041 Coordinates of a Point.py: -------------------------------------------------------------------------------- 1 | X,Y=list(map(float,input().split())) 2 | if(X==0 and Y==0): 3 | print("Origem") 4 | elif(X==0): 5 | print("Eixo Y") 6 | elif(Y==0): 7 | print("Eixo X") 8 | elif(X>0 and Y>0): 9 | print("Q1") 10 | elif(X<0 and Y>0): 11 | print("Q2") 12 | elif(X<0 and Y<0): 13 | print("Q3") 14 | elif(X>0 and Y<0): 15 | print("Q4") -------------------------------------------------------------------------------- /problem 1042 Simple Sort.py: -------------------------------------------------------------------------------- 1 | x,y,z=list(map(int,input().split())) 2 | lista = [x,y,z] 3 | lista.sort() 4 | print(lista[0]) 5 | print(lista[1]) 6 | print(lista[2]) 7 | print("") 8 | print(x) 9 | print(y) 10 | print(z) -------------------------------------------------------------------------------- /problem 1043 Triangle.py: -------------------------------------------------------------------------------- 1 | a,b,c=list(map(float,input().split())) 2 | if(a=(b+c)): 15 | print("NAO FORMA TRIANGULO") 16 | elif(a*a == (b*b+c*c)): 17 | print("TRIANGULO RETANGULO") 18 | elif(a * a > (b*b+ c*c)): 19 | print("TRIANGULO OBTUSANGULO") 20 | elif(a*a<(b*b + c*c)): 21 | print("TRIANGULO ACUTANGULO") 22 | if(a == b and b == c): 23 | print("TRIANGULO EQUILATERO") 24 | elif(a == b or b == c): 25 | print("TRIANGULO ISOSCELES") -------------------------------------------------------------------------------- /problem 1046 Game Time.py: -------------------------------------------------------------------------------- 1 | a,b=list(map(int,input().split())) 2 | if(a=0 and a<=400): 3 | b= a*0.15 4 | c=a+b 5 | d=15 6 | elif(a>=400.01 and a<=800.00): 7 | b=a*0.12 8 | c=a+b 9 | d=12 10 | elif(a>=800.01 and a<=1200.00): 11 | b=a*0.1 12 | c=a+b 13 | d=10 14 | elif(a>=1200.01 and a<=2000.00): 15 | b=a*0.07 16 | c=a+b 17 | d=7 18 | elif(a>2000): 19 | b=a*0.04 20 | c=a+b 21 | d=4 22 | print("Novo salario: %.2f"%c) 23 | print("Reajuste ganho: %.2f"%b) 24 | print("Em percentual: {} {}".format(d,"%")) -------------------------------------------------------------------------------- /problem 1049 animal.py: -------------------------------------------------------------------------------- 1 | a=str(input()) 2 | b=str(input()) 3 | c=str(input()) 4 | if a == "vertebrado": 5 | if b=="ave": 6 | if c=="carnivoro": 7 | print("aguia") 8 | else: 9 | print("pomba") 10 | elif b=="mamifero": 11 | if c == "onivoro": 12 | print("homem") 13 | else: 14 | print("vaca") 15 | elif a =="invertebrado": 16 | if b=="inseto": 17 | if c=="hematofago": 18 | print("pulga") 19 | else: 20 | print("lagarta") 21 | elif b=="anelideo": 22 | if c == "hematofago": 23 | print("sanguessuga") 24 | else: 25 | print("minhoca") -------------------------------------------------------------------------------- /problem 1050 DDD.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | if(n == 61): 3 | print("Brasilia") 4 | elif (n == 71): 5 | print("Salvador") 6 | elif(n == 11): 7 | print("Sao Paulo") 8 | elif(n == 21): 9 | print("Rio de Janeiro") 10 | elif(n == 32): 11 | print("Juiz de Fora") 12 | elif(n == 19): 13 | print("Campinas") 14 | elif(n == 27): 15 | print("Vitoria") 16 | elif(n == 31): 17 | print("Belo Horizonte") 18 | else: 19 | print("DDD nao cadastrado") -------------------------------------------------------------------------------- /problem 1051 Taxes.py: -------------------------------------------------------------------------------- 1 | a=float(input()) 2 | if(a>=0 and a<=2000): 3 | print("Isento") 4 | elif(a>=2000.01 and a<=3000): 5 | a=a-2000 6 | b= a*.08 7 | print("R$ %.2f"%b) 8 | elif(a>=3000.01 and a<=4500): 9 | a=a-3000 10 | b= a*.18+80 11 | print("R$ %.2f"%b) 12 | else: 13 | a=a-4500 14 | b= a*.28+350 15 | print("R$ %.2f"%b) -------------------------------------------------------------------------------- /problem 1052 Month.py: -------------------------------------------------------------------------------- 1 | x=int(input()) 2 | if(x==1): 3 | print("January") 4 | elif(x==2): 5 | print("February") 6 | elif(x==3): 7 | print("March") 8 | elif(x==4): 9 | print("April") 10 | elif(x==5): 11 | print("May") 12 | elif(x==6): 13 | print("June") 14 | elif(x==7): 15 | print("July") 16 | elif(x==8): 17 | print("August") 18 | elif(x==9): 19 | print("September") 20 | elif(x==10): 21 | print("October") 22 | elif(x==11): 23 | print("November") 24 | elif(x==12): 25 | print("December") -------------------------------------------------------------------------------- /problem 1059 Even Numbers.py: -------------------------------------------------------------------------------- 1 | for i in range(2,100+1): 2 | if(i%2==0): 3 | print(i) -------------------------------------------------------------------------------- /problem 1060 Positive Numbers.py: -------------------------------------------------------------------------------- 1 | count=0 2 | for i in range(1,7): 3 | n = float(input()) 4 | if(n>0): 5 | count=count+1 6 | print("{} valores positivos".format(count)) -------------------------------------------------------------------------------- /problem 1061 Event Time.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joy1954islam/uri-problem-solution-in-python/7eda652df565925ed7c35419b780ac85cfb74e39/problem 1061 Event Time.py -------------------------------------------------------------------------------- /problem 1064 Positives and Average.py: -------------------------------------------------------------------------------- 1 | count=0 2 | sum=0.0 3 | for i in range(1,7): 4 | n = float(input()) 5 | if(n>0): 6 | sum = sum + n 7 | count=count+1 8 | print("{} valores positivos".format(count)) 9 | print("%0.1f"%(sum/count)) -------------------------------------------------------------------------------- /problem 1065 Even Between five Numbers.py: -------------------------------------------------------------------------------- 1 | count=0 2 | for i in range(5): 3 | n = float(input()) 4 | if(n%2==0): 5 | count=count+1 6 | print("{} valores pares".format(count)) -------------------------------------------------------------------------------- /problem 1066 Even,Odd,Positive and Negative.py: -------------------------------------------------------------------------------- 1 | even=0 2 | odd=0 3 | positive=0 4 | negative=0 5 | for i in range(5): 6 | n = float(input()) 7 | if(n % 2 == 0): 8 | even = even+1 9 | else: 10 | odd =odd+1 11 | if (n > 0): 12 | positive =positive+1 13 | elif (n < 0): 14 | negative =negative+1 15 | print("{} valor(es) par(es)".format(even)) 16 | print("{} valor(es) impar(es)".format(odd)) 17 | print("{} valor(es) positivo(s)".format(positive)) 18 | print("{} valor(es) negativo(s)".format(negative)) -------------------------------------------------------------------------------- /problem 1067 Odd Numbers.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | for i in range(n+1): 3 | if(i%2==1): 4 | print(i) -------------------------------------------------------------------------------- /problem 1070 Six Odd Numbers.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | i=0 3 | while(i<6): 4 | if(n%2!=0): 5 | print(n) 6 | i=i+1 7 | n=n+1 -------------------------------------------------------------------------------- /problem 1071 Sum of Consecutive Odd Numbers l.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | X = int(input()) 3 | Y = int(input()) 4 | start = min(X,Y)+1 5 | end = max(X,Y) 6 | if start % 2 == 0: 7 | start += 1 8 | 9 | sum = 0 10 | for i in range(start, end, 2): 11 | sum += i 12 | print(sum) 13 | if __name__ == '__main__': 14 | main() -------------------------------------------------------------------------------- /problem 1073 Even Square.py: -------------------------------------------------------------------------------- 1 | n= int(input()) 2 | for i in range(1,n+1): 3 | if(i%2==0): 4 | print("{}^{} = {}".format(i,2,pow(i,2))) -------------------------------------------------------------------------------- /problem 1074 Even Or Odd.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a=int(input()) 4 | if(a<0): 5 | if(a%2==0): 6 | print("EVEN NEGATIVE") 7 | else: 8 | print("ODD NEGATIVE") 9 | elif(a>0): 10 | if(a % 2 == 0): 11 | print("EVEN POSITIVE") 12 | else: 13 | print("ODD POSITIVE") 14 | elif(a==0): 15 | print("NULL") -------------------------------------------------------------------------------- /problem 1075 Remaining 2.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(1,10000): 3 | if(i%n==2): 4 | print(i) -------------------------------------------------------------------------------- /problem 1078 Multiplication Table.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(1,11): 3 | print("{} x {} = {}".format(i,n,i*n)) -------------------------------------------------------------------------------- /problem 1079 Weighted Averages.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a,b,c=list(map(float,input().split())) 4 | total=(a*2+b*3+c*5)/10 5 | print("%0.1f"%total) -------------------------------------------------------------------------------- /problem 1080 Highest and Position.py: -------------------------------------------------------------------------------- 1 | j=0 2 | loc=0 3 | for i in range(100): 4 | n=int(input()) 5 | if(n>j): 6 | j=n 7 | loc=i 8 | print(j) 9 | print(loc+1) -------------------------------------------------------------------------------- /problem 1094 Experiments.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | C=0 3 | R=0 4 | S=0 5 | for i in range(n): 6 | a,ch=list(map(str,input().split())) 7 | a=int(a) 8 | if(ch == 'C'): 9 | C += a 10 | elif (ch == 'R'): 11 | R += a 12 | else: 13 | S += a 14 | total=C+R+S 15 | x=(C*100.00)/total 16 | y=(R*100.00)/total 17 | z=(S*100.00)/total 18 | print("Total: {} cobaias".format(total)) 19 | print("Total de coelhos:",C) 20 | print("Total de ratos:",R) 21 | print("Total de sapos:",S) 22 | print("Percentual de coelhos: %.2lf %%"%x) 23 | print("Percentual de ratos: %.2lf %%"%y) 24 | print("Percentual de sapos: %.2lf %%"%z) -------------------------------------------------------------------------------- /problem 1095 Sequence IJ 1.py: -------------------------------------------------------------------------------- 1 | j,i=65,-2 2 | for I in range (1,14): 3 | J= j-5 4 | I=i+3 5 | print('I=%d J=%d' %(I,J)) 6 | j=J 7 | i=I -------------------------------------------------------------------------------- /problem 1096 Sequence IJ 2.py: -------------------------------------------------------------------------------- 1 | for i in range(1,10,2): 2 | for j in range(7,4,-1): 3 | print("I={} J={}".format(i,j)) -------------------------------------------------------------------------------- /problem 1097 Sequence IJ 3.py: -------------------------------------------------------------------------------- 1 | for i in range(1,10,2): 2 | for j in range(6+i,3+i,-1): 3 | print("I={} J={}".format(i,j)) -------------------------------------------------------------------------------- /problem 1098 Sequence IJ 4.py: -------------------------------------------------------------------------------- 1 | i = 0 2 | j = 1 3 | value = 0 4 | temp = 0 5 | temp2 = 0 6 | while (i <= 2): 7 | if (temp2 == 0): 8 | print("I=%.0f J=%.0f" % (i, j)) 9 | else: 10 | print("I=%.1f J=%.1f" % (i, j)) 11 | 12 | temp += 1 13 | if (temp == 3): 14 | i += 0.2 15 | value += 0.2 16 | j = value 17 | temp = 0 18 | temp2 += 1 19 | 20 | if(temp2 == 5): 21 | temp2 = 0 22 | j += 1 -------------------------------------------------------------------------------- /problem 1099 Sum of Consecutive Odd Number ll.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | for i in range(n): 3 | a,b = list(map(int, input().split())) 4 | d = 0 5 | if(a==b): 6 | print(0) 7 | else: 8 | c = 0 9 | if (a > b): 10 | c = a 11 | a = b 12 | b = c 13 | while (a < ( b- 1)): 14 | a += 1 15 | if(a % 2 != 0): 16 | d+= a 17 | print(d) -------------------------------------------------------------------------------- /problem 1101 Sequence of Numbers and Sum.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | try: 3 | a,b=list(map(int,input().split())) 4 | x = min(a,b) 5 | y = max(a,b) 6 | if(a<=0 or b<=0): 7 | break 8 | else: 9 | sum=0 10 | result = '' 11 | for i in range(x,y+1): 12 | result += str(i)+' ' 13 | sum = sum + i 14 | result+= 'Sum=%d' 15 | print(result %sum) 16 | except EOFError: 17 | break -------------------------------------------------------------------------------- /problem 1113 Ascending and Descending.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | try: 3 | a,b=list(map(int,input().split())) 4 | if(a==b): 5 | break 6 | else: 7 | if(a0 and b>0): 7 | print("primeiro") 8 | elif(a>0 and b<0): 9 | print("quarto") 10 | elif(a<0 and b<0): 11 | print("terceiro") 12 | elif(a<0 and b>0): 13 | print("segundo") 14 | except EOFError: 15 | break -------------------------------------------------------------------------------- /problem 1116 Dividing X by Y.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | for i in range(n): 3 | a,b=list(map(int,input().split())) 4 | if(b == 0): 5 | print("divisao impossivel") 6 | else: 7 | print("%.1f" %(a / b)) -------------------------------------------------------------------------------- /problem 1117 Score Validation.py: -------------------------------------------------------------------------------- 1 | d=0 2 | c=0 3 | while(True): 4 | try: 5 | if(d==2): 6 | break 7 | a = float(input()) 8 | if(a>=0 and a<=10): 9 | d=d+1 10 | c=c+a 11 | else: 12 | print("nota invalida") 13 | except EOFError: 14 | break 15 | b=c/2.00 16 | print("media = %0.2f"%b) -------------------------------------------------------------------------------- /problem 1118 Several Scores with Validation.py: -------------------------------------------------------------------------------- 1 | while True: 2 | s = 0 3 | q = 0 4 | while (q< 2): 5 | n= float(input()) 6 | if (n >= 0 and n <= 10): 7 | s += n 8 | q += 1 9 | else: 10 | print("nota invalida") 11 | print("media = %.2f" % (s / 2)) 12 | t = 0 13 | while True: 14 | print("novo calculo (1-sim 2-nao)") 15 | t= int(input()) 16 | if (t == 1 or t== 2): 17 | break 18 | if (t == 2): 19 | break -------------------------------------------------------------------------------- /problem 1131 Grenais.py: -------------------------------------------------------------------------------- 1 | l = 0 2 | k = 0 3 | j = 0 4 | c = 0 5 | d = 0 6 | e = 0 7 | while True: 8 | a,b = list(map(int,input().split())) 9 | if(a>b): 10 | l=l+1 11 | if(ak): 29 | print("Inter venceu mais") 30 | if(l n2): 6 | n1 = n2 7 | n2 = t 8 | while(n1 <= n2): 9 | if(n1%13 != 0): 10 | s += n1 11 | n1 += 1 12 | print(s) -------------------------------------------------------------------------------- /problem 1133 Rest of a Division.py: -------------------------------------------------------------------------------- 1 | n1=int(input()) 2 | n2=int(input()) 3 | t = n1 4 | if (n1 > n2): 5 | n1 = n2 6 | n2 = t 7 | while (n1 < n2): 8 | n1 += 1 9 | if (n1 % 5 == 2 or n1 % 5 == 3 and n1 != n2): 10 | print(n1) -------------------------------------------------------------------------------- /problem 1134 Type of Fuel.py: -------------------------------------------------------------------------------- 1 | x=0 2 | y=0 3 | z=0 4 | while(True): 5 | a=int(input()) 6 | if(a == 4): 7 | break 8 | else: 9 | if (a == 1): 10 | x +=1 11 | elif (a == 2): 12 | y+=1 13 | elif (a == 3): 14 | z+=1 15 | else: 16 | continue 17 | print("MUITO OBRIGADO") 18 | print("Alcool:",x) 19 | print("Gasolina:",y) 20 | print("Diesel:",z) -------------------------------------------------------------------------------- /problem 1142 PUM.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | c = 1 3 | for i in range(n): 4 | print("%d %d %d PUM" %(c,c+1,c+2)) 5 | c += 4 -------------------------------------------------------------------------------- /problem 1143 Squared and Cubic.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(1,n+1): 3 | print("{} {} {}".format(i,i*i,i*i*i)) -------------------------------------------------------------------------------- /problem 1144 Logical Sequence.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(1,n+1): 3 | c = i*i 4 | d= i*i*i 5 | print("{} {} {}".format(i,c,d)) 6 | e=c+1 7 | f=d+1 8 | print("{} {} {}".format(i,e,f)) -------------------------------------------------------------------------------- /problem 1145 Logical Sequence 2.py: -------------------------------------------------------------------------------- 1 | n1,n2 = list(map(int,input().split())) 2 | cont = 1 3 | for i in range(1,(int((n2/n1))+1)): 4 | r = "" 5 | for y in range(n1): 6 | r += str(cont) + " " 7 | cont += 1 8 | print(r[:-1]) -------------------------------------------------------------------------------- /problem 1146 Growing Sequences.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | a=int(input()) 3 | r='' 4 | if(a==0): 5 | break 6 | for i in range(1,a+1): 7 | r += str(i) + " " 8 | print(r[:-1]) -------------------------------------------------------------------------------- /problem 1149 Summing Consecutive Integers.py: -------------------------------------------------------------------------------- 1 | lista = list(map(int, input().split())) 2 | n1 = 'I' 3 | n2 = 0 4 | soma = 0 5 | for i in lista: 6 | if (n1 == 'I'): 7 | n1 = i 8 | else: 9 | if (i > 0): 10 | n2 = i 11 | break 12 | 13 | for i in range(n2): 14 | soma += n1 15 | n1 += 1 16 | 17 | print("%d" % soma) -------------------------------------------------------------------------------- /problem 1150 Exceeding Z.py: -------------------------------------------------------------------------------- 1 | n1 = int(input()) 2 | n2 = 0 3 | while True: 4 | n2 = int(input()) 5 | if(n2 > n1): 6 | break 7 | soma = n1 8 | qte = 1 9 | while(soma < n2): 10 | soma += n1 + qte 11 | qte += 1 12 | 13 | print(qte) -------------------------------------------------------------------------------- /problem 1151 East Fibonacci.py: -------------------------------------------------------------------------------- 1 | lista = [0, 1, 1] 2 | 3 | r = "0,1,1" 4 | ant = 1 5 | atual = 1 6 | valor = int(input()) 7 | 8 | for v in range(valor - 3): 9 | t = atual 10 | atual += ant 11 | ant = t 12 | lista.append(atual) 13 | 14 | print(str(lista[0:valor]).replace(",", "").replace("[", "").replace("]", "")) -------------------------------------------------------------------------------- /problem 1153 Simple Factorial.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | s=1 3 | for i in range(n,1,-1): 4 | s = s*i 5 | print(s) -------------------------------------------------------------------------------- /problem 1154 Ages.py: -------------------------------------------------------------------------------- 1 | b=0 2 | d=0 3 | while(True): 4 | try: 5 | n=int(input()) 6 | if(n<0): 7 | break 8 | else: 9 | b=b+n 10 | d=d+1 11 | except EOFError: 12 | break 13 | c=b/d 14 | print("%0.2f"%c) -------------------------------------------------------------------------------- /problem 1155 S Sequence.py: -------------------------------------------------------------------------------- 1 | s=0 2 | for i in range(1,101): 3 | m=1/i 4 | s=s+m 5 | print("%0.2f"%s) -------------------------------------------------------------------------------- /problem 1157 Divisors l.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(1,n+1): 3 | if(n%i==0): 4 | print(i) -------------------------------------------------------------------------------- /problem 1158 Sum of Consecutive Odd Numbers lll.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a,b=list(map(int,input().split())) 4 | if(a%2==1): 5 | c=0 6 | for j in range(1,b+1): 7 | c=c+a 8 | a=a+2 9 | print(c) 10 | else: 11 | a+=1 12 | c=0 13 | for j in range(1,b+1): 14 | c+=a 15 | a+=2 16 | print(c) -------------------------------------------------------------------------------- /problem 1160 Population Increase.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | for i in range(n): 3 | pa, pb, g1, g2 = input().split() 4 | pa = int(pa) 5 | pb = int(pb) 6 | g1 = float(g1) 7 | g2 = float(g2) 8 | a = 0 9 | while (pa <= pb): 10 | cpa = int((pa * (g1 / 100))) 11 | cpb = int((pb * (g2 / 100))) 12 | a += 1 13 | pa += cpa 14 | pb += cpb 15 | if (a > 100): 16 | break 17 | if (a > 100): 18 | print("Mais de 1 seculo.") 19 | else: 20 | print("%d anos." % a) -------------------------------------------------------------------------------- /problem 1161 Factorial Sum.py: -------------------------------------------------------------------------------- 1 | sum1=1 2 | sum2=1 3 | sum=0 4 | while(True): 5 | try: 6 | a,b=list(map(int,input().split())) 7 | if(a==0 or a==1): 8 | sum1=1 9 | else: 10 | for i in range(2,a+1): 11 | sum1=sum1*i 12 | if(b==0 or b==1): 13 | sum2=1 14 | else: 15 | for i in range(2,b+1): 16 | sum2=sum2*i 17 | sum=sum1+sum2 18 | print(sum) 19 | sum1=1 20 | sum2=1 21 | sum=0 22 | except EOFError: 23 | break -------------------------------------------------------------------------------- /problem 1164 Perfect Number.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a=int(input()) 4 | c=int(a/2) 5 | d=0 6 | for b in range(1,c+1): 7 | if(a%b==0): 8 | d+=b 9 | if(d==a): 10 | print("{} eh perfeito".format(a)) 11 | else: 12 | print("{} nao eh perfeito".format(a)) -------------------------------------------------------------------------------- /problem 1165 Prime Number.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a=int(input()) 4 | c=0 5 | for j in range(1,a+1): 6 | if(a%j==0): 7 | c=c+1 8 | if(c==2): 9 | print("{} eh primo".format(a)) 10 | else: 11 | print("{} nao eh primo".format(a)) -------------------------------------------------------------------------------- /problem 1172 Array Replacement l.py: -------------------------------------------------------------------------------- 1 | for i in range(10): 2 | n=int(input()) 3 | if(n< 1): 4 | n = 1 5 | print("X[%d] = %d" % (i, n)) -------------------------------------------------------------------------------- /problem 1173 Array fill l.py: -------------------------------------------------------------------------------- 1 | n= int(input()) 2 | print("N[%d] = %d" %(0,n)) 3 | for i in range(1,10): 4 | n *= 2 5 | print("N[%d] = %d" %(i,n)) -------------------------------------------------------------------------------- /problem 1174 Array Selecion l.py: -------------------------------------------------------------------------------- 1 | for i in range(100): 2 | n = float(input()) 3 | if (n <= 10): 4 | print("A[%d] = %.1f" % (i, n)) -------------------------------------------------------------------------------- /problem 1175 Array Change l.py: -------------------------------------------------------------------------------- 1 | a = [] 2 | for i in range(20): 3 | valor = int(input()) 4 | a.append(valor) 5 | pos = 0 6 | for l in a[::-1]: 7 | print("N[%d] = %d" %(pos,l)) 8 | pos += 1 -------------------------------------------------------------------------------- /problem 1176 Fibonacci Array.py: -------------------------------------------------------------------------------- 1 | new_list=[0,1] 2 | a=0 3 | t=1 4 | 5 | for i in range(60): 6 | tnp = t+a 7 | new_list.append(tnp) 8 | a=t 9 | t=tnp 10 | 11 | n = int(input()) 12 | for i in range(n): 13 | valor = int(input()) 14 | print('Fib(%d) = %d' %(valor,new_list[valor])) -------------------------------------------------------------------------------- /problem 1177 Array Fill ll.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | tmp=0 3 | for i in range(1000): 4 | print("N[%d] = %d" %(i,tmp)) 5 | tmp += 1 6 | if (tmp == n): 7 | tmp = 0 -------------------------------------------------------------------------------- /problem 1178 Array Fill lll.py: -------------------------------------------------------------------------------- 1 | new_list=[] 2 | n=float(input()) 3 | for i in range(100): 4 | new_list.append(n) 5 | print("N[%d] = %0.4f" % (i, n)) 6 | n=n/2 -------------------------------------------------------------------------------- /problem 1179 Array Fill lv.py: -------------------------------------------------------------------------------- 1 | par = [] 2 | impar = [] 3 | for i in range(15): 4 | valor = int(input()) 5 | if (valor % 2 == 0): 6 | par.append(valor) 7 | else: 8 | impar.append(valor) 9 | 10 | if (len(par) == 5): 11 | ix = 0 12 | for v in par: 13 | print("par[%d] = %d" % (ix, v)) 14 | ix += 1 15 | par = [] 16 | if (len(impar) == 5): 17 | ix = 0 18 | for v in impar: 19 | print("impar[%d] = %d" % (ix, v)) 20 | ix += 1 21 | impar = [] 22 | if (len(impar) > 0): 23 | ix = 0 24 | for v in impar: 25 | print("impar[%d] = %d" % (ix, v)) 26 | ix += 1 27 | 28 | if (len(par) > 0): 29 | ix = 0 30 | for v in par: 31 | print("par[%d] = %d" % (ix, v)) 32 | ix += 1 -------------------------------------------------------------------------------- /problem 1180 Lowest Number And Position.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | lista = list(map(int, input().split())) 3 | p = 0 4 | m = lista[0] 5 | count = 0 6 | for i in lista: 7 | if (i < m): 8 | m = i 9 | p = count 10 | count += 1 11 | print("Menor valor: %d" % m) 12 | print("Posicao: %d" % p) 13 | 14 | -------------------------------------------------------------------------------- /problem 1181 Line in Array.py: -------------------------------------------------------------------------------- 1 | linha = int(input()) 2 | n= input() 3 | s= 0 4 | for i in range(12): 5 | for j in range(12): 6 | v = float(input()) 7 | if (i == linha): 8 | s += v 9 | 10 | if (n == 'S'): 11 | print("%.1f" % s) 12 | else: 13 | print("%.1f" % (s / 12.0)) -------------------------------------------------------------------------------- /problem 1182 Column in Array.py: -------------------------------------------------------------------------------- 1 | c = int(input()) 2 | op = input() 3 | s = 0 4 | 5 | for i in range(144): 6 | v = float(input()) 7 | if (i == c): 8 | s += v 9 | c += 12 10 | if(op == 'S'): 11 | print('%.1f' %s) 12 | else: 13 | print('%.1f' %(s/12.0)) -------------------------------------------------------------------------------- /problem 1197 Back to High School Physich.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | try: 3 | a,b=list(map(int,input().split())) 4 | print(a*b*2) 5 | except EOFError: 6 | break -------------------------------------------------------------------------------- /problem 1198 Hashmat the Brave Warrior.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | try: 3 | a,b=list(map(int,input().split())) 4 | print(abs(a-b)) 5 | except EOFError: 6 | break -------------------------------------------------------------------------------- /problem 1564 Brazil World Cup.py: -------------------------------------------------------------------------------- 1 | while(True): 2 | try: 3 | n = int(input()) 4 | if(n==0): 5 | print("vai ter copa!") 6 | elif(n>0): 7 | print("vai ter duas!") 8 | except EOFError: 9 | break -------------------------------------------------------------------------------- /problem 1589 Bob Conduit.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a,b=list(map(int,input().split())) 4 | print(a+b) -------------------------------------------------------------------------------- /problem 1759 Ho Ho Ho.py: -------------------------------------------------------------------------------- 1 | print("Ho "*(int(input("")) - 1) + "Ho!") -------------------------------------------------------------------------------- /problem 1864 Our Days Are Never Coming Back.py: -------------------------------------------------------------------------------- 1 | print("LIFE IS NOT A PROBLEM TO BE SOLVED"[:int(input(""))]) -------------------------------------------------------------------------------- /problem 1865 Mjolnir.py: -------------------------------------------------------------------------------- 1 | for i in range(int(input(""))): 2 | print("Y" if input("").split()[0].lower() == "thor" else "N") -------------------------------------------------------------------------------- /problem 1866 Bill.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | a = int(input()) 4 | if(a%2==0): 5 | print(0) 6 | else: 7 | print(1) -------------------------------------------------------------------------------- /problem 1957coverting to hexidecimal.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | def decToHexa(n): 4 | hexaDeciNum = ['0'] * 100 5 | i = 0 6 | while (n != 0): 7 | temp = 0 8 | temp = n % 16 9 | if (temp < 10): 10 | hexaDeciNum[i] = chr(temp + 48) 11 | i = i + 1 12 | else: 13 | hexaDeciNum[i] = chr(temp + 55) 14 | i = i + 1 15 | n = int(n / 16) 16 | j = i - 1 17 | while (j >= 0): 18 | print((hexaDeciNum[j]), end="") 19 | j = j - 1 20 | n = int(input()) 21 | decToHexa(n) 22 | print() 23 | -------------------------------------------------------------------------------- /problem 1962 a long,long time ago.py: -------------------------------------------------------------------------------- 1 | tst = int(input()) 2 | while tst>=1: 3 | dif=int(input()) 4 | if(dif<2015): 5 | year = 2015 - dif 6 | print("%d D.C." %year) 7 | else: 8 | year = dif - 2014 9 | print("%d A.C." %year) 10 | tst=tst-1 11 | -------------------------------------------------------------------------------- /problem 2057 Time Zone.py: -------------------------------------------------------------------------------- 1 | a,b,c=list(map(int,input().split())) 2 | d=a+b+c 3 | if(d>=24): 4 | d=d-24 5 | if(d<0): 6 | d=24+d 7 | print(d) -------------------------------------------------------------------------------- /problem 2147 Galopeira.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | name=input() 4 | sum = len(name) 5 | print("%0.2f"%(sum/100.0)) -------------------------------------------------------------------------------- /problem1156 S Sequence ll.py: -------------------------------------------------------------------------------- 1 | b=1 2 | s=0 3 | for i in range(1,40,2): 4 | m=i/b 5 | s=s+m 6 | b=b*2 7 | print("%0.2f"%s) -------------------------------------------------------------------------------- /problem1921 Guilherme and His Kites.py: -------------------------------------------------------------------------------- 1 | n=float(input()) 2 | print(int(n*(n-3)/2)) --------------------------------------------------------------------------------