#include #include #include #include #include using namespace std; ifstream fin("party.in"); ofstream fout("party.out"); int high[256][256]; int sweet[256][256]; struct party { int x,y,start,time,enD,I; }; vectorparties; vectorsweets1,sweets2; bool cmp(party a,party b) { if (a.startb.start)return 0; if (a.enDb.enD)return 0; if (a.xb.x)return 0; if (a.yb.y)return 0; if (a.Ib.I)return 0; return 1; } int hhhh; int different(int a,int b,int x,int y) { //fout<=x;i--) { int help=abs(high[i][b]-high[i+1][b]); ans+=help*help; } } if (b=y;i--) { int help=abs(high[x][i]-high[x][i+1]); ans+=help*help; } } if (b=y;i--) { int help=abs(high[a][i]-high[a][i+1]); ans2+=help*help; } } if (a=x;i--) { int help=abs(high[i][y]-high[i-1][y]); ans2+=help*help; } } //cout<=x;i--) { fout<<"U"; } } if (b=y;i--)fout<<"L"; } return ; } if (b=y;i--) { int help=abs(high[a][i]-high[a][i+1]); ans2+=help*help; fout<<"L"; } } if (a=x;i--) { int help=abs(high[i][y]-high[i-1][y]); ans2+=help*help; fout<<"U"; } } } int main() { int n,p,k; fin>>n>>p>>k; int i,j; for (i=1;i<=n;i++) { for (j=1;j<=n;j++)fin>>high[i][j]; } int a,b; fin>>a>>b; for (i=0;i>help.x>>help.y>>help.start>>help.time; help.enD=help.start+help.time; parties.push_back(help); } for (i=0;i>x>>y; sweet[x][y]=1; sweets1.push_back(x); sweets2.push_back(y); } sort(parties.begin(),parties.end(),cmp); /*for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { fout<raz)raz=parties[i].enD; } } fout<