• + 1 comment

    Python 3 Solution :

    def solve(s):
        n = 21*s//10 - 1
        for i in range(5):
            if n % 2 == 0 and n//2-n//42 == s:
                return n % (1000*1000*1000+7)
            n += 1
    
    
    for _ in range(int(input())):
        print(solve(int(input())))