QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#117652#6563. Four Squarecada_dia_mas_insanos#WA 1ms3316kbC++14747b2023-07-01 21:39:462023-07-01 21:39:53

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-01 21:39:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3316kb
  • [2023-07-01 21:39:46]
  • 提交

answer

/**
    @author: Cada día más insanos
    @url: https://qoj.ac/contest/1248/problem/6558
*/

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

typedef long long ll;
typedef long double ld;
#define pb push_back
#define ff first
#define ss second
#define endl "\n"

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

const ll INF = 1e18+5, MOD = 1e9+7, NMAX = -1;

ll t, n, k, d;

int main() {
    /*//
    freopen("entrada.in", "r", stdin);
    freopen("salida.out", "w", stdout);
    //*/

    cin >> t;
    while (t--) {
        cin >> n >> d;
        if ((n-1LL)%(d+1LL) == 0) cout << (n-1LL)/(d+1LL) << endl;
        else cout << (n-1LL)/(d+1LL) + 1LL << endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3316kb

input:

1 1
1 1
1 1
1 1

output:

0

result:

wrong answer 1st lines differ - expected: '1', found: '0'