QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#856468#9969. Kindergarten SquareDosPelones#RE 1ms3712kbC++17518b2025-01-14 01:35:192025-01-14 01:35:19

Judging History

你现在查看的是最新测评结果

  • [2025-01-14 01:35:19]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3712kb
  • [2025-01-14 01:35:19]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    int t; cin >> t;
    while(t--){
        ll a,b,c,d; cin >> a >> b >> c >> d;
        if(a != b-1 || c != d-1) {
            cout << "-1\n";
            continue;
        }
        ll h, w = c - a;
        if((b-1)%w == 0){
            cout << "-1\n";
            continue;
        }
        h = c/w + 1;
        cout << h << " " << w << '\n';
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3712kb

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: 0
Accepted
time: 1ms
memory: 3712kb

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

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

output:


result: