95322024-02-22 19:11:3442thebestestA sárkány feladványa (50)python3Accepted 50/5019ms13848 KiB
from operator import le
from sys import stdin
from math import lcm

def szamjegyek(szam):
    szamolo = 0
    while szam != 0:
        szamolo += 1
        szam //= 10
    return szamolo
for _ in range(3):
    e, k, sz = [int(x) for x in stdin.readline().split()]
    legkisebb = lcm(e, k)
    mini = szamjegyek(legkisebb)
    if mini > sz:
        print(-1)
        continue
    else:
        for x in range(sz-mini):
            legkisebb*=10 
        print(legkisebb)
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/018ms11572 KiB
2Accepted0/017ms11516 KiB
3Accepted3/317ms11780 KiB
4Accepted3/318ms12088 KiB
5Accepted3/318ms12300 KiB
6Accepted3/318ms12444 KiB
7Accepted3/318ms12544 KiB
8Accepted3/318ms12732 KiB
9Accepted3/317ms13052 KiB
10Accepted3/317ms13148 KiB
11Accepted3/317ms13384 KiB
12Accepted3/319ms13336 KiB
13Accepted4/418ms13424 KiB
14Accepted4/418ms13728 KiB
15Accepted4/418ms13848 KiB
16Accepted4/418ms13412 KiB
17Accepted4/418ms13520 KiB