Submission #19347

# Submission time Handle Problem Language Result Execution time Memory
19347 2016-02-24T10:21:56 Z algoshipda Σ (kriii4_P2) C++14
0 / 100
29 ms 1716 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long lld;
const int MOD = 1e9 + 7;

int fpow(int n, int k)
{
	if(k == 0) return 1;
	if(k % 2){
		return 1ll * n * fpow(n, k - 1) % MOD;
	}
	int h = fpow(n, k / 2);
	return 1ll * h * h % MOD;
}
int main()
{
	int t;
	cin >> t;
	while(t--){
		int n, k;
		cin >> k >> n;
		cout << (1ll * n * fpow(k, MOD - 2) % MOD) << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 1716 KB Output isn't correct
2 Halted 0 ms 0 KB -