示例#1
0
def main(argv):
    lines = files.read_ints(argv[0])
    T = lines[0]

    for i in range(T):
        N = lines[i + 1]
        print(sieve(count(N)))
def main(argv):
    lines = files.read_ints(argv[0])
    T     = lines[0]

    for i in range(T):
        N = lines[i + 1]
        print(sieve(count(N)))
示例#3
0
def main(argv):
    lines = files.read_ints(argv[0])
    T = lines[0]

    for i in range(T):
        n = lines[(3 * i) + 1]
        a = lines[(3 * i) + 2]
        b = lines[(3 * i) + 3]
        print(' '.join(str(val) for val in sorted(last_stones(n, a, b))))
示例#4
0
def main(argv):
    lines = files.read_ints(argv[0])
    T     = lines[0]
    F     = fibonacci(10 ** 10)

    for N in lines[1:]:
        if N in F:
            print('IsFibo')
        else:
            print('IsNotFibo')
示例#5
0
def main(argv):
    lines = files.read_ints(argv[0])
    T = lines[0]
    F = fibonacci(10**10)

    for N in lines[1:]:
        if N in F:
            print('IsFibo')
        else:
            print('IsNotFibo')
def main(argv):
    lines   = files.read_ints(argv[0])
    p       = lines[0]
    q       = lines[1]

    numbers = kaprekar_numbers(p, q)

    if numbers:
        print(' '.join(str(n) for n in numbers))
    else:
        print('INVALID RANGE')
示例#7
0
def main(argv):
    lines   = files.read_ints(argv[0])
    p       = lines[0]
    q       = lines[1]

    numbers = kaprekar_numbers(p, q)

    if numbers:
        print(' '.join(str(n) for n in numbers))
    else:
        print('INVALID RANGE')
示例#8
0
def main(argv):
    L, R = files.read_ints(argv[0])

    print(max_xor(L, R))
def main(argv):
    lines = files.read_ints(argv[0])

    for line in lines[1:]:
        print(decent_number(line))
示例#10
0
def main(argv):
    values = files.read_ints(argv[0])

    for value in values[1:]:
        print(grow(value))
示例#11
0
def main(argv):
    ints = files.read_ints(argv[0])
    T    = ints[0]

    for P in ints[1:]:
        print(minimum_draws(P))
示例#12
0
def main(argv):
    lines = files.read_ints(argv[0])
    T     = lines[0]

    for N in lines[1:]:
        print(count_digit_dividers(N))
示例#13
0
def main(argv):
    values = files.read_ints(argv[0])

    for value in values[1:]:
        print(grow(value))
示例#14
0
def main(argv):
    lines = files.read_ints(argv[0])
    a = lines[0]
    b = lines[1]

    print(solve_me_first(a, b))
示例#15
0
def main(argv):
    lines = files.read_ints(argv[0])
    T     = lines[0]

    for N in lines[1:]:
        print(count_digit_dividers(N))
示例#16
0
def main(argv):
    lines = files.read_ints(argv[0])
    T     = lines[0]

    for K in lines[1:]:
        print(optimal_slices(K))
def main(argv):
    H, M = files.read_ints(argv[0])

    print(time_in_words(H, M))
示例#18
0
def main(argv):
    lines = files.read_ints(argv[0])
    N     = lines[0]
    K     = lines[1]

    print(minimum_unfairness(lines[2:], K))
def main(argv):
    lines = files.read_ints(argv[0])
    N     = lines[0]
    A     = lines[1:]

    print(lis(N, A))
示例#20
0
def main(argv):
    ints = files.read_ints(argv[0])
    T = ints[0]

    for P in ints[1:]:
        print(minimum_draws(P))
示例#21
0
def main(argv):
    H, M = files.read_ints(argv[0])

    print(time_in_words(H, M))
示例#22
0
def main(argv):
    L, R = files.read_ints(argv[0])

    print(max_xor(L, R))
示例#23
0
def main(argv):
    lines = files.read_ints(argv[0])
    N = lines[0]
    R = lines[1:]

    print(candies(N, R))
def main(argv):
    lines = files.read_ints(argv[0])
    N = lines[0]
    A = lines[1:]

    print(lis(N, A))
示例#25
0
def main(argv):
    lines = files.read_ints(argv[0])
    N = lines[0]
    K = lines[1]

    print(minimum_unfairness(lines[2:], K))
示例#26
0
def main(argv):
    lines = files.read_ints(argv[0])
    index = lines[0]
    k     = lines[1]

    print genetics.number_to_pattern(index, k)
示例#27
0
def main(argv):
    lines = files.read_ints(argv[0])
    T = lines[0]

    for K in lines[1:]:
        print(optimal_slices(K))
def main(argv):
    lines = files.read_ints(argv[0])

    for line in lines[1:]:
        print(decent_number(line))
示例#29
0
def main(argv):
    lines = files.read_ints(argv[0])
    N     = lines[0]
    R     = lines[1:]

    print(candies(N, R))
示例#30
0
def main(argv):
    lines = files.read_ints(argv[0])
    a     = lines[0]
    b     = lines[1]

    print(solve_me_first(a, b))