The Last One is the Best (AOJ 0297) by ynu_c
Contest: 3421    RunID: 2277082    Status: Wrong Answer    Date: Sun Apr 23 15:46:51 JST 2017


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k1,k2;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>k1>>k2;
        cout<<k1%k2<<endl;
    }
    return 0;
}