Cod sursa(job #2558584)

Utilizator Alex_AeleneiAlex Aelenei Ioan Alex_Aelenei Data 26 februarie 2020 17:39:07
Problema Fructe Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>
#include <iostream>

using namespace std;

int main()
{
    ifstream in ( "fructe.in" ) ;
    ofstream out ( "fructe.out" ) ;

    int n , i , x , y ;

    in >> n ;

    for ( i = 1 ; i <= n ; ++ i )
    {
        in >> x >> y ;

        if ( x % 2 == 0 )
            out << 0 ;
        else
        {
            y += x / 2 ;
            out << y % 2 ;
        }

        out << '\n' ;
    }
    return 0;
}