#include #include #include #include using namespace std; int contar = 0; string cadena = ""; bool comprobar(pair inicio,pair fin){ if((inicio.first%2 == 0 && fin.first%2 == 0)||(inicio.first%2 != 0 &&fin.first%2 != 0)){ int distancia = abs(inicio.first - fin.first),dist = abs(fin.second - inicio.second); if(distancia%4 == 0){ if(dist%2 == 0) return true; }else{ if(dist%2 != 0) return true; } } return false; } void desplazamiento(pair inicio,pair fin){ while(inicio.first != fin.first || inicio.second != fin.second){ if(inicio.first < fin.first){ if(inicio.second <= fin.second){ cadena+= "LR "; inicio.second +=1; }else if(inicio.second >fin.second){ cadena +="LL "; inicio.second -=1; } inicio.first +=2; }else if(inicio.first > fin.first){ if(inicio.second< fin.second){ cadena += "UR "; inicio.second +=1; }else if(inicio.second>=fin.second){ cadena += "UL "; inicio.second -=1; } inicio.first-=2; }else{ if(inicio.second >fin.second){ cadena += "L "; inicio.second -=2; }else if(inicio.second partida,termino; cin>>tamanio; cin>>x>>y>>xf>>yf; partida = make_pair(x,y); termino = make_pair(xf,yf); if (comprobar(partida,termino)){ desplazamiento(partida,termino); cout<