• + 0 comments

    My Python code that passed all the test cases:

    def solve(S):  # S = initial strength
        mod_n = 10**9 + 7
        if S%20 != 0:
            return ((S//20)*42 + (S%20)*2) % mod_n  
        else:
            return ((S//20)*42 - 2) % mod_n