#include using namespace std; int fun(int q,int n){ int ans=0; if(n==0) return 0; if((1<>T; while(T--){ cin>>a>>b; cout<