Project Euler #99: Largest exponential

  • + 0 comments

    Python

    from math import log
    v = []
    for _ in range(int(input())):
        a, b = map(int, input().split())
        v.append((b*log(a), a,b))
    k = int(input())
    x, a, b = sorted(v)[k-1]
    print (a, b)