87322024-01-26 18:59:46NagyLeoKiváló számok 2pypy3Accepted 100/10048ms79216 KiB
MOD = 10**9 + 7


def count_excellent_3():
    _ = int(input().strip())

    for __ in range(_):
        N = int(input().strip())

        if N % 2 == 0:
            last = (pow(2, N, MOD) + 2) * pow(3, -1, MOD)
        else:
            last = (pow(2, N, MOD) - 2) * pow(3, -1, MOD)

        print(f"{last % MOD}")


count_excellent_3()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted48ms76524 KiB
subtask213/13
2Accepted43ms76268 KiB
3Accepted46ms76748 KiB
subtask324/24
4Accepted46ms76996 KiB
5Accepted43ms77504 KiB
6Accepted46ms77392 KiB
7Accepted43ms77740 KiB
subtask434/34
8Accepted46ms77988 KiB
9Accepted43ms78024 KiB
10Accepted46ms78136 KiB
11Accepted43ms78996 KiB
subtask529/29
12Accepted46ms78916 KiB
13Accepted46ms78744 KiB
14Accepted46ms79120 KiB
15Accepted48ms79216 KiB
16Accepted48ms79116 KiB
17Accepted48ms79108 KiB
18Accepted46ms79188 KiB