結果
| 問題 | No.2921 Seated in Classroom | 
| コンテスト | |
| ユーザー |  Jikky1618 | 
| 提出日時 | 2024-10-12 20:23:46 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 51 ms / 2,000 ms | 
| コード長 | 704 bytes | 
| コンパイル時間 | 3,249 ms | 
| コンパイル使用メモリ | 243,512 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-12 20:23:51 | 
| 合計ジャッジ時間 | 4,550 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 5 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
template <class T, class U>
T ceil(T x, U y) {
    return (x > 0 ? (x + y - 1) / y : x / y);
}
template <class T, class U>
T floor(T x, U y) {
    return (x > 0 ? x / y : (x - y + 1) / y);
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int T;
    cin >> T;
    while (T--) {
        ll N, M;
        cin >> N >> M;
        ll ans = max(ceil(N, 4), ceil(N + M, 8));
        cout << ans << '\n';
    }
}
            
            
            
        