Pagini recente » Cod sursa (job #777522) | Cod sursa (job #2640023) | Cod sursa (job #899835) | Cod sursa (job #2814283) | Cod sursa (job #927576)
Cod sursa(job #927576)
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fructe.in");
ofstream out("fructe.out");
long long t,p,b;
void hard_work(){
in >> t;
for (int i=1; i<=t; i++){
in >> p >> b;
while(p!=0&&b!=0){
if (p>b){
p--;
} else if (p<b){
p--;
} else if (p==b) {
b--;
}
}
if (p==0) out << "0" << "\n";
else if (b==0) out << "1" << "\n";
}
}
int main()
{
hard_work();
return 0;
}