#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> T >> A >> B; ll dist = max(A, B); if(TB){ p(">"); x++; }else{ p("^"); y++; } T--; } // 貪欲に近づく while(T--){ ll dx = B-x; ll dy = A-y; if(dx==0 && dy==0){ p("0){ command += ">"; x++; } if(dy>0){ command += "^"; y++; } p(command); } } return 0; }