├── Python ├── 1000.py ├── 1984.py ├── 1059.py ├── 2374.py ├── 3126.py ├── 2408.py ├── 2234.py ├── 2950.py ├── 1016.py ├── 2581.py ├── 1001.py ├── 1002.py ├── 2160.py ├── 2165.py ├── 2437.py ├── 1003.py ├── 1004.py ├── 1075.py ├── 1014.py ├── 1157.py ├── 2766.py ├── 1078.py ├── 1155.py ├── 2176.py ├── 1017.py ├── 1067.py ├── 1070.py ├── 1073.py ├── 2410.py ├── 1005.py ├── 1095.py ├── 1612.py ├── 2146.py ├── 2295.py ├── 1156.py ├── 1142.py ├── 1585.py ├── 1009.py ├── 1589.py ├── 2322.py ├── 1379.py ├── 2147.py ├── 2172.py ├── 2203.py ├── 2779.py ├── 1006.py ├── 1609.py ├── 2232.py ├── 2424.py ├── 1060.py ├── 1174.py ├── 1178.py ├── 1197.py ├── 2375.py ├── 2717.py ├── 3129.py ├── 1143.py ├── 1924.py ├── 1936.py ├── 1007.py ├── 1153.py ├── 1173.py ├── 1796.py ├── 2159.py ├── 2334.py ├── 2454.py ├── 1175.py ├── 2377.py ├── 2453.py ├── 1019.py ├── 1008.py ├── 1172.py ├── 1708.py ├── 2057.py ├── 1052.py ├── 1096.py ├── 2457.py ├── 1097.py ├── 1957.py ├── 2164.py ├── 1079.py ├── 1573.py ├── 1015.py ├── 1010.py ├── 1113.py ├── 1170.py ├── 1198.py ├── 2460.py ├── 1046.py ├── 1759.py ├── 1864.py ├── 1865.py ├── 2167.py ├── 2702.py ├── 1013.py ├── 2395.py ├── 1114.py ├── 1154.py ├── 1761.py ├── 2235.py ├── 1080.py ├── 2143.py ├── 1020.py ├── 1959.py ├── 2344.py ├── 1071.py ├── 1921.py ├── 2175.py ├── 2378.py ├── 1028.py ├── 1065.py ├── 1715.py ├── 2444.py ├── 2747.py ├── 1133.py ├── 1794.py ├── 1858.py ├── 1930.py ├── 1149.py ├── 1177.py ├── 1800.py ├── 1150.py ├── 1300.py ├── 1963.py ├── 1035.py ├── 1901.py ├── 1116.py ├── 1541.py ├── 1837.py ├── 1072.py ├── 1132.py ├── 1414.py ├── 2523.py ├── 1146.py ├── 1397.py ├── 2029.py ├── 1117.py ├── 2415.py ├── 1069.py ├── 1457.py ├── 1893.py ├── 1429.py ├── 1037.py ├── 1043.py ├── 2543.py ├── 1176.py ├── 2399.py ├── 1366.py ├── 1428.py ├── 1441.py ├── 2044.py ├── 1515.py ├── 1564.py ├── 2152.py ├── 2161.py ├── 2166.py ├── 1064.py ├── 1151.py ├── 2479.py ├── 1250.py ├── 1165.py ├── 2189.py ├── 2582.py ├── 1134.py ├── 1933.py ├── 2187.py ├── 1180.py ├── 1987.py ├── 2708.py ├── 1471.py ├── 2473.py ├── 1115.py ├── 1164.py ├── 1866.py ├── 1217.py ├── 1044.py ├── 2061.py ├── 1036.py ├── 1547.py ├── 1158.py ├── 2286.py ├── 2369.py ├── problema-A-papagaio-poliglota.py ├── 1038.py ├── problema-B-desafio-de-Rangel.py ├── 1104.py ├── 1542.py ├── 2006.py ├── 1159.py ├── 1789.py ├── 1793.py ├── 1940.py ├── 1098.py ├── 1012.py ├── 1285.py ├── 1962.py ├── 1041.py ├── 1185.py ├── 2168.py ├── 1099.py ├── 1186.py ├── 1553.py ├── 1196.py ├── 1188.py ├── 2138.py ├── 1118.py ├── 1187.py ├── 1534.py ├── 1618.py ├── 1074.py ├── 1181.py ├── 1228.py ├── 1867.py ├── 1050.py ├── 2310.py ├── 1066.py ├── 1160.py ├── 1410.py ├── 2003.py ├── 1267.py ├── 2059.py ├── 1107.py ├── 1182.py ├── 1983.py ├── 2486.py ├── 1105.py ├── 1189.py ├── 1190.py ├── 1048.py ├── 1051.py ├── 2028.py ├── 2293.py ├── 2313.py ├── 3311.py ├── 1929.py ├── 2140.py ├── 1914.py ├── 1042.py ├── 1555.py ├── 1953.py ├── 1040.py ├── 1961.py ├── 1018.py ├── 1101.py ├── 1145.py ├── 2221.py └── 1848.py ├── .gitattributes └── CSharp ├── 2058.cs ├── 1000.cs ├── 1795.cs ├── 1016.cs ├── 1095.cs ├── 3126.cs ├── 1001.cs ├── 2408.cs ├── 1003.cs ├── 1004.cs ├── 1864.cs ├── 2234.cs ├── 1075.cs ├── 1858.cs ├── 2765.cs ├── 1173.cs ├── 1143.cs ├── 2437.cs ├── 2006.cs ├── 1067.cs ├── 2345.cs ├── 1073.cs ├── 1059.cs ├── 1924.cs ├── 1019.cs ├── 1096.cs ├── 1157.cs ├── 1070.cs ├── 3076.cs ├── 2510.cs ├── 2762.cs ├── 2651.cs ├── 1002.cs ├── 2787.cs ├── 1963.cs ├── 2755.cs ├── 1805.cs ├── 2453.cs ├── 2377.cs ├── 1142.cs ├── 1078.cs ├── 1178.cs ├── 2840.cs ├── 3088.cs ├── 1065.cs ├── 1097.cs ├── 1175.cs ├── 1930.cs ├── 3224.cs ├── 1017.cs ├── 1060.cs ├── 1155.cs ├── 1612.cs ├── 2418.cs ├── 3302.cs ├── 1011.cs ├── 1589.cs ├── 2217.cs ├── 3346.cs ├── 3300.cs ├── 1387.cs ├── 1020.cs ├── 3303.cs ├── 1080.cs ├── 1865.cs ├── 1005.cs ├── 2410.cs ├── 1007.cs ├── 1014.cs ├── 2375.cs ├── 2424.cs ├── 1153.cs ├── 1708.cs ├── 1156.cs ├── 1936.cs ├── 3299.cs ├── 1144.cs ├── 1114.cs ├── 1172.cs ├── 2381.cs ├── 1428.cs ├── 1180.cs ├── 1541.cs ├── 2759.cs ├── 2826.cs ├── 1177.cs ├── 2435.cs ├── 1113.cs ├── 2464.cs ├── 1006.cs ├── 1573.cs ├── 1609.cs ├── 1796.cs ├── 3038.cs ├── 2295.cs ├── 2670.cs ├── 1010.cs ├── 1151.cs ├── 2653.cs ├── 2764.cs ├── 2926.cs ├── 3342.cs ├── 1009.cs ├── 1052.cs ├── 1026.cs ├── 1035.cs ├── 1046.cs ├── 1149.cs ├── 1837.cs ├── 1933.cs ├── 2174.cs ├── 2815.cs ├── 2747.cs ├── 1871.cs ├── 1980.cs ├── 1008.cs ├── 1158.cs ├── 1794.cs ├── 2756.cs ├── 2137.cs ├── 2460.cs ├── 1042.cs ├── 1072.cs ├── 1546.cs ├── 1961 - runtime error - Help me.cs ├── 2322.cs ├── 1715.cs ├── 2963.cs ├── 1038.cs ├── 2544.cs ├── 2057.cs ├── 2356.cs ├── 2444.cs ├── 1013.cs ├── 1043.cs ├── 1533.cs ├── 2457.cs ├── 1174.cs ├── 1379.cs ├── 1146.cs ├── 2420.cs ├── 1015.cs ├── 2023.cs ├── 2456.cs ├── 2721.cs ├── 1759.cs ├── 1866.cs ├── 2863.cs ├── 1018.cs ├── 1120.cs ├── 3311.cs ├── 1987.cs ├── 2752.cs ├── 2782.cs ├── 1216.cs ├── 3039.cs ├── 1079.cs ├── 2175.cs ├── 2749.cs ├── 1116.cs ├── 2748.cs ├── 2754.cs ├── 1101.cs ├── 2395.cs ├── 2378.cs ├── 3214.cs ├── 1150.cs ├── 1159.cs ├── 2344.cs ├── 2242.cs ├── 2783.cs ├── 1743.cs ├── 3058.cs ├── 1071.cs ├── 2880.cs ├── 2760.cs ├── 1800.cs ├── 2968.cs ├── 1154.cs ├── 2170.cs ├── 1940.cs ├── 2342.cs ├── 1593.cs ├── 1768.cs ├── 1893.cs └── 2591.cs /Python/1000.py: -------------------------------------------------------------------------------- 1 | print('Hello World!') -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.py linguist-detectable=true -------------------------------------------------------------------------------- /Python/1984.py: -------------------------------------------------------------------------------- 1 | n = input().strip() 2 | print(n[::-1]) -------------------------------------------------------------------------------- /Python/1059.py: -------------------------------------------------------------------------------- 1 | for x in range(1,51): 2 | print(x*2) 3 | -------------------------------------------------------------------------------- /Python/2374.py: -------------------------------------------------------------------------------- 1 | n,x=int(input()),int(input()) 2 | print(n-x) 3 | -------------------------------------------------------------------------------- /Python/3126.py: -------------------------------------------------------------------------------- 1 | input() 2 | print(sum(map(int, input().split()))) -------------------------------------------------------------------------------- /Python/2408.py: -------------------------------------------------------------------------------- 1 | n=list(map(int,input().split())) 2 | n.sort() 3 | print(n[1]) -------------------------------------------------------------------------------- /Python/2234.py: -------------------------------------------------------------------------------- 1 | h,p=map(int,input().split()) 2 | print('{:.2f}'.format(h/p)) 3 | -------------------------------------------------------------------------------- /Python/2950.py: -------------------------------------------------------------------------------- 1 | dist,a,b = map(int,input().split()) 2 | print(f'{dist/(a+b):.2f}') -------------------------------------------------------------------------------- /Python/1016.py: -------------------------------------------------------------------------------- 1 | d = int(input()) 2 | t = int(d * 2) 3 | print('{} minutos'.format(t)) 4 | -------------------------------------------------------------------------------- /Python/2581.py: -------------------------------------------------------------------------------- 1 | for i in range(int(input())): 2 | input() 3 | print('I am Toorg!') -------------------------------------------------------------------------------- /Python/1001.py: -------------------------------------------------------------------------------- 1 | A=int(input()) 2 | B=int(input()) 3 | 4 | X=A+B 5 | 6 | print('X = {}'.format(X)) 7 | -------------------------------------------------------------------------------- /Python/1002.py: -------------------------------------------------------------------------------- 1 | pi = 3.14159 2 | r = float(input()) 3 | a = pi*r**2 4 | print('A={:.4f}'.format(a)) 5 | -------------------------------------------------------------------------------- /Python/2160.py: -------------------------------------------------------------------------------- 1 | n = input() 2 | if len(n) <= 80: 3 | print('YES') 4 | else: 5 | print('NO') 6 | -------------------------------------------------------------------------------- /Python/2165.py: -------------------------------------------------------------------------------- 1 | n = input() 2 | if len(n) <= 140: 3 | print('TWEET') 4 | else: 5 | print('MUTE') 6 | -------------------------------------------------------------------------------- /Python/2437.py: -------------------------------------------------------------------------------- 1 | import math 2 | n = list(map(int,input().split())) 3 | print(abs(n[0]-n[2])+abs(n[1]-n[3])) -------------------------------------------------------------------------------- /Python/1003.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | SOMA = a + b 4 | print('SOMA = {}'.format(SOMA)) 5 | -------------------------------------------------------------------------------- /Python/1004.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | PROD = a * b 4 | print('PROD = {}'.format(PROD)) 5 | -------------------------------------------------------------------------------- /Python/1075.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(1,10001): 4 | if i % n == 2: 5 | print(i) 6 | -------------------------------------------------------------------------------- /Python/1014.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | y = float(input()) 3 | gasto = x / y 4 | print('{:.3f} km/l'.format(gasto)) 5 | -------------------------------------------------------------------------------- /Python/1157.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(1, n + 1): 4 | if n % i == 0: 5 | print(i) 6 | -------------------------------------------------------------------------------- /Python/2766.py: -------------------------------------------------------------------------------- 1 | for i in range(10): 2 | x= input() 3 | if i == 2 or i ==6 or i== 8: 4 | print(x) 5 | -------------------------------------------------------------------------------- /Python/1078.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(1, 11): 4 | print('{} x {} = {}'.format(i , n , i * n)) 5 | -------------------------------------------------------------------------------- /Python/1155.py: -------------------------------------------------------------------------------- 1 | s = 0 2 | for i in range(1,101): 3 | s =float( s + float(1)/float(i)) 4 | print('{:.2f}'.format(s)) 5 | -------------------------------------------------------------------------------- /Python/2176.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | if s.count('1') % 2 == 0: 3 | s += '0' 4 | else: 5 | s += '1' 6 | 7 | print(s) 8 | -------------------------------------------------------------------------------- /Python/1017.py: -------------------------------------------------------------------------------- 1 | t = int(input()) 2 | v = int(input()) 3 | c = 12 4 | litros = t * v / 12 5 | print('{:.3f}'.format(litros)) 6 | -------------------------------------------------------------------------------- /Python/1067.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | i = 1 3 | while i <= x: 4 | if i % 2 != 0: 5 | print(i) 6 | i = i + 1 7 | -------------------------------------------------------------------------------- /Python/1070.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | 3 | for i in range(1,13): 4 | if x % 2 != 0: 5 | print(x) 6 | x = x + 1 7 | -------------------------------------------------------------------------------- /Python/1073.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | x = 2 3 | for i in range(2 , n + 1 , 2): 4 | print('{}^2 = {}'.format(i, i **2)) 5 | -------------------------------------------------------------------------------- /Python/2410.py: -------------------------------------------------------------------------------- 1 | lista=set() 2 | 3 | n=int(input()) 4 | for i in range(n): 5 | lista.add(int(input())) 6 | print(len(lista)) -------------------------------------------------------------------------------- /Python/1005.py: -------------------------------------------------------------------------------- 1 | a = float(input()) 2 | b = float(input()) 3 | MEDIA = (a*3.5 + b*7.5)/11 4 | print('MEDIA = {:.5f}'.format(MEDIA)) 5 | -------------------------------------------------------------------------------- /Python/1095.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | j = 60 3 | 4 | while j >= 0: 5 | print('I={} J={}'.format(i,j)) 6 | i = i + 3 7 | j = j - 5 8 | -------------------------------------------------------------------------------- /Python/1612.py: -------------------------------------------------------------------------------- 1 | import math 2 | n=int(input()) 3 | for i in range(n): 4 | tronco =int(input()) 5 | print(math.ceil(tronco/2)) -------------------------------------------------------------------------------- /Python/2146.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n = int(input()) 4 | print(n-1) 5 | except EOFError: 6 | break -------------------------------------------------------------------------------- /Python/2295.py: -------------------------------------------------------------------------------- 1 | n=list(map(float,input().split())) 2 | 3 | if n[0]/n[2] 0: 5 | y = y + 1 6 | print('{} valores positivos'.format(y)) 7 | -------------------------------------------------------------------------------- /Python/1174.py: -------------------------------------------------------------------------------- 1 | A=[] 2 | for i in range(100): 3 | x = float(input()) 4 | A.append(x) 5 | if x <=10.0: 6 | print('A[{}] = {}'.format(i,x)) 7 | -------------------------------------------------------------------------------- /Python/1178.py: -------------------------------------------------------------------------------- 1 | x=float(input()) 2 | n=[] 3 | x=x*2 4 | for i in range(100): 5 | n.append(x) 6 | print('N[{}] = {:.4f}'.format(i,x/2)) 7 | x=x/2 8 | -------------------------------------------------------------------------------- /Python/1197.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | a,b=list(map(int,input().split())) 4 | print(a*b*2) 5 | 6 | except EOFError: 7 | break 8 | -------------------------------------------------------------------------------- /Python/2375.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | m = list(map(int,input().split())) 3 | 4 | if n<= m[0] and n<=m[1] and n<=m[2]: 5 | print("S") 6 | else: 7 | print("N") -------------------------------------------------------------------------------- /Python/2717.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | a,b=list(map(int,input().split())) 3 | if (a+b)>n: 4 | print('Deixa para amanha!') 5 | else: 6 | print('Farei hoje!') 7 | -------------------------------------------------------------------------------- /Python/3129.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | x=list() 3 | for i in range(n): 4 | x.append(int(input())) 5 | 6 | print(len(set(x))) 7 | print(len(x)-len(set(x))) 8 | -------------------------------------------------------------------------------- /Python/1143.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(1, n + 1): 4 | print('{} {} {}'.format(i,i**2,i**3)) 5 | print('{} {} {}'.format(i,i**2+1,i**3+1)) 6 | -------------------------------------------------------------------------------- /Python/1924.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | n = int(input()) 3 | for i in range(n): 4 | x = input() 5 | return 'Ciencia da Computacao' 6 | 7 | print(main()) 8 | -------------------------------------------------------------------------------- /Python/1936.py: -------------------------------------------------------------------------------- 1 | lista = [ 40320,5040,720,120,24,6,2, 1] 2 | 3 | n = int(input()) 4 | cont=0 5 | for i in lista: 6 | cont+= n//i 7 | n%=i 8 | print(cont) 9 | -------------------------------------------------------------------------------- /CSharp/2058.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | class Program 3 | { 4 | static void Main() 5 | { 6 | Console.WriteLine(int.Parse(Console.ReadLine())-2); 7 | } 8 | } -------------------------------------------------------------------------------- /Python/1007.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | c = int(input()) 4 | d = int(input()) 5 | DIFERENCA = (a*b-c*d) 6 | print('DIFERENCA = {}'.format(DIFERENCA)) 7 | -------------------------------------------------------------------------------- /Python/1153.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | fatorial = 1 3 | 4 | while n >= 1: 5 | fatorial = fatorial * n 6 | n = n - 1 7 | 8 | print(fatorial) 9 | 10 | -------------------------------------------------------------------------------- /Python/1173.py: -------------------------------------------------------------------------------- 1 | N=[0,0,0,0,0,0,0,0,0,0] 2 | v= int(input()) 3 | 4 | for i in range(len(N)): 5 | N[i] = v 6 | v = v*2 7 | print('N[{}] = {}'.format(i,N[i])) 8 | -------------------------------------------------------------------------------- /Python/1796.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | x = list(map(int, input().split())) 3 | zero = x.count(0) 4 | 5 | if zero > n / 2: 6 | print("Y") 7 | else: 8 | print("N") 9 | -------------------------------------------------------------------------------- /Python/2159.py: -------------------------------------------------------------------------------- 1 | from math import log 2 | n = int(input()) 3 | p = n / log(n) 4 | m = 1.25506 * ( p ) 5 | print('{:.1f}'.format(p),end=' ') 6 | print('{:.1f}'.format(m)) 7 | -------------------------------------------------------------------------------- /Python/2334.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n = int(input()) 3 | if n == -1: 4 | break 5 | n -= 1 6 | 7 | if n <0: 8 | n=0 9 | print(n) 10 | -------------------------------------------------------------------------------- /Python/2454.py: -------------------------------------------------------------------------------- 1 | p,r=input().split() 2 | 3 | if p=='0': 4 | print('C') 5 | elif p =='1' and r == '0': 6 | print('B') 7 | elif p =='1' and r=='1': 8 | print('A') -------------------------------------------------------------------------------- /Python/1175.py: -------------------------------------------------------------------------------- 1 | N=[] 2 | for i in range(20): 3 | x=int(input()) 4 | N.append(x) 5 | a=N[::-1] 6 | for j in range(20): 7 | print('N[{}] = {}'.format(j,a[j])) 8 | 9 | -------------------------------------------------------------------------------- /Python/2377.py: -------------------------------------------------------------------------------- 1 | x = list(map(int, input().split())) 2 | y = list(map(int, input().split())) 3 | 4 | result = (x[0] // x[1]) * y[1] + x[0] * y[0] 5 | 6 | 7 | print(result) 8 | -------------------------------------------------------------------------------- /Python/2453.py: -------------------------------------------------------------------------------- 1 | n=input() 2 | n = n.replace("pp", "-") 3 | n = n.replace("pP", "+") 4 | n = n.replace("p", "") 5 | n = n.replace("-", "p") 6 | n = n.replace("+", "P") 7 | print(n) -------------------------------------------------------------------------------- /Python/1019.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | h = n // 60**2 3 | n = n - h * 60**2 4 | 5 | m = n // 60 6 | n = n - m*60 7 | 8 | s = n 9 | 10 | print('{}:{}:{}'.format(h, m, s)) 11 | -------------------------------------------------------------------------------- /CSharp/1000.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) { 6 | 7 | Console.WriteLine("Hello World!"); 8 | 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /Python/1008.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | c = float(input()) 4 | SALARY = float(b * c) 5 | print('NUMBER = {}'.format(a)) 6 | print('SALARY = U$ {:.2f}'.format(SALARY)) 7 | -------------------------------------------------------------------------------- /Python/1172.py: -------------------------------------------------------------------------------- 1 | X=[1,2,3,4,5,6,7,8,9,10] 2 | for i in range(len(X)): 3 | X[i]=int(input()) 4 | if X[i] <=0: 5 | X[i] = 1 6 | print('X[{}] = {}'.format(i,X[i])) 7 | 8 | -------------------------------------------------------------------------------- /Python/1708.py: -------------------------------------------------------------------------------- 1 | n =list(map(int,input().split())) 2 | 3 | cont=0 4 | seg=0 5 | 6 | while(seg= 24: 6 | hora -= 24 7 | if hora <0: 8 | hora = 24 + hora 9 | 10 | print(hora) -------------------------------------------------------------------------------- /Python/1052.py: -------------------------------------------------------------------------------- 1 | i = int(input()) 2 | m = ['','January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] 3 | print(m[i]) 4 | -------------------------------------------------------------------------------- /Python/1096.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | 3 | j = 7 4 | 5 | while i <= 9: 6 | while j >= 5: 7 | print('I={} J={}'.format(i,j)) 8 | j = j - 1 9 | i = i + 2 10 | j = 7 11 | -------------------------------------------------------------------------------- /Python/2457.py: -------------------------------------------------------------------------------- 1 | letra=input() 2 | frase=input().split() 3 | cont=0 4 | 5 | for i in range(len(frase)): 6 | if letra in frase[i]: 7 | cont+=1 8 | print(f'{100*(cont/len(frase)):.1f}') -------------------------------------------------------------------------------- /Python/1097.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | j = 7 3 | 4 | while i <= 9: 5 | for c in range(1,4): 6 | print('I={} J={}'.format(i,j)) 7 | j = j - 1 8 | i = i + 2 9 | j = j + 5 10 | -------------------------------------------------------------------------------- /Python/1957.py: -------------------------------------------------------------------------------- 1 | def int_hex(v): 2 | v = hex(v) 3 | v = v[2:] 4 | return v 5 | 6 | def main(v): 7 | v = v.upper() 8 | print(v) 9 | 10 | main(int_hex(int(input()))) 11 | -------------------------------------------------------------------------------- /Python/2164.py: -------------------------------------------------------------------------------- 1 | def fibo(n): 2 | f = ((((1 + (5)**(1/2))/2) ** n - (((1 - (5)**(1/2))/2) ** n))) /(5 ** (1/2)) 3 | return f 4 | 5 | n = int(input()) 6 | print('{:.1f}'.format(fibo(n))) 7 | -------------------------------------------------------------------------------- /Python/1079.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(1 , n + 1 ): 4 | x = input().split() 5 | a,b,c = x 6 | print('{:.1f}'.format((float(a) * 2 + float(b) * 3 + float(c) * 5) / 10)) 7 | -------------------------------------------------------------------------------- /Python/1573.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | while True: 4 | n=list(map(int,input().split())) 5 | if n[0]==0 and n[1]==0 and n[2]==0: 6 | break; 7 | print(math.trunc((n[0]*n[1]*n[2])**(1/3))) -------------------------------------------------------------------------------- /Python/1015.py: -------------------------------------------------------------------------------- 1 | p1 = input().split() 2 | x1, y1 = p1 3 | p2 = input().split() 4 | x2, y2 = p2 5 | 6 | d = ((float(x1) - float(x2))**2 + (float(y2) - float(y1))**2)**(0.5) 7 | print('{:.4f}'.format(d)) 8 | -------------------------------------------------------------------------------- /Python/1010.py: -------------------------------------------------------------------------------- 1 | a = input().split() 2 | ca, qa, va = a 3 | b = input().split() 4 | cb, qb, vb = b 5 | 6 | t = float(int(qa) * float(va) + int(qb) * float(vb)) 7 | print('VALOR A PAGAR: R$ {:.2f}'.format(t)) 8 | -------------------------------------------------------------------------------- /Python/1113.py: -------------------------------------------------------------------------------- 1 | x=100 2 | y=1000 3 | 4 | while x != y: 5 | x, y = map(int, input().split()) 6 | if x > y: 7 | print('Decrescente') 8 | elif x < y: 9 | print('Crescente') 10 | -------------------------------------------------------------------------------- /Python/1170.py: -------------------------------------------------------------------------------- 1 | for _ in range(int(input())): 2 | comida = float(input()) 3 | count = 0 4 | while comida >1: 5 | comida/=2 6 | count+=1 7 | print(f'{count} dias') 8 | 9 | -------------------------------------------------------------------------------- /Python/1198.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | a,b=list(map(int,input().split())) 4 | except ValueError: 5 | break 6 | except EOFError: 7 | break 8 | print(abs(a-b)) 9 | -------------------------------------------------------------------------------- /CSharp/1795.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | Console.WriteLine($"{Math.Pow(3,long.Parse(Console.ReadLine()))}"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Python/2460.py: -------------------------------------------------------------------------------- 1 | n=input() 2 | fila=list(map(int,input().split())) 3 | n = input() 4 | desistentes=set(map(int, input().split())) 5 | fila=[x for x in fila if x not in desistentes] 6 | print(" ".join(map(str, fila))) 7 | -------------------------------------------------------------------------------- /Python/1046.py: -------------------------------------------------------------------------------- 1 | x = input().split() 2 | i, f = x 3 | 4 | i = int(x[0]) 5 | f = int(x[1]) 6 | 7 | if i < f: 8 | t = f - i 9 | else: 10 | t = (24 - i) + f 11 | print('O JOGO DUROU {} HORA(S)'.format(t)) 12 | -------------------------------------------------------------------------------- /Python/1759.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | string = '' 4 | for i in range(n): 5 | string += 'Ho' 6 | if i == (n-1): 7 | string += '!' 8 | else: 9 | string += ' ' 10 | print(string) 11 | -------------------------------------------------------------------------------- /Python/1864.py: -------------------------------------------------------------------------------- 1 | def print_sem_nocao(frase,n): 2 | print(frase[0:n]) 3 | 4 | def main(): 5 | n = int(input()) 6 | print_sem_nocao('LIFE IS NOT A PROBLEM TO BE SOLVED',n) 7 | 8 | main() 9 | 10 | -------------------------------------------------------------------------------- /Python/1865.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(n): 4 | x = input().split() 5 | 6 | a, b = x 7 | 8 | if a == 'Thor': 9 | print('Y') 10 | else: 11 | print('N') 12 | 13 | -------------------------------------------------------------------------------- /Python/2167.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | r =list() 3 | r = input().split() 4 | rrr = 0 5 | for i in range(len(r)-1): 6 | if int(r[i]) > int(r [i +1]): 7 | rrr= i + 2 8 | break 9 | print(rrr) 10 | -------------------------------------------------------------------------------- /Python/2702.py: -------------------------------------------------------------------------------- 1 | a,b,c = list(map(int,input().split())) 2 | A,B,C= list(map(int,input().split())) 3 | cont=0 4 | if ab[0] or a[1]>b[1] or a[2]>b[2]: 5 | qtd=0 6 | else: 7 | qtd= (b[0]//a[0])*(b[1]//a[1])*(b[2]//a[2]) 8 | print(qtd) -------------------------------------------------------------------------------- /Python/1114.py: -------------------------------------------------------------------------------- 1 | senha = 1 2 | 3 | while senha != 2002: 4 | senha = int(input()) 5 | if senha != 2002: 6 | print('Senha Invalida') 7 | else: 8 | print('Acesso Permitido') 9 | break 10 | -------------------------------------------------------------------------------- /Python/1154.py: -------------------------------------------------------------------------------- 1 | x = 100 2 | soma = 0 3 | i = 0 4 | while x >= 0: 5 | x = int(input()) 6 | if x >= 0: 7 | i = i + 1 8 | soma = soma + x 9 | media = soma / i 10 | print('{:.2f}'.format(media)) 11 | -------------------------------------------------------------------------------- /Python/1761.py: -------------------------------------------------------------------------------- 1 | p=3.141592654 2 | import math 3 | while True: 4 | try: 5 | a,b,c=list(map(float,input().split())) 6 | h=math.tan(a*p/180)*b 7 | print(f'{5*(h+c):.2f}') 8 | except EOFError: 9 | break -------------------------------------------------------------------------------- /Python/2235.py: -------------------------------------------------------------------------------- 1 | x = input().split() 2 | for i in range(len(x)): 3 | x[i] = int(x[i]) 4 | 5 | x.sort() 6 | 7 | a,b,c =x 8 | 9 | if a + b == c or a==b or a==c or b==c: 10 | print('S') 11 | else: 12 | print('N') 13 | -------------------------------------------------------------------------------- /CSharp/1016.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) { 6 | 7 | int x = int.Parse(Console.ReadLine()); 8 | Console.WriteLine($"{x*2} minutos"); 9 | 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /CSharp/1095.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | class URI 3 | { 4 | static void Main() 5 | { 6 | int i =1; 7 | for(int j =60;j>-1;j-=5) 8 | {Console.WriteLine($"I={i} J={j}");i+=3;} 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Python/1080.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | x=0 3 | 4 | for i in range(1,100): 5 | a = int(input()) 6 | if a > x: 7 | maior = a 8 | posicao = i + 1 9 | x = a 10 | 11 | print(maior) 12 | print(posicao) 13 | -------------------------------------------------------------------------------- /Python/2143.py: -------------------------------------------------------------------------------- 1 | t = 1 2 | while t != 0: 3 | t = int(input()) 4 | for i in range(t): 5 | n = int(input()) 6 | if n % 2 == 0: 7 | print(2 * (n - 2) + 2) 8 | else: 9 | print(2 * (n - 1) + 1) -------------------------------------------------------------------------------- /Python/1020.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | a = n // 365 4 | n = n - a*365 5 | 6 | m = n // 30 7 | n = n - m*30 8 | 9 | d = n 10 | 11 | print('{} ano(s)'.format(a)) 12 | print('{} mes(es)'.format(m)) 13 | print('{} dia(s)'.format(d)) 14 | -------------------------------------------------------------------------------- /Python/1959.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | n,l = map(int,input().split()) 3 | return n,l 4 | 5 | def perimetro(n,lado): 6 | return n*lado 7 | 8 | def main(): 9 | n,l=entrada() 10 | print(perimetro(n,l)) 11 | 12 | main() 13 | -------------------------------------------------------------------------------- /Python/2344.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | if n==0: 4 | print('E') 5 | elif n>=1 and n<=35: 6 | print('D') 7 | elif n>=36 and n<=60: 8 | print('C') 9 | elif n>=61 and n<=85: 10 | print('B') 11 | else: 12 | print('A') 13 | -------------------------------------------------------------------------------- /Python/1071.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | y = int(input()) 3 | s=0 4 | if x < y: 5 | a = x 6 | b = y 7 | else: 8 | a = y 9 | b = x 10 | 11 | for i in range(a+1,b): 12 | if i % 2 != 0: 13 | s = s + i 14 | print(s) 15 | -------------------------------------------------------------------------------- /Python/1921.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | n = int(input()) 3 | return n 4 | 5 | def laco(n): 6 | s = 0 7 | for i in range(n): 8 | s += i 9 | s -= n 10 | print(s) 11 | 12 | 13 | 14 | laco(entrada()) 15 | 16 | -------------------------------------------------------------------------------- /Python/2175.py: -------------------------------------------------------------------------------- 1 | n=list(map(float,input().split())) 2 | if n[0]n[1]): 9 | peso="S" 10 | print(peso) -------------------------------------------------------------------------------- /Python/1028.py: -------------------------------------------------------------------------------- 1 | def mdc(a, b): 2 | while b != 0: 3 | a, b = b, a % b 4 | return a 5 | 6 | n = int(input()) 7 | for i in range(n): 8 | ri,vi = list(map(int,input().split())) 9 | 10 | saida = mdc(ri,vi) 11 | print(saida) -------------------------------------------------------------------------------- /Python/1065.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | c = int(input()) 4 | d = int(input()) 5 | e = int(input()) 6 | 7 | s=0 8 | 9 | for n in [a,b,c,d,e]: 10 | if n % 2 ==0: 11 | s = s + 1 12 | print('{} valores pares'.format(s)) 13 | -------------------------------------------------------------------------------- /Python/1715.py: -------------------------------------------------------------------------------- 1 | cont = 0 2 | 3 | n = list(map(int, input().split())) 4 | lista = [0] * n[1] 5 | for _ in range(n[0]): 6 | lista = list(map(int, input().split())) 7 | if 0 not in lista: 8 | cont += 1 9 | 10 | 11 | 12 | print(cont) 13 | -------------------------------------------------------------------------------- /Python/2444.py: -------------------------------------------------------------------------------- 1 | n = list(map(int,input().split())) 2 | m = list(map(int,input().split())) 3 | 4 | for item in m: 5 | n[0]+=item 6 | if(n[0]>100): 7 | n[0]=100 8 | elif(n[0]<0): 9 | n[0]=0 10 | print(n[0]) 11 | 12 | -------------------------------------------------------------------------------- /Python/2747.py: -------------------------------------------------------------------------------- 1 | for i in range(39): 2 | print('-', end = '') 3 | print('') 4 | for i in range( 5): 5 | print('| |') 6 | for i in range(39): 7 | print('-', end = '') 8 | print('') 9 | -------------------------------------------------------------------------------- /Python/1133.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | y = int(input()) 3 | 4 | if x > y: 5 | a = y 6 | b = x 7 | if x <= y: 8 | a = x 9 | b = y 10 | a=a+1 11 | while a < b: 12 | if a % 5 == 2 or a % 5 == 3: 13 | print(a) 14 | a = a + 1 15 | -------------------------------------------------------------------------------- /Python/1794.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | lava = list(map(int, input().split())) 3 | seca = list(map(int, input().split())) 4 | 5 | 6 | if lava[0] <= n <= lava[1] and seca[0] <= n <= seca[1]: 7 | print("possivel") 8 | else: 9 | print("impossivel") 10 | -------------------------------------------------------------------------------- /Python/1858.py: -------------------------------------------------------------------------------- 1 | def pessoas(): 2 | n = int(input()) 3 | x = input().split() 4 | for i in range(n): 5 | x[i] = int(x[i]) 6 | menor = min(x) 7 | y = x.index(menor) + 1 8 | 9 | return y 10 | 11 | print(pessoas()) 12 | 13 | -------------------------------------------------------------------------------- /Python/1930.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | a,b,c,d = map(int,input().split()) 3 | return a,b,c,d 4 | 5 | def total(a,b,c,d): 6 | return a + b + c + d - 3 7 | 8 | def main(): 9 | a,b,c,d = entrada() 10 | print(total(a,b,c,d)) 11 | 12 | main() 13 | -------------------------------------------------------------------------------- /CSharp/3126.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | Console.ReadLine(); 9 | Console.WriteLine(Console.ReadLine().Split().Select(int.Parse).ToArray().Sum()); 10 | } 11 | } -------------------------------------------------------------------------------- /Python/1149.py: -------------------------------------------------------------------------------- 1 | x = list(map(int, input().split())) 2 | i = 1 3 | s = 0 4 | 5 | while x[i] <= 0: 6 | if x[i] <=0: 7 | i = i + 1 8 | if x[i] > 0: 9 | break 10 | 11 | for c in range(0,x[i]): 12 | s = s + x[0] + c 13 | 14 | print(s) 15 | -------------------------------------------------------------------------------- /Python/1177.py: -------------------------------------------------------------------------------- 1 | t=int(input()) 2 | n=[] 3 | j=0 4 | i=0 5 | while i <(1000): 6 | n.append(j) 7 | print('N[{}] = {}'.format(i,j)) 8 | if j<(t-1): 9 | j = j + 1 10 | else: 11 | j == t-1 12 | j = 0 13 | i = i + 1 14 | 15 | -------------------------------------------------------------------------------- /Python/1800.py: -------------------------------------------------------------------------------- 1 | n = list(map(int,input().split())) 2 | foi = list(map(int,input().split())) 3 | 4 | for i in range(n[0]): 5 | x=int(input()) 6 | if(x in foi): 7 | print(0) 8 | else: 9 | print(1) 10 | foi.append(x) 11 | 12 | -------------------------------------------------------------------------------- /CSharp/1001.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) { 6 | int a = int.Parse(Console.ReadLine()); 7 | int b = int.Parse(Console.ReadLine()); 8 | Console.WriteLine($"X = {a+b}"); 9 | 10 | 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /CSharp/2408.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] n = Console.ReadLine().Split().Select(int.Parse).OrderBy(x=>x).ToArray(); 9 | Console.WriteLine(n[1]); 10 | } 11 | } -------------------------------------------------------------------------------- /Python/1150.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | z = x - 1 3 | 4 | i = 2 5 | soma = x 6 | s=1 7 | while z <= x: 8 | z = int(input()) 9 | 10 | while soma <= z: 11 | soma = soma + x + s 12 | 13 | if soma <= z: 14 | i = i + 1 15 | s=s+1 16 | print(i) 17 | -------------------------------------------------------------------------------- /Python/1300.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n = input().strip() 4 | if n=="": 5 | break 6 | 7 | if int(n)%6==0: 8 | print("Y") 9 | else: 10 | print("N") 11 | except EOFError: 12 | break 13 | -------------------------------------------------------------------------------- /Python/1963.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | a,b = map(float,input().split()) 3 | 4 | return a,b 5 | 6 | def aumento(a,b): 7 | p = 100 * ((b - a)/a) 8 | print('{:.2f}%'.format(p)) 9 | 10 | def main(): 11 | a,b = entrada() 12 | aumento(a,b) 13 | 14 | main() -------------------------------------------------------------------------------- /Python/1035.py: -------------------------------------------------------------------------------- 1 | x = input().split() 2 | a, b, c, d = x 3 | a = int(a) 4 | b = int(b) 5 | c = int(c) 6 | d = int(d) 7 | if b > c and d > a and (c + d) > (a + b) and c > 0 and d > 0 and a % 2 == 0: 8 | print('Valores aceitos') 9 | else: 10 | print('Valores nao aceitos') 11 | -------------------------------------------------------------------------------- /Python/1901.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | listao =set() 3 | floresta=[] 4 | for i in range(n): 5 | floresta.append(list(map(int,input().split()))) 6 | for i in range(2*n): 7 | celula = list(map(int,input().split())) 8 | listao.add(floresta[celula[0]-1][celula[1]-1]) 9 | print(len(listao)) -------------------------------------------------------------------------------- /Python/1116.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(1, n + 1): 4 | x, y = map(int,input().split()) 5 | 6 | if y == 0: 7 | print('divisao impossivel') 8 | 9 | if y != 0: 10 | divisao = x / y 11 | print('{:.1f}'.format(divisao)) 12 | -------------------------------------------------------------------------------- /Python/1541.py: -------------------------------------------------------------------------------- 1 | x = 99999 2 | while True: 3 | x = input().split() 4 | if x == ['0']: 5 | break 6 | a,b,c = x 7 | 8 | a, b, c = int(a), int(b), int(c) 9 | 10 | 11 | A = a * b 12 | t = A *100 / c 13 | t = (t) ** (1/2) 14 | print(int(t)) 15 | -------------------------------------------------------------------------------- /Python/1837.py: -------------------------------------------------------------------------------- 1 | a,b =map(int,input().split()) 2 | m=max(abs(a),abs(b)) 3 | 4 | 5 | for q in range(-m,m+1): 6 | for r in range(-b,b+1): 7 | if a == b * q + r: 8 | quo = q 9 | res = r 10 | break 11 | print(quo,res) 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Python/1072.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | dentro = 0 3 | fora = 0 4 | for i in range(1,n + 1): 5 | x = int(input()) 6 | if x >= 10 and x <= 20: 7 | dentro = dentro + 1 8 | else: 9 | fora = fora + 1 10 | print('{} in'.format(dentro)) 11 | print('{} out'.format(fora)) 12 | -------------------------------------------------------------------------------- /Python/1132.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | y= int(input()) 3 | 4 | if x > y: 5 | a = y 6 | b = x 7 | if x <= y: 8 | a = x 9 | b = y 10 | 11 | soma = 0 12 | 13 | 14 | while a <= b: 15 | if a % 13 != 0: 16 | soma = soma + a 17 | a = a + 1 18 | print(soma) 19 | -------------------------------------------------------------------------------- /Python/1414.py: -------------------------------------------------------------------------------- 1 | while True: 2 | t,n=list(map(int,input().split())) 3 | if n==0 and t==0: 4 | break 5 | pontos=0 6 | for i in range(t): 7 | pontos+=int(input().split()[1]) 8 | if(pontos==3*n): 9 | print(0) 10 | else: 11 | print(3*n-pontos) -------------------------------------------------------------------------------- /Python/2523.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | a = input() 4 | n = int(input()) 5 | m = input().split() 6 | msg ='' 7 | for i in range(n): 8 | msg += a[int(m[i])-1] 9 | 10 | print(msg) 11 | except EOFError: 12 | break 13 | -------------------------------------------------------------------------------- /CSharp/1003.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) { 7 | int a = int.Parse(Console.ReadLine()); 8 | int b = int.Parse(Console.ReadLine()); 9 | 10 | Console.WriteLine($"SOMA = {a+b}"); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /CSharp/1004.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) { 7 | int a = int.Parse(Console.ReadLine()); 8 | int b = int.Parse(Console.ReadLine()); 9 | 10 | Console.WriteLine($"PROD = {a*b}"); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /CSharp/1864.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) { 6 | 7 | string a = "LIFE IS NOT A PROBLEM TO BE SOLVED"; 8 | int x =int.Parse(Console.ReadLine()); 9 | 10 | Console.WriteLine(a.Substring(0,x)); 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /CSharp/2234.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) { 7 | 8 | int[] x =Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | 10 | Console.WriteLine($"{(decimal)x[0]/x[1]:F2}"); 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /Python/1146.py: -------------------------------------------------------------------------------- 1 | x=1 2 | t=[] 3 | 4 | while x != 0: 5 | x = int(input()) 6 | for i in range(1, x + 1): 7 | t.append(i) 8 | t[i-1] = str(t[i-1]) 9 | i = i + i 10 | t=' '.join(t) 11 | if x!= 0: 12 | print(t) 13 | t =[] 14 | 15 | -------------------------------------------------------------------------------- /Python/1397.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n= int(input()) 3 | if n==0: 4 | break 5 | A=0 6 | B=0 7 | for i in range(n): 8 | a,b=list(map(int,input().split())) 9 | if a>b: 10 | A+=1 11 | elif a= 0 and nota <= 10: 6 | i = i + 1 7 | med = med + nota 8 | if nota < 0 or nota > 10: 9 | print('nota invalida') 10 | med = med / 2 11 | print('media = {:.2f}'.format(med)) 12 | -------------------------------------------------------------------------------- /Python/2415.py: -------------------------------------------------------------------------------- 1 | n =int(input()) 2 | cont=1 3 | maior=-999 4 | 5 | listao =list(map(int,input().split())) 6 | for i in range(n-1): 7 | if listao[i]==listao[i+1]: 8 | cont+=1 9 | else: 10 | maior=max(maior,cont) 11 | cont=1 12 | maior=max(maior,cont) 13 | print(maior) 14 | -------------------------------------------------------------------------------- /CSharp/1173.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main() 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | for(int i =0;i<10;i++) 9 | { 10 | Console.WriteLine($"N[{i}] = {n}"); 11 | n*=2; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Python/1069.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | for i in range(n): 3 | a=input() 4 | cont = 0 5 | while True: 6 | a=a.replace('.','') 7 | if '<>' in a: 8 | cont+=a.count('<>') 9 | a=a.replace('<>','') 10 | else: 11 | break 12 | print(cont) 13 | -------------------------------------------------------------------------------- /Python/1457.py: -------------------------------------------------------------------------------- 1 | def fat(n,k): 2 | x=n 3 | aux=1 4 | while (n-k*aux)>=1: 5 | x*=(n-k*aux) 6 | aux+=1 7 | return x 8 | 9 | 10 | for i in range(int(input())): 11 | n=input() 12 | aux = n.count('!') 13 | n=int(n.replace('!','')) 14 | print(fat(n,aux)) 15 | -------------------------------------------------------------------------------- /Python/1893.py: -------------------------------------------------------------------------------- 1 | lua = list(map(int, input().split())) 2 | a = lua[0] 3 | b = lua[1] 4 | 5 | if 0 <= b <= 2: 6 | print("nova") 7 | elif 3 <= b <= 96 and b > a: 8 | print("crescente") 9 | elif 97 <= b <= 100: 10 | print("cheia") 11 | elif 3 <= b <= 96 and b < a: 12 | print("minguante") 13 | -------------------------------------------------------------------------------- /CSharp/1143.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main(string[] args) 6 | { 7 | int n =int.Parse(Console.ReadLine()); 8 | for(int i = 1; i <= n;i++) 9 | { 10 | Console.WriteLine($"{i} {Math.Pow(i,2)} {Math.Pow(i,3)}"); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /CSharp/2437.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | 9 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | Console.WriteLine(Math.Abs(n[0]-n[2])+Math.Abs(n[1]-n[3])); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Python/1429.py: -------------------------------------------------------------------------------- 1 | def fat(x): 2 | aux=0 3 | for i in range(x-1,0,-1): 4 | x*=i 5 | return x 6 | 7 | 8 | while True: 9 | n=input() 10 | l=len(n) 11 | acm=0 12 | if n=='0': 13 | break 14 | for i in n: 15 | acm+=int(i)*fat(l) 16 | l-=1 17 | print(acm) -------------------------------------------------------------------------------- /CSharp/2006.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | char x= char.Parse(Console.ReadLine()); 9 | char[] y = Console.ReadLine().ToCharArray(); 10 | 11 | Console.WriteLine(y.Count(a=>a==x)); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /Python/1037.py: -------------------------------------------------------------------------------- 1 | x = float(input()) 2 | if 0<= x <= 25: 3 | print('Intervalo [0,25]') 4 | if 25< x <= 50: 5 | print('Intervalo (25,50]') 6 | if 50< x <= 75: 7 | print('Intervalo (50,75]') 8 | if 75< x <= 100: 9 | print('Intervalo (75,100]') 10 | if x >100 or x<0: 11 | print('Fora de intervalo') 12 | -------------------------------------------------------------------------------- /Python/1043.py: -------------------------------------------------------------------------------- 1 | x = input().split() 2 | a, b, c =x 3 | a = float(a) 4 | b = float(b) 5 | c = float(c) 6 | 7 | if abs(b - c) < a < (b + c) and (a - c) < b < (a + c) and (a - b) < c < (a + b): 8 | print('Perimetro = {:.1f}'.format(a + b + c)) 9 | else: 10 | print('Area = {:.1f}'.format(((a + b) / 2) * c)) 11 | -------------------------------------------------------------------------------- /Python/2543.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | cont=0 4 | a,b=list(map(int,input().split())) 5 | for i in range(a): 6 | c,d=list(map(int,input().split())) 7 | if c == b and d==0: 8 | cont+=1 9 | except EOFError: 10 | break 11 | print(cont) -------------------------------------------------------------------------------- /CSharp/1067.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | int n = int.Parse(Console.ReadLine()); 9 | int x =1; 10 | while(x<=n) 11 | { 12 | Console.WriteLine(x); 13 | x+=2; 14 | } 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /CSharp/2345.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | Array.Sort(n); 10 | Console.WriteLine(Math.Abs(n[3]+n[0]-(n[2]+n[1]))); 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /Python/1176.py: -------------------------------------------------------------------------------- 1 | t=int(input()) 2 | for i in range(t): 3 | x=int(input()) 4 | f=[0,1] 5 | if x>1: 6 | for j in range(2,x+1): 7 | 8 | f.append(f[j-2]+f[j-1]) 9 | print('Fib({}) = {}'.format(x,f[x])) 10 | if x <=1: 11 | print('Fib({}) = {}'.format(x,f[x])) 12 | -------------------------------------------------------------------------------- /Python/2399.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | listao=[] 3 | 4 | for i in range(n): 5 | listao.append(int(input())) 6 | 7 | if(n==1): 8 | print(listao[0]) 9 | else: 10 | print(listao[0]+listao[1]) 11 | for i in range(1,n-1): 12 | print(listao[i-1]+listao[i]+listao[i+1]) 13 | print(listao[n-1]+listao[n-2]) -------------------------------------------------------------------------------- /CSharp/1073.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int a = int.Parse(Console.ReadLine()); 8 | 9 | for(int i = 2; i <= a; i+=2) 10 | { 11 | Console.WriteLine($"{i}^2 = {Math.Pow(i,2)}"); 12 | } 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /Python/1366.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n=int(input()) 3 | if n==0: 4 | break 5 | sobra=0 6 | for i in range(n): 7 | lista = list(map(int, input().split())) 8 | if lista[1]%2 == 0: 9 | sobra+=lista[1] 10 | else: 11 | sobra+=lista[1] - 1 12 | print(sobra//4) 13 | -------------------------------------------------------------------------------- /Python/1428.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(n): 3 | essenegocioaquiquetefaleisemanapassadapelozapaposas22horasmorou = list(map(int,input().split())) 4 | print((essenegocioaquiquetefaleisemanapassadapelozapaposas22horasmorou[0]//3)* 5 | (essenegocioaquiquetefaleisemanapassadapelozapaposas22horasmorou[1]//3)) 6 | 7 | -------------------------------------------------------------------------------- /CSharp/1059.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | //using System.Linq; 3 | //using System.Globalization; 4 | 5 | namespace URI 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | for(int i =2;i<=100;i=i+2) 12 | { Console.WriteLine(i); } 13 | 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Python/1441.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n=int(input()) 3 | if(n==0): 4 | break 5 | lista = list() 6 | lista.append(n) 7 | while n!=1: 8 | if n%2==0: 9 | n=n/2 10 | else: 11 | n=n*3+1 12 | lista.append(n) 13 | print(int(max(lista))) 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Python/2044.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n= int(input()) 3 | if n ==-1: 4 | break 5 | x=list(map(int,input().split())) 6 | soma=0 7 | idas=0 8 | for i in x: 9 | soma+=i 10 | if soma%100 ==0: 11 | idas+=1 12 | print(idas) 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /CSharp/1924.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | 9 | for(int i =0;i4;j--) 11 | { 12 | Console.WriteLine($"I={i} J={j}"); 13 | } 14 | } 15 | } 16 | 17 | } 18 | 19 | -------------------------------------------------------------------------------- /CSharp/1157.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | 9 | for(int i =1;i<=n;i++) 10 | { 11 | if(n%i==0) 12 | { 13 | Console.WriteLine(i); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Python/1064.py: -------------------------------------------------------------------------------- 1 | a = float(input()) 2 | b = float(input()) 3 | c = float(input()) 4 | d = float(input()) 5 | e = float(input()) 6 | f = float(input()) 7 | s=0 8 | m =0 9 | t =[a,b,c,d,e,f] 10 | for n in t: 11 | if n > 0: 12 | s = s + 1 13 | m = m + (n) 14 | print('{} valores positivos'.format(s)) 15 | print('{:.1f}'.format(m/s)) 16 | -------------------------------------------------------------------------------- /Python/1151.py: -------------------------------------------------------------------------------- 1 | n =int(input()) 2 | i = 0 3 | t=[] 4 | while i < n: 5 | if i == 0 or i == 1: 6 | t.append(i) 7 | 8 | if i > 1: 9 | aux = t[i-2] +t[i-1] 10 | 11 | t.append(aux) 12 | i = i + 1 13 | for j in range(0, n): 14 | t[j] =str(t[j]) 15 | 16 | t = ' '.join(t) 17 | print(t) 18 | -------------------------------------------------------------------------------- /CSharp/1070.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | if(n%2==0) 9 | {n++;} 10 | 11 | for(int i = 0; i < 12; i+=2) 12 | { 13 | Console.WriteLine(i+n); 14 | } 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /CSharp/3076.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | string a; 9 | while((a=Console.ReadLine()) !=null) 10 | { 11 | double x = double.Parse(a)/100; 12 | 13 | Console.WriteLine((int)Math.Ceiling(x)); 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /Python/2479.py: -------------------------------------------------------------------------------- 1 | lista = [] 2 | n = int(input()) 3 | cont = 0 4 | 5 | for i in range(n): 6 | nome = input().split() 7 | if nome[0] == "+": 8 | cont += 1 9 | lista.append(nome[1]) 10 | lista.sort() 11 | 12 | for nome in lista: 13 | print(nome) 14 | 15 | print(f"Se comportaram: {cont} | Nao se comportaram: {n - cont}") 16 | -------------------------------------------------------------------------------- /CSharp/2510.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class HelloWorld 4 | { 5 | public static void Main(string[] args) 6 | { 7 | int n = Convert.ToInt32(Console.ReadLine()); 8 | 9 | for(int i =0; i 2 and a == 'J'): 9 | cont += 1 10 | 11 | 12 | 13 | print(cont) 14 | -------------------------------------------------------------------------------- /CSharp/1963.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | decimal[] x = Console.ReadLine().Split().Select(y=>decimal.Parse(y)).ToArray(); 9 | decimal a = x[0]; 10 | decimal b = x[1]; 11 | 12 | Console.WriteLine($"{((b-a)/a)*100:F2}%"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /CSharp/2755.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Program 4 | { 5 | public static void Main(string[] args) 6 | { 7 | Console.WriteLine("\"Ro'b'er\tto\\/\""); 8 | Console.WriteLine("(._.) ( l: ) ( .-. ) ( :l ) (._.)"); 9 | Console.WriteLine("(^_-) (-_-) (-_^)"); 10 | Console.WriteLine("(\"_\") ('.')"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Python/1165.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | for i in range(0,n): 4 | num = int(input()) 5 | s = 0 6 | j=1 7 | while j <= num: 8 | if num % j == 0: 9 | s = s + 1 10 | j = j + 1 11 | if s > 2: 12 | print('{} nao eh primo'.format(num)) 13 | else: 14 | print('{} eh primo'.format(num)) 15 | 16 | -------------------------------------------------------------------------------- /Python/2189.py: -------------------------------------------------------------------------------- 1 | cont=1 2 | while True: 3 | n=int(input()) 4 | if n==0: 5 | break 6 | 7 | lista =list(map(int,input().split())) 8 | for i in range(n): 9 | if(i+1==lista[i]): 10 | print(f'Teste {cont}') 11 | cont+=1 12 | print(i+1) 13 | print() 14 | break 15 | -------------------------------------------------------------------------------- /Python/2582.py: -------------------------------------------------------------------------------- 1 | songs = {0 : 'PROXYCITY', 2 | 1 : 'P.Y.N.G.', 3 | 2 : 'DNSUEY!', 4 | 3 : 'SERVERS', 5 | 4 : 'HOST!', 6 | 5 : 'CRIPTONIZE', 7 | 6 : 'OFFLINE DAY', 8 | 7 : 'SALT', 9 | 8 : 'ANSWER!', 10 | 9 : 'RAR?', 11 | 10 : 'WIFI ANTENNAS'} 12 | 13 | c = int(input()) 14 | 15 | for i in range(c): 16 | x,y = map(int,input().split()) 17 | print(songs[x+y]) 18 | -------------------------------------------------------------------------------- /CSharp/1805.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | long[] x = Console.ReadLine().Split().Select(long.Parse).ToArray(); 9 | 10 | 11 | long soma = (x[1] * (x[1] + 1)) / 2 - ((x[0] - 1) * x[0]) / 2; 12 | 13 | Console.WriteLine(soma); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CSharp/2453.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main(string[] args) 6 | { 7 | string n = Console.ReadLine(); 8 | n=n.Replace("pp","-"); 9 | n=n.Replace("pP","+"); 10 | n=n.Replace("p",""); 11 | n=n.Replace("-","p"); 12 | n=n.Replace("+","P"); 13 | Console.WriteLine(n); 14 | } 15 | } -------------------------------------------------------------------------------- /Python/1134.py: -------------------------------------------------------------------------------- 1 | al = 0 2 | ga = 0 3 | di = 0 4 | x = 0 5 | while x != 4: 6 | x = int(input()) 7 | if x == 1: 8 | al = al + 1 9 | if x == 2: 10 | ga = ga + 1 11 | if x == 3: 12 | di = di + 1 13 | print('MUITO OBRIGADO') 14 | print('Alcool: {}'.format(al)) 15 | print('Gasolina: {}'.format(ga)) 16 | print('Diesel: {}'.format(di)) 17 | -------------------------------------------------------------------------------- /Python/1933.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | x,y = map(int,input().split()) 3 | return x,y 4 | 5 | def verificacao(a,b): 6 | if a == b: 7 | c = a 8 | elif a > b: 9 | c = a 10 | elif b > a: 11 | c = b 12 | return c 13 | 14 | def main(): 15 | x,y = entrada() 16 | c = verificacao(x,y) 17 | print(c) 18 | 19 | main() 20 | -------------------------------------------------------------------------------- /Python/2187.py: -------------------------------------------------------------------------------- 1 | cont=1 2 | while True: 3 | n = int(input()) 4 | if n == 0: 5 | break 6 | a50 = n // 50 7 | n %= 50 8 | 9 | a10 = n // 10 10 | n %= 10 11 | 12 | a5 = n // 5 13 | n %= 5 14 | 15 | a1 = n 16 | 17 | print(f"Teste {cont}") 18 | print(f"{a50} {a10} {a5} {a1}") 19 | print() 20 | cont += 1 21 | -------------------------------------------------------------------------------- /CSharp/2377.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int[] y = Console.ReadLine().Split().Select(int.Parse).ToArray(); 11 | 12 | Console.WriteLine((x[0]/x[1])*y[1]+x[0]*y[0]); 13 | } 14 | } -------------------------------------------------------------------------------- /Python/1180.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | 3 | a = input() 4 | 5 | a = a.split() 6 | 7 | for i in range(len(a)): 8 | a[i] = int(a[i]) 9 | 10 | menor = a[0] 11 | posicao = 0 12 | for j in range(1,len(a)): 13 | if a[j] < menor: 14 | menor = a[j] 15 | posicao = j 16 | 17 | print('Menor valor: {}'.format(menor)) 18 | print('Posicao: {}'.format(posicao)) 19 | -------------------------------------------------------------------------------- /CSharp/1142.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int aux=1; 9 | 10 | int n = int.Parse(Console.ReadLine()); 11 | for(int i=0; ix-3;j--) 12 | { 13 | Console.WriteLine($"I={i} J={j}"); 14 | } 15 | x+=2; 16 | } 17 | } 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /CSharp/1175.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | int[] x = new int[20]; 8 | 9 | for(int i =0;i<20;i++) 10 | { 11 | x[i] = int.Parse(Console.ReadLine()); 12 | } 13 | Array.Reverse(x); 14 | for(int i=0;i<20;i++) 15 | {Console.WriteLine($"N[{i}] = {x[i]}");} 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CSharp/1930.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int soma=1; 9 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | 11 | foreach(int a in x) 12 | { 13 | soma+= a-1; 14 | } 15 | Console.WriteLine(soma); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /CSharp/3224.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | string a = Console.ReadLine(); 9 | string b = Console.ReadLine(); 10 | 11 | if(a.Length >= b.Length) 12 | {Console.WriteLine("go");} 13 | else{ 14 | Console.WriteLine("no"); 15 | } 16 | } 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /Python/1115.py: -------------------------------------------------------------------------------- 1 | y=x=1 2 | 3 | 4 | while x != 0 and y != 0: 5 | x, y = map(int, input().split()) 6 | if x > 0: 7 | if y > 0: 8 | print('primeiro') 9 | if y < 0: 10 | print('quarto') 11 | if x < 0: 12 | if y > 0: 13 | print('segundo') 14 | if y < 0: 15 | print('terceiro') 16 | 17 | 18 | -------------------------------------------------------------------------------- /Python/1164.py: -------------------------------------------------------------------------------- 1 | n= int(input()) 2 | 3 | for i in range(0,n): 4 | num = int(input()) 5 | j = 1 6 | s = 0 7 | while j < num: 8 | if num % j == 0: 9 | s = s + j 10 | 11 | j = j + 1 12 | 13 | if s == num: 14 | print('{} eh perfeito'.format(num)) 15 | else: 16 | print('{} nao eh perfeito'.format(num)) 17 | -------------------------------------------------------------------------------- /Python/1866.py: -------------------------------------------------------------------------------- 1 | def casos(): 2 | c = int(input()) 3 | return c 4 | 5 | def paridade(n): 6 | if n % 2 == 0: 7 | print(0) 8 | else: 9 | print(1) 10 | 11 | def inp(): 12 | n = int(input()) 13 | return n 14 | 15 | def main(): 16 | c = casos() 17 | for i in range(c): 18 | n = inp() 19 | paridade(n) 20 | 21 | main() 22 | 23 | -------------------------------------------------------------------------------- /CSharp/1017.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) { 7 | 8 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 9 | int x = int.Parse(Console.ReadLine()); 10 | int y = int.Parse(Console.ReadLine()); 11 | 12 | Console.WriteLine($"{x*y/12m:F3}"); 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /CSharp/1060.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class Program { 5 | static void Main() 6 | { 7 | int cont=0; 8 | decimal x; 9 | 10 | for(int i=0;i<6;i++) 11 | { 12 | x = decimal.Parse(Console.ReadLine()); 13 | if(x>0) cont++; 14 | } 15 | Console.WriteLine($"{cont} valores positivos"); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /CSharp/1155.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 9 | decimal s =1; 10 | for (int i =2;i<101;i++) 11 | { 12 | s+=(decimal)1/i; 13 | } 14 | Console.WriteLine($"{s:F2}"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Python/1217.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | kg = 0 3 | custo = 0.0 4 | for i in range(n): 5 | 6 | valor = float(input()) 7 | compra = input().split() 8 | kg += len(compra) 9 | custo += valor 10 | print(f"day {i+1}: {len(compra)} kg") 11 | 12 | 13 | 14 | kg = kg / n 15 | custo = custo / n 16 | 17 | 18 | 19 | print(f"{kg:.2f} kg by day") 20 | print(f"R$ {custo:.2f} by day") 21 | -------------------------------------------------------------------------------- /CSharp/1612.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | decimal tronco; 9 | 10 | for(int i =0;i b: 8 | if a % b == 0: 9 | print('Sao Multiplos') 10 | else: 11 | print('Nao sao Multiplos') 12 | 13 | if a < b: 14 | if b % a == 0: 15 | print('Sao Multiplos') 16 | else: 17 | print('Nao sao Multiplos') 18 | 19 | if a == b: 20 | print('Sao Multiplos') 21 | -------------------------------------------------------------------------------- /Python/2061.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | n, m = map(int,input().split()) 3 | return n,m 4 | 5 | def movimentos(n,m): 6 | for i in range(m): 7 | peri = input() 8 | if peri == 'clicou': 9 | n -= 1 10 | else: 11 | n += 1 12 | return n 13 | 14 | def main(): 15 | n,m = entrada() 16 | n = movimentos(n,m) 17 | print(n) 18 | 19 | main() 20 | -------------------------------------------------------------------------------- /CSharp/1011.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | 5 | class URI { 6 | static void Main(string[] args) { 7 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 8 | 9 | double a = double.Parse(Console.ReadLine()); 10 | 11 | Console.WriteLine($"VOLUME = {(4/3d)*3.14159d*Math.Pow(a,3):F3}"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CSharp/1589.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int x = int.Parse(Console.ReadLine()); 9 | int[] y; 10 | for(int i =0;i 10: 6 | if n - 20 >= 0: 7 | conta += 20 8 | n -= 20 9 | else: 10 | conta += n 11 | 12 | if tudo > 30: 13 | if n - 70 >= 0: 14 | conta += 70 * 2 15 | n -= 70 16 | else: 17 | conta += n * 2 18 | 19 | if tudo > 100: 20 | conta += 5 * n 21 | 22 | print(conta) 23 | -------------------------------------------------------------------------------- /Python/problema-A-papagaio-poliglota.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n= input() 4 | if n == 'esquerda': 5 | print('ingles') 6 | if n == 'direita': 7 | print('frances') 8 | if n == 'nenhuma': 9 | print('portugues') 10 | if n == 'as duas': 11 | print('caiu') 12 | print() 13 | except EOFError: 14 | break 15 | -------------------------------------------------------------------------------- /Python/1038.py: -------------------------------------------------------------------------------- 1 | x = input().split() 2 | a, b = x 3 | if a == '1': 4 | print('Total: R$ {:.2f}'.format(4.00*float(b))) 5 | if a == '2': 6 | print('Total: R$ {:.2f}'.format(4.50*float(b))) 7 | if a == '3': 8 | print('Total: R$ {:.2f}'.format(5.00*float(b))) 9 | if a == '4': 10 | print('Total: R$ {:.2f}'.format(2.00*float(b))) 11 | if a == '5': 12 | print('Total: R$ {:.2f}'.format(1.50*float(b))) 13 | 14 | -------------------------------------------------------------------------------- /Python/problema-B-desafio-de-Rangel.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | M=[] 3 | m = input().split() 4 | for i in range(n -1): 5 | for j in range(i+1,n): 6 | if int(m[i]) 1: 19 | print(f"{paginas} paginas") 20 | else: 21 | print(f"{paginas} pagina") 22 | -------------------------------------------------------------------------------- /CSharp/1020.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | int a = int.Parse(Console.ReadLine()); 8 | int y = a/365; 9 | int m = (a%365)/30; 10 | int d= ((a%365)%30); 11 | Console.WriteLine($"{y} ano(s)"); 12 | Console.WriteLine($"{m} mes(es)"); 13 | Console.WriteLine($"{d} dia(s)"); 14 | 15 | 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CSharp/3303.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | 6 | static void Main(string[] args) 7 | { 8 | 9 | string teste = Console.ReadLine(); 10 | if(teste.Length<10) 11 | { 12 | Console.WriteLine("palavrinha"); 13 | } 14 | 15 | else 16 | { 17 | Console.WriteLine("palavrao"); 18 | } 19 | 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Python/2006.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | n = int(input()) 3 | t = input().split() 4 | for i in range(len(t)): 5 | t[i] = int(t[i]) 6 | return t,n 7 | 8 | 9 | def verificar(t,n): 10 | cont = 0 11 | for i in range(len(t)): 12 | if t[i] == n: 13 | cont += 1 14 | return cont 15 | 16 | def main(): 17 | t,n = entrada() 18 | print(verificar(t,n)) 19 | 20 | main() 21 | -------------------------------------------------------------------------------- /CSharp/1080.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int[] listao = new int[100]; 9 | for (int i = 0;i<100;i++) 10 | { 11 | listao[i] = int.Parse(Console.ReadLine()); 12 | } 13 | Console.WriteLine(listao.Max()); 14 | Console.WriteLine(1+Array.IndexOf(listao,listao.Max())); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /CSharp/1865.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | int x = int.Parse(Console.ReadLine()); 8 | string y; 9 | 10 | for(int i=0;i listao = new HashSet(); 9 | int n = int.Parse(Console.ReadLine()); 10 | 11 | for(int i =0;i=0 && n[0]<=432 && n[1]>=0 && n[1]<=468) 9 | { 10 | Console.WriteLine("dentro"); 11 | } 12 | else 13 | { 14 | Console.WriteLine("fora"); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /CSharp/1153.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | Console.WriteLine(fatorial(int.Parse(Console.ReadLine()))); 8 | } 9 | 10 | public static int fatorial(int x) 11 | { 12 | if(x==1 || x==0) 13 | { 14 | return 1; 15 | } 16 | else 17 | { 18 | return x*(fatorial(x-1)); 19 | 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /CSharp/1708.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | int cont=0; 10 | int segundos=0; 11 | 12 | while(segundos m: 8 | m = int(x[i]) 9 | 10 | if m < 10: 11 | N = 1 12 | elif m >= 10 and m < 20: 13 | N = 2 14 | else: 15 | N =3 16 | print(N) 17 | 18 | except EOFError: 19 | break 20 | 21 | -------------------------------------------------------------------------------- /Python/1793.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n = int(input()) 3 | if n == 0: 4 | break 5 | lista = list(map(int, input().split())) 6 | #cont=0 7 | if len(lista) == 1: 8 | print(10) 9 | else: 10 | t = 10 11 | for i in range(n - 1): 12 | if lista[i + 1] - lista[i] < 10: 13 | t += lista[i + 1] - lista[i] 14 | else: 15 | t += 10 16 | print(t) 17 | -------------------------------------------------------------------------------- /CSharp/1156.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 9 | decimal soma =1; 10 | int x=2; 11 | 12 | for(int i =3;i<40;i+=2) 13 | { 14 | soma+=(decimal)i/x; 15 | x*=2; 16 | } 17 | Console.WriteLine($"{soma:F2}"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSharp/1936.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | int[] lista = new int[] {40320, 5040, 720, 120, 24, 6, 2, 1}; 8 | 9 | int n = int.Parse(Console.ReadLine()); 10 | int cont=0; 11 | 12 | foreach(int i in lista) 13 | { 14 | cont += n/i; 15 | n%=i; 16 | } 17 | Console.WriteLine(cont); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSharp/3299.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | string n = Console.ReadLine(); 10 | if(n.Contains("13")) 11 | { 12 | Console.WriteLine("{0} es de Mala Suerte",n); 13 | } 14 | 15 | else 16 | {Console.WriteLine("{0} NO es de Mala Suerte",n); 17 | } 18 | 19 | 20 | 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Python/1940.py: -------------------------------------------------------------------------------- 1 | n=list(map(int,input().split())) 2 | pontos=list() 3 | for i in range(n[0]): 4 | pontos.append(0) 5 | 6 | 7 | 8 | lista= list(map(int,input().split())) 9 | 10 | for i in range(n[1]): 11 | for j in range(n[0]): 12 | pontos[j]+=lista[j+i*n[0]] 13 | maximo=max(pontos) 14 | 15 | #for i in range(len(pontos)-1,-1): 16 | for i in range(len(pontos)-1,-1,-1): 17 | if pontos[i]==maximo: 18 | print(i+1) 19 | break -------------------------------------------------------------------------------- /CSharp/1144.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | ulong x = ulong.Parse(Console.ReadLine()); 8 | ulong y=0; 9 | ulong z=0; 10 | 11 | for(ulong i = 1; i <= x;i++) 12 | { 13 | y=i*i; 14 | z=i*i*i; 15 | Console.WriteLine($"{i} {y} {z}"); 16 | Console.WriteLine($"{i} {y+1} {z+1}"); 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /Python/1098.py: -------------------------------------------------------------------------------- 1 | i = 0 2 | j = 1 3 | acrescimo = (0.2) 4 | n = 0 5 | while i <= 2: 6 | for c in range(1,4): 7 | if i > 2.19: 8 | print('I={:.0f} J={:.0f}'.format(2,j)) 9 | if i == 1.0 or i == 0.0 or i > 1.8: 10 | print('I={:.0f} J={:.0f}'.format(i,j)) 11 | elif i < 2: 12 | print('I={:.1f} J={:.1f}'.format(i,j)) 13 | j = j + 1 14 | i = i + acrescimo 15 | j = 1 + i 16 | 17 | 18 | -------------------------------------------------------------------------------- /CSharp/1114.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | 6 | static void Main(string[] args) 7 | { 8 | int n; 9 | 10 | while(true) 11 | { 12 | n=int.Parse(Console.ReadLine()); 13 | if(n==2002) 14 | { 15 | Console.WriteLine("Acesso Permitido"); 16 | break; 17 | } 18 | else{Console.WriteLine("Senha Invalida");} 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /CSharp/1172.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | 7 | static void Main(string[] args) 8 | { 9 | int[] vetor = new int[10]; 10 | for (int i =0;i<10;i++) 11 | { 12 | vetor[i]=int.Parse(Console.ReadLine()); 13 | } 14 | vetor=vetor.Select(x=>x<=0 ?1:x).ToArray(); 15 | for(int i=0;i<10;i++) 16 | {Console.WriteLine($"X[{i}] = {vetor[i]}");} 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /CSharp/2381.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main() 7 | { 8 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | string[] lista = new string[x[0]]; 10 | for(int i =0;i= 2015: 14 | print('{} A.C.'.format(abs(2015 - x[i])+1)) 15 | 16 | def main(): 17 | x = entrada() 18 | ano(x) 19 | 20 | main() 21 | -------------------------------------------------------------------------------- /CSharp/1180.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | int n = int.Parse(Console.ReadLine()); 9 | int[] x = Console.ReadLine().Trim().Replace(" "," ").Split().Select(int.Parse).ToArray(); 10 | int min = x.Min(); 11 | int indice = Array.IndexOf(x, min); 12 | 13 | Console.WriteLine($"Menor valor: {min}"); 14 | Console.WriteLine($"Posicao: {indice}"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CSharp/1541.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | while (true) { 9 | decimal[] x = Console.ReadLine().Split().Select(decimal.Parse).ToArray(); 10 | if(x[0]==0) 11 | {break;} 12 | 13 | decimal y =x[0]*x[1]; 14 | 15 | Console.WriteLine($"{(int)Math.Truncate(Math.Sqrt((double)(y/(x[2]/100))))}"); 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /CSharp/2759.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Program 4 | { 5 | public static void Main(string[] args) 6 | { 7 | string x = Console.ReadLine(); 8 | string y = Console.ReadLine(); 9 | string z = Console.ReadLine(); 10 | 11 | Console.WriteLine("A = {0}, B = {1}, C = {2}",x,y,z); 12 | Console.WriteLine("A = {0}, B = {1}, C = {2}",y,z,x); 13 | Console.WriteLine("A = {0}, B = {1}, C = {2}",z,x,y); 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CSharp/2826.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | string a = Console.ReadLine(); 9 | string b = Console.ReadLine(); 10 | 11 | if(string.Compare(a,b)<0) 12 | { 13 | Console.WriteLine(a); 14 | Console.WriteLine(b); 15 | } 16 | else{ 17 | Console.WriteLine(b); 18 | Console.WriteLine(a); 19 | } 20 | 21 | 22 | 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /CSharp/1177.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | int cont=0; 9 | while(cont<1000) 10 | { 11 | for(int i =0; i 0: 16 | if y > 0: 17 | print('Q1') 18 | if y < 0: 19 | print('Q4') 20 | if x < 0: 21 | if y > 0: 22 | print('Q2') 23 | if y < 0: 24 | print('Q3') 25 | 26 | -------------------------------------------------------------------------------- /Python/1185.py: -------------------------------------------------------------------------------- 1 | m=[] 2 | letra = input() 3 | 4 | for i in range(12): 5 | m.append([]) 6 | for j in range(12): 7 | x = float(input()) 8 | m[i].append(x) 9 | c = 12 10 | s = 0 11 | cont = 0 12 | for i in range(11): 13 | c -=1 14 | for j in range(c): 15 | s += m[i][j] 16 | cont += 1 17 | 18 | if letra == 'S': 19 | print('{}'.format(s)) 20 | 21 | if letra == 'M': 22 | med = s / cont 23 | print('{:.1f}'.format(med)) 24 | 25 | -------------------------------------------------------------------------------- /Python/2168.py: -------------------------------------------------------------------------------- 1 | n = int(input()) + 1 2 | 3 | x = list() 4 | 5 | 6 | for i in range(n): 7 | cam = input().split() 8 | for j in range(n): 9 | cam[j] =int(cam[j]) 10 | x.append(cam) 11 | 12 | string ='' 13 | for i in range(n - 1): 14 | for j in range(n - 1): 15 | s = x[i][j] + x[i][j+1] + x[i+1][j] + x[i+1][j+1] 16 | if s >= 2: 17 | string += 'S' 18 | else: 19 | string += 'U' 20 | print(string) 21 | string ='' -------------------------------------------------------------------------------- /CSharp/2435.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] n1 = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | int[] n2 = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | 11 | if((decimal)n1[1]/n1[2]<(decimal)n2[1]/n2[2]) 12 | { 13 | Console.WriteLine(n1[0]); 14 | } 15 | else{Console.WriteLine(n2[0]);} 16 | 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /Python/1099.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | d = 0 3 | 4 | for c in range(1 , n + 1): 5 | x = input().split() 6 | a, b, = x 7 | s=0 8 | a = int(a) 9 | b = int(b) 10 | 11 | if a > b: 12 | for d in range(int(b)+1, int(a)): 13 | if d % 2 != 0: 14 | s = s + d 15 | if a < b: 16 | for d in range(int(a)+1, int(b)): 17 | if d % 2 != 0: 18 | s = s + d 19 | if a == b: 20 | s = 0 21 | print(s) 22 | -------------------------------------------------------------------------------- /Python/1186.py: -------------------------------------------------------------------------------- 1 | m=[] 2 | letra = input() 3 | 4 | for i in range(12): 5 | m.append([]) 6 | for j in range(12): 7 | x = float(input()) 8 | m[i].append(x) 9 | c = 0 10 | s = 0 11 | cont = 0 12 | for i in range(11,0,-1): 13 | c +=1 14 | for j in range(c,12): 15 | s += m[i][j] 16 | cont += 1 17 | 18 | if letra == 'S': 19 | print('{}'.format(s)) 20 | 21 | if letra == 'M': 22 | med = s / cont 23 | print('{:.1f}'.format(med)) 24 | 25 | -------------------------------------------------------------------------------- /CSharp/1113.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | int[] x; 9 | 10 | while(true) 11 | { 12 | x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 13 | 14 | if(x[0]>x[1]) 15 | {Console.WriteLine("Decrescente");} 16 | else if(x[1]>x[0]) 17 | {Console.WriteLine("Crescente");} 18 | else{break;} 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CSharp/2464.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text; 4 | 5 | class URI 6 | { 7 | static void Main(string[] args) 8 | { 9 | StringBuilder print = new StringBuilder(); 10 | char[] n = Console.ReadLine().ToCharArray(); 11 | char[] frase = Console.ReadLine().ToCharArray(); 12 | 13 | foreach (char c in frase) 14 | { 15 | print.Append(n[(int)c-97]); 16 | } 17 | Console.WriteLine(print); 18 | } 19 | } -------------------------------------------------------------------------------- /Python/1553.py: -------------------------------------------------------------------------------- 1 | dic = {} 2 | cont = 0 3 | 4 | while True: 5 | n = list(map(int, input().split())) 6 | if n[0] == 0 and n[1] == 0: 7 | break 8 | listao = list(map(int, input().split())) 9 | 10 | for i in listao: 11 | if i in dic: 12 | dic[i] += 1 13 | else: 14 | dic[i] = 1 15 | 16 | for x in dic.values(): 17 | if x >= n[1]: 18 | cont += 1 19 | 20 | print(cont) 21 | cont = 0 22 | dic.clear() 23 | -------------------------------------------------------------------------------- /CSharp/1006.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | 5 | class URI { 6 | 7 | static void Main(string[] args) { 8 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 9 | float a = float.Parse(Console.ReadLine()); 10 | float b = float.Parse(Console.ReadLine()); 11 | float c = float.Parse(Console.ReadLine()); 12 | 13 | 14 | Console.WriteLine($"MEDIA = {(a*2f+b*3f+c*5)/10f:F1}"); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /CSharp/1573.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] n; 9 | while (true) 10 | { 11 | n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 12 | if(n[0]==0 && n[1]==0 && n[2]==0) 13 | { 14 | break; 15 | } 16 | Console.WriteLine((int)Math.Pow(n[0]*n[1]*n[2],((double)1/3))); 17 | } 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /Python/1196.py: -------------------------------------------------------------------------------- 1 | letras = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./" 2 | 3 | while True: 4 | try: 5 | x = input() 6 | if not x: 7 | break 8 | 9 | frase = list(x) 10 | 11 | for i in range(len(frase)): 12 | indice = letras.find(frase[i]) 13 | 14 | if indice != -1: 15 | frase[i] = letras[indice - 1] 16 | 17 | print(''.join(frase)) 18 | 19 | except EOFError: 20 | break 21 | -------------------------------------------------------------------------------- /CSharp/1609.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int n = int.Parse(Console.ReadLine()); 10 | int[] listao; 11 | for(int i = 0; i < n;i++) 12 | { 13 | Console.ReadLine(); 14 | listao = Console.ReadLine().Split().Select(int.Parse).ToArray(); 15 | Console.WriteLine(listao.Distinct().Count()); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /CSharp/1796.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main() 7 | { 8 | int n = int.Parse(Console.ReadLine()); 9 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int zero = x.Count(a =>a==0); 11 | 12 | if((decimal)zero>(decimal)n/2m) 13 | { 14 | Console.WriteLine("Y"); 15 | } 16 | else{Console.WriteLine("N");} 17 | 18 | 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /CSharp/3038.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | string frase; 9 | while(true) 10 | { 11 | frase = Console.ReadLine(); 12 | if(string.IsNullOrEmpty(frase)) 13 | {break;} 14 | 15 | frase = frase.Replace("@","a").Replace("&","e").Replace("!","i").Replace("*","o").Replace("#","u"); 16 | Console.WriteLine(frase); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Python/1188.py: -------------------------------------------------------------------------------- 1 | m=[] 2 | l = input() 3 | 4 | for i in range(12): 5 | m.append([]) 6 | for j in range(12): 7 | x = float(input()) 8 | m[i].append(x) 9 | 10 | s = 0 11 | inf = 5 12 | sup = 7 13 | cont = 0 14 | for i in range(7,12): 15 | for j in range(inf,sup): 16 | s += m[i][j] 17 | cont += 1 18 | inf -= 1 19 | sup += 1 20 | 21 | med = s / cont 22 | 23 | if l == "S": 24 | print('{:.1f}'.format(s)) 25 | else: 26 | print('{:.1f}'.format(med)) 27 | -------------------------------------------------------------------------------- /Python/2138.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n = input() 4 | if not n: 5 | break 6 | 7 | freq = {} 8 | for char in n: 9 | if char in freq: 10 | freq[char] += 1 11 | else: 12 | freq[char] = 1 13 | 14 | maior = [char for char, cont in freq.items() if cont == max(freq.values())] 15 | maior.sort(reverse=True) 16 | 17 | print(maior[0]) 18 | 19 | except EOFError: 20 | break 21 | -------------------------------------------------------------------------------- /Python/1118.py: -------------------------------------------------------------------------------- 1 | med = 0 2 | x = 1 3 | i=0 4 | while x == 1: 5 | while i < 2: 6 | n = float(input()) 7 | if n < 0.0 or n > 10.0: 8 | print('nota invalida') 9 | if n >= 0.0 and n <=10.0: 10 | med = med + n 11 | i = i + 1 12 | print('media = {:.2f}'.format(med / 2)) 13 | 14 | while True: 15 | x = int(input('novo calculo (1-sim 2-nao)')) 16 | i =0 17 | med = 0 18 | if x == 2 or x == 1: 19 | break 20 | -------------------------------------------------------------------------------- /CSharp/2295.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Globalization; 4 | 5 | 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 11 | decimal[] n= Console.ReadLine().Split().Select(decimal.Parse).ToArray(); 12 | if((decimal)n[0]/n[2]<(decimal)n[1]/n[3]) 13 | { 14 | Console.WriteLine("A"); 15 | } 16 | else{Console.WriteLine("G");} 17 | } 18 | } -------------------------------------------------------------------------------- /CSharp/2670.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class HelloWorld 4 | { 5 | public static void Main(string[] args) 6 | { 7 | int a1 = int.Parse(Console.ReadLine()); 8 | int a2 = int.Parse(Console.ReadLine()); 9 | int a3 = int.Parse(Console.ReadLine()); 10 | 11 | int t1= a2 * 1+ a3*2; 12 | int t2= a1* 1+ a3 * 1; 13 | int t3=a1 * 2 + a2 * 1; 14 | 15 | int tf=Math.Min(t1,Math.Min(t2, t3)); 16 | 17 | Console.WriteLine(tf*2); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Python/1187.py: -------------------------------------------------------------------------------- 1 | m=[] 2 | l = input() 3 | 4 | for i in range(12): 5 | m.append([]) 6 | for j in range(12): 7 | x = float(input()) 8 | m[i].append(x) 9 | 10 | s = 0 11 | inf = 1 12 | sup = 11 13 | cont = 0 14 | for i in range(0,5): 15 | for j in range(inf,sup): 16 | s += m[i][j] 17 | cont += 1 18 | inf += 1 19 | sup -= 1 20 | 21 | med = s / cont 22 | 23 | if l == "S": 24 | print('{:.1f}'.format(s)) 25 | else: 26 | print('{:.1f}'.format(med)) 27 | 28 | -------------------------------------------------------------------------------- /Python/1534.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n = int(input()) 4 | 5 | m=[] 6 | 7 | for i in range(0,n): 8 | m.append([]) 9 | for j in range(0,n): 10 | m[i].append('3') 11 | 12 | c1 = n - 1 13 | 14 | for i in range(0,n): 15 | m[i][i] = '1' 16 | m[i][c1] = '2' 17 | c1 -= 1 18 | M = ''.join(m[i]) 19 | print(M) 20 | except EOFError: 21 | break 22 | 23 | -------------------------------------------------------------------------------- /Python/1618.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | 4 | for _ in range(n): 5 | listao = list(map(int, input().split())) 6 | 7 | x = listao[8] 8 | 9 | y = listao[9] 10 | 11 | if ( 12 | listao[0] <= x and 13 | listao[1] <= y and 14 | listao[2] >= x and 15 | listao[3] <= y and 16 | listao[4] >= x and 17 | listao[5] >= y and 18 | listao[6] <= x and 19 | listao[7] >= y 20 | ): 21 | print(1) 22 | else: 23 | print(0) 24 | -------------------------------------------------------------------------------- /Python/1074.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | x =[''] 3 | for i in range(1,n + 1): 4 | x.append(int(input())) 5 | 6 | for i in range(1,n + 1): 7 | if x[i] == 0: 8 | print('NULL') 9 | 10 | if x[i] > 0: 11 | if x[i] % 2 == 0: 12 | print('EVEN POSITIVE') 13 | else: 14 | print('ODD POSITIVE') 15 | 16 | if x[i] < 0: 17 | if x[i] % 2 == 0: 18 | print('EVEN NEGATIVE') 19 | else: 20 | print('ODD NEGATIVE') 21 | -------------------------------------------------------------------------------- /Python/1181.py: -------------------------------------------------------------------------------- 1 | l = int(input()) 2 | opera = input() 3 | 4 | 5 | m=[] 6 | for i in range(12): 7 | m.append([]) 8 | 9 | for i in range(12): 10 | for j in range(12): 11 | x = float(input()) 12 | m[i].append(x) 13 | 14 | 15 | if opera == 'S': 16 | soma = 0 17 | for k in m[l]: 18 | soma = soma + k 19 | print(soma) 20 | if opera == 'M': 21 | med = 0 22 | soma = 0 23 | for k in m[l]: 24 | soma = soma + k 25 | med= soma/12 26 | print(med) 27 | -------------------------------------------------------------------------------- /CSharp/1010.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | 5 | class URI { 6 | static void Main(string[] args) { 7 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 8 | 9 | decimal[] a = Console.ReadLine().Split().Select(decimal.Parse).ToArray(); 10 | decimal[] b = Console.ReadLine().Split().Select(decimal.Parse).ToArray(); 11 | 12 | 13 | Console.WriteLine($"VALOR A PAGAR: R$ {a[1]*a[2]+b[1]*b[2]:F2}"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CSharp/1151.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int[] fibo =new int[46]; 8 | 9 | fibo[0]=0; 10 | fibo[1]=1; 11 | for(int i =2;i<46;i++) 12 | { 13 | fibo[i]=fibo[i-2]+fibo[i-1]; 14 | } 15 | 16 | int n = int.Parse(Console.ReadLine()); 17 | for(int i = 0;i conjunto = new HashSet(); 9 | string aux=""; 10 | 11 | while(aux != null) 12 | { 13 | aux = Console.ReadLine(); 14 | if(aux==null) 15 | {break;} 16 | conjunto.Add(aux); 17 | } 18 | Console.WriteLine(conjunto.Count); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CSharp/2764.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | string data = Console.ReadLine(); 8 | 9 | DateTime print= DateTime.ParseExact(data,"dd/MM/yy",null); 10 | 11 | string a = print.ToString("MM/dd/yy"); 12 | string b = print.ToString("yy/MM/dd"); 13 | string c = print.ToString("dd-MM-yy"); 14 | 15 | Console.WriteLine(a); 16 | Console.WriteLine(b); 17 | Console.WriteLine(c); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSharp/2926.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | class URI 4 | { 5 | static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | StringBuilder print = new StringBuilder("Ent"); 9 | 10 | print.Append('a', n); 11 | print.Append("o eh N"); 12 | print.Append('a', n); 13 | print.Append("t"); 14 | print.Append('a', n); 15 | print.Append("l!"); 16 | Console.WriteLine(print.ToString()); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSharp/3342.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Program 4 | { 5 | public static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | if(n%2==0) 9 | {Console.WriteLine("{0} casas brancas e {1} casas pretas",Math.Pow(n,2)/2,Math.Pow(n,2)/2);} 10 | 11 | else 12 | { 13 | {Console.WriteLine("{0} casas brancas e {1} casas pretas",Convert.ToInt32(Math.Pow(n,2)/2)+1,Convert.ToInt32(Math.Pow(n,2)/2));} 14 | } 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Python/1228.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n = int(input()) 4 | except EOFError: 5 | break 6 | 7 | inicio = list(map(int, input().split())) 8 | fim = list(map(int, input().split())) 9 | 10 | cont = 0 11 | indice2 = 0 12 | 13 | while inicio != fim: 14 | indice1 = inicio.index(fim[indice2]) 15 | cont += abs(indice2 - indice1) 16 | inicio.insert(indice2, inicio.pop(indice1)) 17 | 18 | indice2 = (indice2 + 1) % n 19 | 20 | 21 | print(cont) 22 | -------------------------------------------------------------------------------- /CSharp/1009.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | class URI { 5 | static void Main(string[] args) { 6 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 7 | Console.ReadLine(); 8 | decimal b = decimal.Parse(Console.ReadLine()); 9 | decimal c = decimal.Parse(Console.ReadLine()); 10 | 11 | decimal total = Math.Round((b + c * 0.15m), 2, MidpointRounding.ToEven); 12 | Console.WriteLine($"TOTAL = R$ {total.ToString("F2")}"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CSharp/1052.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | int numero = int.Parse(Console.ReadLine()); 8 | Console.WriteLine((Meses)numero); 9 | } 10 | 11 | enum Meses 12 | { 13 | January = 1, 14 | February, 15 | March, 16 | April, 17 | May, 18 | June, 19 | July, 20 | August, 21 | September, 22 | October, 23 | November, 24 | December 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Python/1867.py: -------------------------------------------------------------------------------- 1 | while True: 2 | n = input().split() 3 | if n[0] == "0" and n[1] == "0": 4 | break 5 | 6 | for i in range(2): 7 | while len(n[i]) != 1: 8 | algarismos = list(n[i]) 9 | soma = 0 10 | for c in algarismos: 11 | soma += int(c) 12 | n[i] = str(soma) 13 | 14 | a = int(n[0]) 15 | b = int(n[1]) 16 | 17 | if a > b: 18 | print(1) 19 | elif a < b: 20 | print(2) 21 | else: 22 | print(0) 23 | -------------------------------------------------------------------------------- /CSharp/1026.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | while (true) 8 | { 9 | string a = Console.ReadLine(); 10 | if (string.IsNullOrEmpty(a)) 11 | { 12 | break; 13 | } 14 | 15 | string[] inputs = a.Split(); 16 | long x = long.Parse(inputs[0]); 17 | long y = long.Parse(inputs[1]); 18 | Console.WriteLine(x ^ y); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CSharp/1035.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) { 7 | 8 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | int a=x[0]; 10 | int b=x[1]; 11 | int c=x[2]; 12 | int d=x[3]; 13 | 14 | if(b>c &&d>a &&c+d>a+b &&c>=0 &&d>=0 &&a%2==0) 15 | { 16 | Console.WriteLine("Valores aceitos"); 17 | } 18 | else{Console.WriteLine("Valores nao aceitos");} 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /CSharp/1046.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] lista = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | int a=lista[0]; 10 | int b=lista[1]; 11 | 12 | if(ab) 17 | { 18 | a= 24-a+b; 19 | } 20 | else{a=24;} 21 | 22 | Console.WriteLine($"O JOGO DUROU {a} HORA(S)"); 23 | } 24 | } -------------------------------------------------------------------------------- /CSharp/1149.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | int a = x[0]; 10 | int n=0; 11 | int soma=0; 12 | 13 | for(int i =1;i0) 16 | {n =x[i];break;} 17 | } 18 | for(int i=0;i y) 17 | { 18 | c = x; 19 | } 20 | else 21 | { 22 | c = y; 23 | } 24 | 25 | Console.WriteLine(c); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Python/1050.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | 3 | if x == 61: 4 | print('Brasilia') 5 | if x == 71: 6 | print('Salvador') 7 | if x == 11: 8 | print('Sao Paulo') 9 | if x == 21: 10 | print('Rio de Janeiro') 11 | if x == 32: 12 | print('Juiz de Fora') 13 | if x == 19: 14 | print('Campinas') 15 | if x == 27: 16 | print('Vitoria') 17 | if x == 31: 18 | print('Belo Horizonte') 19 | if x != 61 and x != 71 and x != 11 and x != 21 and x != 32 and x != 19 and x != 27 and x != 31: 20 | print('DDD nao cadastrado') 21 | -------------------------------------------------------------------------------- /Python/2310.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | s = [0,0,0,0,0,0] 3 | for i in range(n): 4 | nome = input() 5 | x = map(int,input().split()) 6 | y = map(int,input().split()) 7 | k = 0 8 | for j in x: 9 | s[k] += j 10 | k += 1 11 | k = 3 12 | for j in y: 13 | s[k] += j 14 | k += 1 15 | 16 | 17 | print('Pontos de Saque: {:.2f} %.'.format(100*s[3]/s[0])) 18 | print('Pontos de Bloqueio: {:.2f} %.'.format(100*s[4]/s[1])) 19 | print('Pontos de Ataque: {:.2f} %.'.format(100*s[5]/s[2])) 20 | -------------------------------------------------------------------------------- /CSharp/2174.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | 5 | class URI { 6 | 7 | static void Main(string[] args) 8 | { 9 | int n = int.Parse(Console.ReadLine()); 10 | string a; 11 | HashSet poke = new HashSet(); 12 | 13 | for(int i = 0; i < n;i++) 14 | { 15 | a = Console.ReadLine(); 16 | poke.Add(a); 17 | } 18 | Console.WriteLine($"Falta(m) {151-poke.Count} pomekon(s)."); 19 | 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /CSharp/2815.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | string[] frase = Console.ReadLine().Split(); 8 | int n = frase.Length; 9 | 10 | for(int i =0;i=4 && frase[i][0]==frase[i][2] &&frase[i][1]==frase[i][3]) 13 | { 14 | frase[i] = frase[i].Substring(2,frase[i].Length-2); 15 | } 16 | } 17 | Console.WriteLine(string.Join(" ",frase)); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /Python/1066.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | c = int(input()) 4 | d = int(input()) 5 | e = int(input()) 6 | 7 | par=0 8 | imp=0 9 | po=0 10 | ne=0 11 | 12 | for n in [a,b,c,d,e]: 13 | if n % 2 ==0: 14 | par = par + 1 15 | else: 16 | imp = imp + 1 17 | if n > 0: 18 | po = po + 1 19 | if n < 0: 20 | ne = ne+1 21 | 22 | print('{} valor(es) par(es)'.format(par)) 23 | print('{} valor(es) impar(es)'.format(imp)) 24 | print('{} valor(es) positivo(s)'.format(po)) 25 | print('{} valor(es) negativo(s)'.format(ne)) 26 | -------------------------------------------------------------------------------- /Python/1160.py: -------------------------------------------------------------------------------- 1 | t = int(input()) 2 | 3 | for i in range(0,t): 4 | pa,pb,ga,gb = map(float, input().split()) 5 | pa = int(pa) 6 | pb = int(pb) 7 | ano = 0 8 | while pb>=pa: 9 | pa = int(pa*(1 + ga/100)) 10 | pb = int(pb*(1 + gb/100)) 11 | #print('PA {} e o PB {}'.format(pa,pb)) 12 | ano = ano + 1 13 | if ano >=101: 14 | print('Mais de 1 seculo.') 15 | break 16 | if ano <=100: 17 | ano = int(ano) 18 | print('{} anos.'.format(ano)) 19 | 20 | -------------------------------------------------------------------------------- /Python/1410.py: -------------------------------------------------------------------------------- 1 | impedido = False 2 | while True: 3 | lista = list(map(int, input().split())) 4 | if lista[0] == 0 and lista[1] == 0: 5 | break 6 | 7 | a = sorted(map(int, input().split()), reverse=True) 8 | d = sorted(map(int, input().split()), reverse=True) 9 | for i in a: 10 | if (i < d[-2] and i < d[-1]) or (i < d[-2]): 11 | print("Y") 12 | impedido = True 13 | break 14 | 15 | 16 | if not impedido: 17 | print("N") 18 | 19 | impedido = False 20 | -------------------------------------------------------------------------------- /Python/2003.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | n = input().split(':') 4 | 5 | 6 | if int(n[0]) <= 6 or (int(n[0]) == 7 and int(n[1]) == 0): 7 | print('Atraso maximo: 0') 8 | else: 9 | n[0] = int(n[0]) + 1 10 | n[1] = int(n[1]) 11 | h = n[0] - 8 12 | m = n[1] 13 | if h > 0: 14 | m += 60 * h 15 | print('Atraso maximo: {}'.format(m)) 16 | 17 | 18 | 19 | 20 | 21 | 22 | except EOFError: 23 | break -------------------------------------------------------------------------------- /CSharp/2747.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | for (int i = 0; i < 39; i++) 8 | { 9 | Console.Write("-"); 10 | } 11 | Console.WriteLine(); 12 | 13 | for (int i = 0; i < 5; i++) 14 | { 15 | Console.WriteLine("| |"); 16 | } 17 | 18 | for (int i = 0; i < 39; i++) 19 | { 20 | Console.Write("-"); 21 | } 22 | Console.WriteLine(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Python/1267.py: -------------------------------------------------------------------------------- 1 | while True: 2 | line = input().strip() 3 | if not line: 4 | continue 5 | 6 | n = list(map(int, line.split())) 7 | if n[0] == 0 and n[1] == 0: 8 | break 9 | 10 | alunos = [0] * n[0] 11 | 12 | for _ in range(n[1]): 13 | lista = list(map(int, input().strip().split())) 14 | for j in range(len(lista)): 15 | alunos[j] += lista[j] 16 | 17 | yes = any(i == n[1] for i in alunos) 18 | 19 | if yes: 20 | print("yes") 21 | else: 22 | print("no") 23 | -------------------------------------------------------------------------------- /CSharp/1871.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | string teste=""; 9 | int soma=0; 10 | while(true) 11 | { 12 | int[] n =Console.ReadLine().Split().Select(int.Parse).ToArray(); 13 | if(n[0]==0 && n[1]==0) 14 | {break;} 15 | soma=n[0]+n[1]; 16 | teste = soma.ToString(); 17 | 18 | teste = teste.Replace("0",""); 19 | 20 | Console.WriteLine(teste); 21 | 22 | 23 | 24 | 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CSharp/1980.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Numerics; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | string n; 9 | while(true) 10 | { 11 | n = Console.ReadLine(); 12 | if(n == "0") 13 | {break;} 14 | Console.WriteLine(Fat(n.Length)); 15 | } 16 | } 17 | 18 | static BigInteger Fat(int n) 19 | { 20 | if(n==0 || n==1) 21 | { 22 | return 1; 23 | } 24 | else{return n*Fat(n-1);} 25 | } 26 | } -------------------------------------------------------------------------------- /Python/2059.py: -------------------------------------------------------------------------------- 1 | p, j1, j2, r, a =map(int,input().split()) 2 | 3 | resultado = j1 + j2 4 | 5 | if resultado % 2 == 0: 6 | resultado = 'par' 7 | else: 8 | resultado = 'impar' 9 | 10 | if p == 1: 11 | if resultado == 'par': 12 | win = 1 13 | else: 14 | win = 2 15 | 16 | elif p == 0: 17 | if resultado == 'impar': 18 | win = 1 19 | else: 20 | win = 2 21 | 22 | if a == 1 == r: 23 | win = 2 24 | elif a == 0 and r == 1: 25 | win = 1 26 | 27 | print('Jogador {} ganha!'.format(win)) 28 | -------------------------------------------------------------------------------- /CSharp/1008.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | 5 | class URI { 6 | 7 | static void Main(string[] args) { 8 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 9 | int a = int.Parse(Console.ReadLine()); 10 | int b = int.Parse(Console.ReadLine()); 11 | float c = float.Parse(Console.ReadLine()); 12 | 13 | 14 | 15 | 16 | Console.WriteLine($"NUMBER = {a}"); 17 | Console.WriteLine($"SALARY = U$ {b*c:F2}"); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /Python/1107.py: -------------------------------------------------------------------------------- 1 | while True: 2 | entrada = input().split() 3 | altura = int(entrada[0]) 4 | largura = int(entrada[1]) 5 | 6 | if altura == 0 and largura == 0: 7 | break 8 | 9 | xxxx = input().split() 10 | passadas = 0 11 | comparacao = 0 12 | 13 | for i in range(largura): 14 | xi = int(xxxx[i]) 15 | 16 | if i == 0: 17 | passadas += altura - xi 18 | elif xi < comparacao: 19 | passadas += comparacao - xi 20 | 21 | comparacao = xi 22 | 23 | print(passadas) 24 | -------------------------------------------------------------------------------- /Python/1182.py: -------------------------------------------------------------------------------- 1 | l = int(input()) 2 | opera = input() 3 | 4 | 5 | m=[] 6 | for i in range(12): 7 | m.append([]) 8 | 9 | for i in range(12): 10 | for j in range(12): 11 | x = float(input()) 12 | m[i].append(x) 13 | 14 | 15 | if opera == 'S': 16 | soma = 0 17 | for k in range(12): 18 | soma = soma + m[k][l] 19 | print(soma) 20 | if opera == 'M': 21 | med = 0 22 | soma = 0 23 | for k in range(12): 24 | soma = soma + m[k][l] 25 | med= soma/12 26 | print('{:.1f}'.format(med)) 27 | -------------------------------------------------------------------------------- /Python/1983.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | n = int(input()) 3 | x= list() 4 | for i in range(n): 5 | a = input().split() 6 | x.append(a) 7 | return x 8 | 9 | def melhor(x): 10 | nota = 1 11 | aluno = 0 12 | for i in range(len(x)): 13 | if float(x[i][1]) > float(nota): 14 | nota = x[i][1] 15 | aluno = x[i][0] 16 | if float(nota) <8: 17 | print('Minimum note not reached') 18 | else: 19 | print(aluno) 20 | 21 | def main(): 22 | melhor(entrada()) 23 | 24 | main() 25 | -------------------------------------------------------------------------------- /Python/2486.py: -------------------------------------------------------------------------------- 1 | c={'suco de laranja':120, 2 | 'morango fresco': 85, 3 | 'mamao': 85, 4 | 'goiaba vermelha':70, 5 | 'manga': 56, 6 | 'laranja': 50, 7 | 'brocolis' :34} 8 | 9 | while True: 10 | t=int(input()) 11 | if t == 0: 12 | break 13 | total= 0 14 | for i in range(t): 15 | a,b=input().split(maxsplit=1) 16 | total+= c[b]*int(a) 17 | if total>130: 18 | print(f'Menos {total - 130} mg') 19 | elif total< 110: 20 | print(f'Mais {110-total} mg') 21 | else: 22 | print(f'{total} mg') 23 | -------------------------------------------------------------------------------- /CSharp/1158.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | int n = int.Parse(Console.ReadLine()); 9 | int[] x; 10 | int soma=0; 11 | 12 | for(int i=0; i= lava[0] && n<=lava[1] && n>=seca[0] && n<=seca[1]) 13 | { 14 | Console.WriteLine("possivel"); 15 | } 16 | else{Console.WriteLine("impossivel");} 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /CSharp/2756.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | 8 | Console.WriteLine(" A"); 9 | Console.WriteLine(" B B"); 10 | Console.WriteLine(" C C"); 11 | Console.WriteLine(" D D"); 12 | Console.WriteLine(" E E"); 13 | Console.WriteLine(" D D"); 14 | Console.WriteLine(" C C"); 15 | Console.WriteLine(" B B"); 16 | Console.WriteLine(" A"); 17 | 18 | 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CSharp/2137.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Numerics; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | while(true) 9 | { 10 | string n=Console.ReadLine(); 11 | if(n==null) 12 | {break;} 13 | string[] lista =new string[int.Parse(n)]; 14 | for(int i =0;i 5: 21 | col -= 1 22 | 23 | 24 | 25 | med = s / cont 26 | 27 | if l == "S": 28 | print('{:.1f}'.format(s)) 29 | else: 30 | print('{:.1f}'.format(med)) 31 | -------------------------------------------------------------------------------- /Python/1190.py: -------------------------------------------------------------------------------- 1 | m=[] 2 | l = input() 3 | 4 | for i in range(12): 5 | m.append([]) 6 | for j in range(12): 7 | x = float(input()) 8 | m[i].append(x) 9 | 10 | s = 0 11 | cont = 0 12 | col = 11 13 | for i in range(1,11): 14 | for j in range(col,12): 15 | s += m[i][j] 16 | 17 | cont += 1 18 | if i < 5: 19 | col -= 1 20 | if i > 5: 21 | col += 1 22 | 23 | 24 | 25 | med = s / cont 26 | 27 | if l == "S": 28 | print('{:.1f}'.format(s)) 29 | else: 30 | print('{:.1f}'.format(med)) 31 | -------------------------------------------------------------------------------- /CSharp/2460.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | class URI 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.ReadLine(); 10 | List fila = Console.ReadLine().Split().Select(int.Parse).ToList(); 11 | 12 | Console.ReadLine(); 13 | 14 | HashSet desistentes = new HashSet(Console.ReadLine().Split().Select(int.Parse)); 15 | 16 | fila.RemoveAll(x => desistentes.Contains(x)); 17 | 18 | Console.WriteLine(string.Join(" ", fila)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CSharp/1042.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | 5 | 6 | class Program { 7 | static void Main() 8 | { 9 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int[] y = new int[3]; 11 | 12 | Array.Copy(x, y, 3); 13 | Array.Sort(x); 14 | foreach (var item in x) 15 | { 16 | Console.WriteLine(item); 17 | } 18 | Console.WriteLine(); 19 | foreach (var item in y) 20 | { 21 | Console.WriteLine(item); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CSharp/1072.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int contIn =0; 8 | int contOut =0; 9 | int num; 10 | int n = int.Parse(Console.ReadLine()); 11 | 12 | for(int i=0;i20 || num<10) 16 | {contOut++;} 17 | else{contIn++;} 18 | } 19 | Console.WriteLine($"{contIn} in"); 20 | Console.WriteLine($"{contOut} out"); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /CSharp/1546.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int k; 8 | int n = int.Parse(Console.ReadLine()); 9 | string[] lista = new string[4]{"Rolien","Naej","Elehcim","Odranoel"}; 10 | 11 | for(int i=0;ix[0]) 17 | {print="GAME OVER";break;} 18 | } 19 | Console.WriteLine(print); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CSharp/2322.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | int n = int.Parse(Console.ReadLine()); 9 | int[] lista = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int Sn =((1+n)*n)/2; 11 | int Sn2 =lista.Sum(); 12 | Console.WriteLine(Sn-Sn2); 13 | } 14 | } 15 | 16 | /*outra solução seria por força bruta, 17 | ordenando a array, 18 | varrendo tudo com for 1 a 1, 19 | se encontrou um numero i != da lista, 20 | então break e encontrou o numero que faltava.*/ -------------------------------------------------------------------------------- /Python/1048.py: -------------------------------------------------------------------------------- 1 | x = float(input()) 2 | if x <= 400.00: 3 | s = x * 1.15 4 | r = s - x 5 | p = 15 6 | if 400.01 <= x <= 800.00: 7 | s = x * 1.12 8 | r = s - x 9 | p = 12 10 | if 800.01 <= x <= 1200.00: 11 | s = x * 1.10 12 | r = s - x 13 | p = 10 14 | if 1200.01 <= x <= 2000.00: 15 | s = x * 1.07 16 | r = s - x 17 | p = 7 18 | if x > 2000.00: 19 | s = x * 1.04 20 | r = s - x 21 | p = 4 22 | print('Novo salario: {:.2f}'.format(s)) 23 | print('Reajuste ganho: {:.2f}'.format(r)) 24 | print('Em percentual: {} %'.format(p)) 25 | -------------------------------------------------------------------------------- /CSharp/1715.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int cont=0; 9 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int[] lista = new int[n[1]]; 11 | 12 | for(int i=0;iponto && voto=="S") 16 | { 17 | voto= "N"; 18 | } 19 | } 20 | Console.WriteLine(voto); 21 | 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Python/1051.py: -------------------------------------------------------------------------------- 1 | r = float(input()) 2 | 3 | if r <= 2000.00: 4 | i = 0 5 | print('Isento') 6 | 7 | if 2000.00 < r <= 3000.00: 8 | r8 = r - 2000.00 9 | i = r8 * (8 / 100) 10 | 11 | if 3000.00 < r <= 4500.00: 12 | i8 = (8 / 100) * (1000.00) 13 | r18 = r - 3000.00 14 | i = r18 * (18 / 100) + i8 15 | 16 | if r > 4500.00: 17 | i8 = (8 / 100) * (1000.00) 18 | i18 = (18 / 100) * (1500.00) 19 | r28 = r - 4500.00 20 | i = i18 + i8 + r28 * (28 / 100) 21 | 22 | if r > 2000.00: 23 | i = float(i) 24 | print('R$ {:.2f}'.format(i)) 25 | -------------------------------------------------------------------------------- /CSharp/1038.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Globalization; 4 | 5 | namespace URI 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | CultureInfo.DefaultThreadCurrentCulture =new CultureInfo("en-US"); 12 | decimal[] lista = new decimal[5] { 4m, 4.5m, 5m, 2m, 1.5m }; 13 | int[] pedido = Console.ReadLine().Split().Select(int.Parse).ToArray(); 14 | Console.WriteLine($"Total: R$ {lista[pedido[0] - 1] * pedido[1]:F2}"); 15 | 16 | 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /CSharp/2544.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | int n=0; 8 | int cont=0; 9 | string x=""; 10 | 11 | while(true) 12 | { 13 | x=Console.ReadLine(); 14 | if(x==null) 15 | {break;} 16 | n = int.Parse(x); 17 | 18 | while(Math.Pow(2,cont)!= n) 19 | {cont++;} 20 | 21 | Console.WriteLine(cont); 22 | cont=0; 23 | 24 | } 25 | 26 | 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Python/2028.py: -------------------------------------------------------------------------------- 1 | cont = 0 2 | while True: 3 | try: 4 | cont +=1 5 | string ='0' 6 | n = int(input()) 7 | for i in range(1,n+1): 8 | for j in range(1,i+1): 9 | string += ' '+ str(i) 10 | leng = string.split() 11 | numeros = len(leng) 12 | if numeros == 1: 13 | print('Caso {}: {} numero'.format(cont,numeros)) 14 | else: 15 | print('Caso {}: {} numeros'.format(cont,numeros)) 16 | print(string) 17 | print() 18 | 19 | 20 | except EOFError: 21 | break -------------------------------------------------------------------------------- /CSharp/2057.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main() 7 | { 8 | int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | 10 | int a = x[0]; 11 | int b = x[1]; 12 | int c = x[2]; 13 | 14 | int hora =a+b; 15 | 16 | if(hora>=24) 17 | {hora-=24;} 18 | 19 | hora+=c; 20 | 21 | if(hora>=24) 22 | {hora-=24;} 23 | else if(hora<0) 24 | { 25 | hora= 24+hora; 26 | } 27 | Console.WriteLine(hora); 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CSharp/2356.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | string d; 8 | string s; 9 | while (true) 10 | { 11 | d=Console.ReadLine(); 12 | if(string.IsNullOrEmpty(d)) 13 | {break;} 14 | s=Console.ReadLine(); 15 | if (string.IsNullOrEmpty(s)) 16 | {break;} 17 | 18 | if(d.Contains(s)) 19 | {Console.WriteLine("Resistente");} 20 | else{Console.WriteLine("Nao resistente");} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /CSharp/2444.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | class URI 4 | { 5 | 6 | static void Main(string[] args) 7 | { 8 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | int[] m = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | 11 | foreach(int j in m) 12 | { 13 | n[0]+=j; 14 | if(n[0]>100) 15 | {n[0]=100;} 16 | else if(n[0]<0) 17 | {n[0]=0;} 18 | } 19 | 20 | Console.WriteLine(n[0]); 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Python/2293.py: -------------------------------------------------------------------------------- 1 | maior = 0 2 | 3 | n=list(map(int, input().split())) 4 | normal=[[] for _ in range(n[0])] 5 | transposta=[[] for _ in range(n[1])] 6 | 7 | for i in range(n[0]): 8 | normal[i] = list(map(int, input().split())) 9 | 10 | for i in range(n[1]): 11 | transposta[i] = [0] * n[0] 12 | for j in range(n[0]): 13 | transposta[i][j] = normal[j][i] 14 | for i in range(n[0]): 15 | if sum(normal[i]) > maior: 16 | maior = sum(normal[i]) 17 | for i in range(n[1]): 18 | if sum(transposta[i]) > maior: 19 | maior = sum(transposta[i]) 20 | 21 | print(maior) 22 | -------------------------------------------------------------------------------- /CSharp/1013.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | 5 | class URI { 6 | static void Main(string[] args) { 7 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 8 | 9 | int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int x = a[0]; 11 | int y = a[1]; 12 | int z = a[2]; 13 | 14 | int maior = ((x+y+Math.Abs(x-y))/2); 15 | maior = ((z+maior+Math.Abs(z-maior))/2); 16 | 17 | Console.WriteLine($"{maior} eh o maior"); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CSharp/1043.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Globalization; 4 | 5 | class Program { 6 | static void Main() 7 | { 8 | decimal[] lista = Console.ReadLine().Split().Select(decimal.Parse).ToArray(); 9 | if(lista[0]< lista[1]+ lista[2] && lista[1] lista = new List(); 12 | 13 | while(true) 14 | { 15 | nome = Console.ReadLine(); 16 | if(string.IsNullOrEmpty(nome)) 17 | {break;} 18 | lista.Add(nome); 19 | 20 | } 21 | lista.Sort(StringComparer.OrdinalIgnoreCase); 22 | lista.Reverse(); 23 | 24 | Console.WriteLine(lista[0]); 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /CSharp/2456.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | int[] lista = Console.ReadLine().Split().Select(int.Parse).ToArray(); 9 | 10 | int[] lista2 = lista.ToArray(); 11 | Array.Sort(lista2); 12 | 13 | if (lista.SequenceEqual(lista2)) 14 | { 15 | Console.WriteLine("C"); 16 | } 17 | else if (lista.SequenceEqual(lista2.Reverse())) 18 | { 19 | Console.WriteLine("D"); 20 | } 21 | else 22 | {Console.WriteLine("N");} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CSharp/2721.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class HelloWorld 4 | { 5 | public static void Main(string[] args) 6 | { 7 | string[] lista = Console.ReadLine().Split(); 8 | int soma = 0; 9 | string[] bois = {"Dasher", "Dancer", "Prancer", "Vixen", "Comet", "Cupid", "Donner", "Blitzen"}; 10 | foreach(string i in lista) 11 | { 12 | soma+= int.Parse(i); 13 | } 14 | 15 | if(soma%9==0) 16 | {Console.WriteLine("Rudolph");} 17 | else 18 | { 19 | Console.WriteLine(bois[soma%9-1]); 20 | 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CSharp/1759.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | int n = int.Parse(Console.ReadLine()); 9 | 10 | StringBuilder sb = new StringBuilder(); 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | sb.Append("Ho"); 15 | 16 | if (i == n - 1) 17 | { 18 | sb.Append("!"); 19 | } 20 | else 21 | { 22 | sb.Append(" "); 23 | } 24 | } 25 | 26 | Console.WriteLine(sb.ToString()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CSharp/1866.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int soma=0; 8 | 9 | int x = int.Parse(Console.ReadLine()); 10 | int y; 11 | 12 | for(int i =0;i nome[0]).ThenBy(nome => Array.IndexOf(nomes, nome)); 18 | 19 | foreach (string nome in listao) 20 | { 21 | Console.WriteLine(nome); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Python/1929.py: -------------------------------------------------------------------------------- 1 | def verifica(a,b,c): 2 | if abs(b - c) < a < (b + c): 3 | if abs(a - c) < b < (a + c): 4 | if abs(a - b) < c < (a + b): 5 | return True 6 | else: 7 | return False 8 | 9 | 10 | def entrada(): 11 | a, b, c, d = map(int,input().split()) 12 | return a, b, c, d 13 | 14 | 15 | def forma_ou_nao(a,b,c,d): 16 | if verifica(a,b,c) or verifica(a,b,d) or verifica(a,c,d) or verifica(b,c,d): 17 | print('S') 18 | else: 19 | print('N') 20 | 21 | 22 | def main(): 23 | a, b, c, d = entrada() 24 | forma_ou_nao(a,b,c,d) 25 | 26 | main() 27 | -------------------------------------------------------------------------------- /Python/2140.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | n,m = map(int,input().split()) 3 | troco = m - n 4 | return troco,m,n 5 | 6 | 7 | def verificacao(troco): 8 | notas = [2,5,10,20,50,100] 9 | resultado = False 10 | for i in notas: 11 | for j in notas: 12 | if troco == i + j: 13 | resultado = True 14 | return resultado 15 | 16 | 17 | def main(): 18 | while True: 19 | troco,m,n = entrada() 20 | if m==0==n: 21 | break 22 | resultado = verificacao(troco) 23 | print('possible' if resultado == True else 'impossible') 24 | 25 | 26 | main() 27 | -------------------------------------------------------------------------------- /CSharp/1987.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI 5 | { 6 | static void Main(string[] args) 7 | { 8 | string x; 9 | char[] n; 10 | int soma=0; 11 | while(true) 12 | { 13 | x= Console.ReadLine(); 14 | if(string.IsNullOrEmpty(x)) 15 | {break;} 16 | 17 | n =x.Split()[1].ToCharArray(); 18 | soma=n.Select(ch=>int.Parse(ch.ToString())).Sum(); 19 | if(soma%3==0) 20 | {Console.WriteLine($"{soma} sim");} 21 | else{Console.WriteLine($"{soma} nao");} 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CSharp/2752.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | Console.WriteLine(""); 8 | Console.WriteLine("< AMO FAZER EXERCICIO NO URI>"); 9 | Console.WriteLine(""); 10 | Console.WriteLine(""); 11 | Console.WriteLine(""); 12 | Console.WriteLine(""); 13 | Console.WriteLine("< AMO FAZER EXERCICIO >"); 14 | Console.WriteLine(""); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CSharp/2782.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI { 4 | 5 | static void Main(string[] args) 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | string[] lista = Console.ReadLine().Split(); 9 | int cont = 1; 10 | 11 | int[] num = new int[n-1]; 12 | 13 | for(int i = 0; i b and a > c: 9 | d = a 10 | if b > c: 11 | e = b 12 | f = c 13 | else: 14 | e = c 15 | f = b 16 | if b > a and b > c: 17 | d = b 18 | if a > c: 19 | e = a 20 | f = c 21 | else: 22 | e = c 23 | f = a 24 | if c > a and c > b: 25 | d = c 26 | if a > b: 27 | e = a 28 | f = b 29 | else: 30 | f = a 31 | e = b 32 | print(f) 33 | print(e) 34 | print(d) 35 | print() 36 | print(a) 37 | print(b) 38 | print(c) 39 | -------------------------------------------------------------------------------- /Python/1555.py: -------------------------------------------------------------------------------- 1 | def rafael(x,y): 2 | z=(3*x)**2+y**2 3 | return z 4 | 5 | def beto(x,y): 6 | z=2*(x)**2+(5*y)**2 7 | return z 8 | 9 | def carlos(x,y): 10 | z=-100*x+y**3 11 | return z 12 | 13 | for i in range(int(input())): 14 | x,y=list(map(int,input().split())) 15 | aux=0 16 | nome='' 17 | if rafael(x,y) >aux: 18 | aux= rafael(x,y) 19 | nome='Rafael ganhou' 20 | 21 | if beto(x,y)> aux: 22 | aux=beto(x,y) 23 | nome='Beto ganhou' 24 | 25 | if carlos(x,y)>aux: 26 | aux=carlos(x,y) 27 | nome='Carlos ganhou' 28 | 29 | print(nome) 30 | -------------------------------------------------------------------------------- /Python/1953.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | teste = input() 4 | if not teste: 5 | break 6 | 7 | n =int(teste) 8 | EHD=0 9 | EPR=0 10 | intruso=0 11 | 12 | for i in range(n): 13 | input_str=input().split()[1] 14 | if input_str=="EHD": 15 | EHD+=1 16 | elif input_str == "EPR": 17 | EPR+=1 18 | else: 19 | intruso+=1 20 | 21 | print(f"EPR: {EPR}") 22 | print(f"EHD: {EHD}") 23 | print(f"INTRUSOS: {intruso}") 24 | except EOFError: 25 | break 26 | -------------------------------------------------------------------------------- /CSharp/1116.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Globalization; 4 | 5 | 6 | class URI { 7 | 8 | static void Main(string[] args) 9 | { 10 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 11 | int[] x; 12 | int n = int.Parse(Console.ReadLine()); 13 | for(int i =0; i= 7.0: 6 | print('Aluno aprovado.') 7 | if m < 5.0: 8 | print('Aluno reprovado.') 9 | if 5.0 <= m <= 6.9: 10 | print('Aluno em exame.') 11 | y = float(input()) 12 | print('Nota do exame: {}'.format(y)) 13 | m2 = (y + m) / 2 14 | if m2 >=5: 15 | print('Aluno aprovado.') 16 | print('Media final: {:.1f}'.format(m2)) 17 | else: 18 | print('Aluno reprovado.') 19 | print('Media final: {:.1f}'.format(m2)) 20 | 21 | -------------------------------------------------------------------------------- /CSharp/2754.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | 8 | Console.WriteLine("234.345000 - 45.698000"); 9 | Console.WriteLine("234 - 46"); 10 | Console.WriteLine("234.3 - 45.7"); 11 | Console.WriteLine("234.34 - 45.70"); 12 | Console.WriteLine("234.345 - 45.698"); 13 | Console.WriteLine("2.343450e+02 - 4.569800e+01"); 14 | Console.WriteLine("2.343450E+02 - 4.569800E+01"); 15 | Console.WriteLine("234.345 - 45.698"); 16 | Console.WriteLine("234.345 - 45.698"); 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CSharp/1101.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int[] x; 9 | int soma=0; 10 | while(true) 11 | { 12 | x = Console.ReadLine().Split().Select(int.Parse).ToArray(); 13 | if(Array.Exists(x,a=>a<=0)) 14 | {break;} 15 | 16 | Array.Sort(x); 17 | 18 | for(int i =x[0];i<=x[1];i++) 19 | { 20 | Console.Write($"{i} "); 21 | soma+=i; 22 | } 23 | Console.WriteLine($"Sum={soma}"); 24 | soma=0; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /CSharp/2395.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int print=0; 9 | int[] conteiner = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | int[] navio = Console.ReadLine().Split().Select(int.Parse).ToArray(); 11 | 12 | if(conteiner[0]>navio[0] || conteiner[1]>navio[1] || conteiner[2]>navio[2]) 13 | {print=0;} 14 | else 15 | { 16 | print = (navio[0]/conteiner[0])*(navio[1]/conteiner[1])*(navio[2]/conteiner[2]); 17 | } 18 | Console.WriteLine(print); 19 | 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Python/1961.py: -------------------------------------------------------------------------------- 1 | def entrada(): 2 | p,n = map(int,input().split()) 3 | x = input().split() 4 | for i in range(len(x)): 5 | x[i] = int(x[i]) 6 | 7 | 8 | return p,n,x 9 | 10 | 11 | def verifica(a,b,p): 12 | if abs(a-b) > p: 13 | return True 14 | else: 15 | return False 16 | 17 | 18 | def main(): 19 | p,n,x = entrada() 20 | a = False 21 | for i in range(n-1): 22 | a = verifica(x[i],x[i+1],p) 23 | if a == True: 24 | print('GAME OVER') 25 | break 26 | if a == False: 27 | print('YOU WIN') 28 | 29 | 30 | 31 | 32 | 33 | main() 34 | 35 | -------------------------------------------------------------------------------- /CSharp/2378.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | class URI { 5 | 6 | static void Main(string[] args) 7 | { 8 | int acumulado=0; 9 | int[] movimento; 10 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 11 | string print ="N"; 12 | 13 | for(int i =0;in[1]) 19 | {print="S";} 20 | 21 | } 22 | Console.WriteLine(print); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /CSharp/3214.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | string[] n = Console.ReadLine().Split(); 10 | int e = int.Parse(n[0]); 11 | int f = int.Parse(n[1]); 12 | int c = int.Parse(n[2]); 13 | int g =0; 14 | int cont= 0; 15 | e=e+f; 16 | 17 | while((e)/c!=0) 18 | { 19 | g= (e)/c; 20 | //Console.WriteLine(e/c); 21 | e = e%c +g; 22 | cont+=g; 23 | g=g%c; 24 | } 25 | Console.WriteLine(cont); 26 | 27 | 28 | 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /CSharp/1150.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | int x = int.Parse(Console.ReadLine()); 8 | int z = x - 1; 9 | 10 | int i = 2; 11 | int soma = x; 12 | int s = 1; 13 | 14 | while (z <= x) 15 | { 16 | z = int.Parse(Console.ReadLine()); 17 | } 18 | 19 | while (soma <= z) 20 | { 21 | soma+= + x + s; 22 | 23 | if (soma <= z) 24 | { 25 | i = i + 1; 26 | s = s + 1; 27 | } 28 | } 29 | 30 | Console.WriteLine(i); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Python/1018.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | print(n) 3 | n100 = n // 100 4 | n = n - n100*100 5 | 6 | n50 = n // 50 7 | n = n - n50*50 8 | 9 | n20 = n // 20 10 | n = n - n20*20 11 | 12 | n10 = n // 10 13 | n = n - n10*10 14 | 15 | n5 = n // 5 16 | n = n - n5*5 17 | 18 | n2 = n // 2 19 | n = n - n2*2 20 | 21 | n1 = n // 1 22 | n = n - n1*1 23 | print('{} nota(s) de R$ 100,00'.format(n100)) 24 | print('{} nota(s) de R$ 50,00'.format(n50)) 25 | print('{} nota(s) de R$ 20,00'.format(n20)) 26 | print('{} nota(s) de R$ 10,00'.format(n10)) 27 | print('{} nota(s) de R$ 5,00'.format(n5)) 28 | print('{} nota(s) de R$ 2,00'.format(n2)) 29 | print('{} nota(s) de R$ 1,00'.format(n1)) 30 | -------------------------------------------------------------------------------- /Python/1101.py: -------------------------------------------------------------------------------- 1 | m=n=1 2 | 3 | while m > 0 and n > 0: 4 | t=[] 5 | x = input().split() 6 | m,n = x 7 | m = int(m) 8 | n = int(n) 9 | if m < n and m > 0 and n > 0: 10 | for i in range(m,n + 1): 11 | t.append(i) 12 | s = sum(t) 13 | a = ' '.join(map(str,t)) 14 | print('{} Sum={}'.format(a,s)) 15 | 16 | if m > n and m > 0 and n > 0: 17 | for i in range(n,m + 1): 18 | t.append(i) 19 | s = sum(t) 20 | a = ' '.join(map(str,t)) 21 | print('{} Sum={}'.format(a,s)) 22 | 23 | if m == n and m > 0 and n > 0: 24 | print('{} Sum={}'.format(m,m)) 25 | -------------------------------------------------------------------------------- /CSharp/1159.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | int n; 8 | int soma=0; 9 | int cont=0; 10 | 11 | while(true) 12 | { 13 | n= int.Parse(Console.ReadLine()); 14 | if(n==0) 15 | {break;} 16 | 17 | while(cont!=5) 18 | { 19 | if(n%2==0) 20 | { 21 | cont++; 22 | soma+=n; 23 | } 24 | n++; 25 | } 26 | Console.WriteLine(soma); 27 | soma=0; 28 | cont=0; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CSharp/2344.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class URI 4 | { 5 | static void Main() 6 | { 7 | int n = int.Parse(Console.ReadLine()); 8 | 9 | if (n == 0) 10 | { 11 | Console.WriteLine("E"); 12 | } 13 | else if (n >= 1 && n <= 35) 14 | { 15 | Console.WriteLine("D"); 16 | } 17 | else if (n >= 36 && n <= 60) 18 | { 19 | Console.WriteLine("C"); 20 | } 21 | else if (n >= 61 && n <= 85) 22 | { 23 | Console.WriteLine("B"); 24 | } 25 | else 26 | { 27 | Console.WriteLine("A"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CSharp/2242.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | string a = Console.ReadLine(); 8 | string b = ""; 9 | string breverse=""; 10 | 11 | for (int i = 0; i < a.Length; i++) 12 | { 13 | if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u') 14 | { 15 | b += a[i]; 16 | breverse=a[i]+breverse; 17 | } 18 | } 19 | if(b==breverse) 20 | { 21 | Console.WriteLine("S"); 22 | } 23 | else 24 | { 25 | Console.WriteLine("N"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CSharp/2783.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | public class Program 5 | { 6 | public static void Main(string[] args) 7 | { 8 | string[] x = Console.ReadLine().Split(); 9 | int n = int.Parse(x[0]); 10 | int c = int.Parse(x[1]); 11 | int m = int.Parse(x[2]); 12 | int cont = c; 13 | 14 | string[] y =Console.ReadLine().Split(); 15 | 16 | string[] z =Console.ReadLine().Split(); 17 | 18 | for(int i = 0; i b) 11 | { 12 | int aux = a; 13 | a = b; 14 | b = aux; 15 | } 16 | 17 | if(Math.Abs(b-a)-2<0) 18 | {Console.WriteLine(0);} 19 | else 20 | { 21 | 22 | for(int i=a+1;i10) 16 | {a=a.Substring(0, 10);} 17 | if (b.Length>10) 18 | {b=b.Substring(0, 10);} 19 | if (c.Length>10) 20 | {c=c.Substring(0, 10);} 21 | 22 | Console.WriteLine(a+b+c); 23 | 24 | 25 | 26 | 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /CSharp/1800.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | class URI { 6 | 7 | static void Main(string[] args) 8 | { 9 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | List dois = Console.ReadLine().Split().Select(int.Parse).ToList(); 11 | int x; 12 | for(int i=0;i idades = new List(); 10 | int idade; 11 | 12 | while (true) 13 | { 14 | idade=int.Parse(Console.ReadLine()); 15 | if(idade>=0) 16 | { 17 | idades.Add(idade); 18 | } 19 | else{break;} 20 | } 21 | if(idades.Count>0) 22 | {Console.WriteLine($"{idades.Average():F2}");} 23 | else{Console.WriteLine(0);} 24 | } 25 | } 26 | 27 | 28 | //pode ser necessário ajustar a cultura para printar corretamente em sua máquina -------------------------------------------------------------------------------- /CSharp/2170.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class HelloWorld 4 | { 5 | public static void Main(string[] args) 6 | { 7 | int cont=1; 8 | while(true) 9 | { 10 | string a = Console.ReadLine(); 11 | if(a==null) 12 | {break;} 13 | 14 | string[] n= a.Split(); 15 | 16 | decimal x = decimal.Parse(n[0]); 17 | decimal y = decimal.Parse(n[1]); 18 | 19 | decimal total = (y-x)/x; 20 | 21 | Console.WriteLine($"Projeto {cont}:"); 22 | Console.WriteLine($"Percentual dos juros da aplicacao: {total*100:F2} %"); 23 | Console.WriteLine(""); 24 | cont++; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CSharp/1940.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray(); 10 | 11 | List pontos = new List(); 12 | for(int i=0;i g2: 24 | print('Dabriel') 25 | elif g1 < g2: 26 | print('Guarte') 27 | elif g1 == g2: 28 | print('Empate') 29 | 30 | main() -------------------------------------------------------------------------------- /CSharp/1593.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Numerics; 4 | using System.Linq; 5 | 6 | 7 | class Program { 8 | static void Main() { 9 | BigInteger numero; 10 | string print; 11 | 12 | int n = int.Parse(Console.ReadLine()); 13 | for(int i = 0; i < n;i++) 14 | { 15 | StringBuilder binario = new StringBuilder(); 16 | numero=BigInteger.Parse(Console.ReadLine()); 17 | 18 | while (numero > 0) { 19 | binario.Insert(0, numero % 2); 20 | numero = numero / 2; 21 | } 22 | print=binario.ToString(); 23 | Console.WriteLine(print.Count(x=>x=='1')); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /CSharp/1768.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | string a; 8 | int n; 9 | 10 | while ((a = Console.ReadLine()) != null) 11 | { 12 | n = int.Parse(a); 13 | 14 | for (int i = n / 2, j = 1; i >= 0; --i, j += 2) 15 | { 16 | string x = new string(' ', i) + new string('*', j); 17 | Console.WriteLine(x); 18 | } 19 | 20 | string pe = new string(' ', n / 2) + "*"; 21 | Console.WriteLine(pe); 22 | 23 | string pe2 = new string(' ', n / 2 - 1) + "***"; 24 | Console.WriteLine(pe2 + "\n"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CSharp/1893.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | int[] lua = Console.ReadLine().Split().Select(int.Parse).ToArray(); 8 | int a = lua[0]; 9 | int b = lua[1]; 10 | 11 | if(b>=0 && b<=2) 12 | { 13 | Console.WriteLine("nova"); 14 | } 15 | else if(b>=3 && b<=96 & b>a) 16 | { 17 | Console.WriteLine("crescente"); 18 | } 19 | else if(b>=97 && b<=100) 20 | { 21 | Console.WriteLine("cheia"); 22 | } 23 | else if(b>=3 && b<=96 & b