#include <iostream>
using namespace std;
int main()
{
int a, b, cp, cw, x, y, z;
cin>>a;
for(int i=0;i<a;i++)
{
cin>>b;
cp=0;
cw=0;
for(int j=0;j<b;j++)
{
cin>>x>>y>>z;
cw+=x*y;
cp+=x*z;
}
if(cw==cp)cout<<"TAK"<<endl;
else cout <<"NIE"<<endl;
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <iostream> using namespace std; int main() { int a, b, cp, cw, x, y, z; cin>>a; for(int i=0;i<a;i++) { cin>>b; cp=0; cw=0; for(int j=0;j<b;j++) { cin>>x>>y>>z; cw+=x*y; cp+=x*z; } if(cw==cp)cout<<"TAK"<<endl; else cout <<"NIE"<<endl; } return 0; } |
English