Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
361 B
3
Indexable
Never
n = int(input())
m = int(input())
s = int(input())
if n * m < s:
    print(0)
if (n % s == 0) or (m % s == 0):
    print(n * m // s)
else:
    a = max(m, n)
    k = 1
    for i in range(a, 1, -1):
        if s % i == 0:
            k = i
    if k == 1:
        print(0)
        print(k)
    else:
        print((a//k) * (min(n, m) // (s // k)))