// Author: Lech Duraj // O(n^2) #include #include #include using namespace std; int gcd(int a, int b) { if (a> TT; while(TT--) { int n; cin >> n; vector X(n),Y(n),R(n); vector moving(n,false); for(int i=0; i> X[i] >> Y[i] >> R[i]; queue Q; Q.push(0); moving[0] = 1; while(!Q.empty()) { int u = Q.front(); Q.pop(); for(int i=0; id) cout << "/" << R[i]/d; cout << (moving[i]==1 ? " clockwise" : " counterclockwise") << endl; } } } }