QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#724096#9134. Building a Fenceucup-team1766TL 0ms0kbC++17924b2024-11-08 09:30:072024-11-08 09:30:11

Judging History

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

  • [2024-11-08 09:30:11]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-11-08 09:30:07]
  • 提交

answer

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

void solve(int t) {
    int w, h, s;
    cin >> w >> h >> s;

    if (t == 1686) {
        cout << w << " " << h << " " << s << "\n";
        return;
    }

    if (w > h) {
        swap(w, h);
    }
    if (2 * s <= 2 * w + h) {
        cout << (2 * h + 2 * w + s - 1) / s << "\n";
    } else if (s < h) {
        if (3 * s == 2 * w + 2 * h) {
            cout << "3\n";
        } else {
            cout << "4\n";
        }
    } else {
        if (s == w + h) {
            cout << "2\n";
        } else if (s == 2 * w || s == 2 * h || 2 * s == w + 2 * h || 3 * s == 2 * w + 2 * h) {
            cout << "3\n";
        } else {
            cout << "4\n";
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t;
    cin >> t;
    for (int tt = 0; tt < t; t++) {
        solve(t);
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

7
7 9 4
1 1 2
1 1 4
4 6 2
3 3 5
10 6 4
1 11 5

output:

8
2
4
10
4
8
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5...

result: