P3.cpp:2:7: error: 'll' does not name a type
const ll MOD = 1e9+7;
^~
P3.cpp: In function 'll _pow(ll, int)':
P3.cpp:7:20: error: 'MOD' was not declared in this scope
return ((h * h) % MOD) * (n % 2 ? a : 1) % MOD;
^~~
P3.cpp: In function 'll rev(ll)':
P3.cpp:10:31: error: 'MOD' was not declared in this scope
ll rev(ll x) { return _pow(x, MOD - 2); }
^~~
P3.cpp: In function 'int main()':
P3.cpp:19:23: error: 'MOD' was not declared in this scope
ans = K * rev(N) % MOD;
^~~
P3.cpp:22:29: error: 'MOD' was not declared in this scope
ans = ((1 - _pow(v, K) + MOD) % MOD) * (rev(1 - _pow(v, N) + MOD) % MOD) % MOD;
^~~
P3.cpp:13:17: warning: unused variable 'A' [-Wunused-variable]
ll v, ans = 0, A, B, g, X;
^
P3.cpp:13:20: warning: unused variable 'B' [-Wunused-variable]
ll v, ans = 0, A, B, g, X;
^
P3.cpp:13:23: warning: unused variable 'g' [-Wunused-variable]
ll v, ans = 0, A, B, g, X;
^
P3.cpp:13:26: warning: unused variable 'X' [-Wunused-variable]
ll v, ans = 0, A, B, g, X;
^
P3.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d%d", &P, &Q, &N, &K);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~