QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#859906 | #9969. Kindergarten Square | sherman2022# | WA | 0ms | 3840kb | C++14 | 749b | 2025-01-18 08:21:35 | 2025-01-18 08:21:48 |
Judging History
answer
#include <bits/stdc++.h>
#define i64 long long int
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
inline int Read() {int res; return scanf("%d", &res), res; }
inline i64 Read64() {i64 res; return scanf("%lld", &res), res; }
const int INF_32 = 1e9;
const i64 INF_64 = 1e18;
int T, a, b, c, d;
int main() {
T = Read();
while(T --) {
a = Read(), b = Read();
c = Read(), d = Read();
if(a != b - 1 || c != d - 1) puts("-1");
else {
if(a == d || a == c || b == c) puts("-1");
int m = c - b + 1;
int n = (d + m - 1) / m;
if((a - 1) % m > m - 2) puts("-1");
else printf("%d %d\n", n, m);
}
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3840kb
input:
4 6 7 10 11 2 3 4 5 8 5 5 13 1 2 5 6
output:
3 4 -1 -1 2 4
result:
ok All testcases passed.
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3840kb
input:
10 1 2 4 5 4 3 2 1 1 2 5 6 2 3 5 6 2 3 6 7 3 4 6 7 2 1 3 4 1 2 2 3 2 3 3 4 7 7 7 7
output:
2 3 -1 2 4 2 3 2 4 -1 -1 -1 -1 -1 -1 -1
result:
wrong output format Extra information in the output file