Skip to content

Instantly share code, notes, and snippets.

@aseevlx
Last active September 21, 2015 19:37
Show Gist options
  • Save aseevlx/6d948e1fe3777d4468d3 to your computer and use it in GitHub Desktop.
Save aseevlx/6d948e1fe3777d4468d3 to your computer and use it in GitHub Desktop.
Seminar 3
F
n = int(input())
m = int(input())
k = int(input())
if (k > (n * m)):
print("NO")
if (k % n == 0) or (k % m == 0):
print("YES")
else:
print("NO")
G
a = int(input())
b = int(input())
if a == 0 and b == 0:
print("INF")
else:
if a == 0 and b != 0:
print("NO")
elif -b % a != 0:
print("NO")
else:
x = int(-b/a)
print(x)
H
n = int(input())
strn = str(n)
ok = ""
if int(strn[-1]) == 1 and n != 11:
ok = "a"
if n != 12 and n != 13 and n != 14:
if int(strn[-1]) == 2 or int(strn[-1]) == 3 or int(strn[-1]) == 4:
ok = "y"
print("%i korov%s" % (n, ok))
I
a = int(input())
b = int(input())
c = int(input())
d = int(input())
for x in range(1001):
if (a*(x**3) + b*(x**2) + c*x + d == 0):
print(x)
J
A = range(100, 1000)
for i in A:
if str(i**2)[-3:] == str(i):
print(i)
K
n = int(input())
a = ""
for i in range(1,n+1):
a = str(a) + str(i)
print(a)
L
a = int(input())
c = int(input())
b = int(input())
if a == min(a, b, c):
if c == max(a, b, c):
print(a, b, c)
else:
(a, b, c) = (a, c, b)
print(a, b, c)
elif b == min(a, b, c):
(a, b, c) = (b, a, c)
if c == max(a, b, c):
print(a, b, c)
else:
(a, b, c) = (a, c, b)
print(a, b, c)
elif c == min(a, b, c):
(a, b, c) = (c, b, a)
if c == max(a, b, c):
print(a, b, c)
else:
(a, b, c) = (a, c, b)
print(a, b, c)
M
n = int(input())
A = [1, 15]
B = [10, 125]
C = [60, 440]
a = 0
b = 0
c = 0
c = n / 60
if n % 60 >= 35:
c = c + 1
else:
n = int(n) % 60
b = int(n) / 10
if int(n) % 10 == 9:
b = int(b) + 1
else:
a = int(n) % 10
print(int(a), int(b), int(c))
N
n = int(input())
sm = (n*(n+1))/2
i = n-1
while i > 0:
a = int(input())
sm = sm - a
i = i-1
print(int(sm))
O
n = int(input())
a = 1
s = 0
for i in range(1, n+1):
a = (i * a)
s = s + a
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment