QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#842972 | #9969. Kindergarten Square | ucup-team3670# | RE | 0ms | 3580kb | C++17 | 710b | 2025-01-04 16:13:22 | 2025-01-04 16:13:27 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
int a, b, c, d;
bool read()
{
if (!(cin >> a >> b >> c >> d))
return false;
--a, --b, --c, --d;
return true;
}
void solve()
{
if (b - a != 1 || d - c != 1 || c - a != d - b){
cout << -1 << '\n';
return;
}
int x = c - a;
if (b % x == 0){
cout << -1 << '\n';
return;
}
cout << 100000 << ' ' << x << '\n';
}
int main()
{
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
cin >> t;
forn(i, t)
{
read();
solve();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
4 6 7 10 11 2 3 4 5 8 5 5 13 1 2 5 6
output:
100000 4 -1 -1 100000 4
result:
ok All testcases passed.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3560kb
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:
100000 3 -1 100000 4 100000 3 100000 4 -1 -1 -1 -1 -1
result:
ok All testcases passed.
Test #3:
score: -100
Runtime Error
input:
10 1 1 1 1 1 2 3 4 1 2 5 7 4 5 7 8 1001 1002 1003 1004 1001 1002 1005 1007 1004 1005 1007 1008 249 250 251 252 250 251 250 251 250 250 250 251