Melon (校赛)

A.

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll ans (int n, int m) {
	if(n > m) return 0;
	ll res = 1;
	for (int i = 0; i < n; i++)
		res *= (m--);
	return res;
}


int main () {
	ios::sync_with_stdio(false);
	int T;
	cin >> T;
	while (T--) {
		int n, m;
		cin >> n >> m;
		cout << ans(n, m) << endl;
	}
	return 0;
}

 D.

猜你喜欢

转载自www.cnblogs.com/lightac/p/10716050.html
今日推荐