PBCDIV - Phép chia hết

Tác giả: RR

Ngôn ngữ: C++

#include <cstdio>
long long cnt(long long a){
    return a/30+a/12-a/60*2;
}
int main(){
    int t;scanf("%d",&t);
    long long a,b;
    while (t--){
        scanf("%lld%lld",&a,&b);
        printf("%lld\n",cnt(b)-cnt(a-1));
    }
    return 0;
}

Download