20分后全TLE!!!
查看原帖
20分后全TLE!!!
1390387
vector_STL_楼主2024/9/28 11:10
#include <bits/stdc++.h>
using namespace std;

int main() {
	freopen("decode.in", "r", stdin);
	freopen("decode.out", "w", stdout);
	long long n, i, j, k;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		long long cut = 0;
		long long a, b, c;
		cin >> a >> b >> c;
		for (j = 1; j <= a; j++) {
			for (k = 1; k <= a; k++) {
				if (a == k * j && b * c == (j - 1) * (k - 1) + 1 && j <= k) {
					cout << j << " " << k << endl;
					break;
				} else {
					cut++;
				}
			}
		}
		if (cut == a * a) {
			cout << "NO" << endl;
		}
	}
}
2024/9/28 11:10
加载中...