Submission

Status:

xxxxxxxxxx

Subtask/Task Score:

0/100

Score: 0

User: Karatat007

Problemset: Medulla

Language: cpp

Time: 0.102 second

Submitted On: 2026-10-20 19:45:59

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll k = 20011;
ll f(ll x){
    if(x <= 2) return (x%k)*(x%k)*(x%k);
    else{
        return f((x-3)*(x-3)*(x-3)) + f(x-2)*f(x-1);
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    while(n--){
        ll m;
        cin >> m;
        cout << f(m)%k << '\n';
    }
}