Solution to the problem number 274 of AceptaelReto - 274.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
#define INF 0x3F3F3F3F
using namespace std;

int main()
{
    long long int cases,di,se,dt;
    scanf("%lld",&cases);
    while (cases--)
    {
        scanf("%lld%lld%lld",&dt,&se,&di);
        if (di == 1) printf("%lld\n",dt/se);
        else printf("%lld\n",(dt-(se-(di-1)))/se);
    }
    return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!