fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t; cin>>t;
  6. for (int i(0); i<t; i++)
  7. {
  8. int A,B, C,D, E,F;
  9. cin>>A>>B>>C>>D>>E>>F;
  10.  
  11. int a=(D-B)/(C-A);
  12. int b=B-a*A;
  13.  
  14. if (F==a*E+b) cout<<"TAK"<<endl;
  15. else cout<<"NIE"<<endl;
  16. }
  17. return 0;
  18. }
Runtime error #stdin #stdout 0s 15240KB
stdin
5
1	2	3	4	5	6
1	3	1	4	1	-3
1	2	-3	4	3	9
2	-1	3	-1	-4	-1
0	0	0	0	0 	0
stdout
TAK