Set a&b, then press green flag. space to pause. Problem 5. Larry and Rob are two robots travelling in one car from Argovia to Zillis. Both robots have control over the steering and steer according to the following algorithm: Larry makes a 90◦ left turn after every ℓ kilometer driving from start; Rob makes a 90◦ right turn after every r kilometer driving from start, where ℓ and r are relatively prime positive integers. In the event of both turns occurring simultaneously, the car will keep going without changing direction. Assume that the ground is flat and the car can move in any direction. Let the car start from Argovia facing towards Zillis. For which choices of the pair (ℓ, r) is the car guaranteed to reach Zillis, regardless of how far it is from Argovia? 의 시뮬레이션 기계!
준엽과 잔디는 평면 위의 A지점에서 B지점으로 자동차를 타고 이동하려고 하는데 자동차에는 운전대가 둘이 있어서 각자 하나씩 잡고 다음의 규칙에 따라 운전한다: 출발 후, 준엽은 매 ℓ 킬로미터마다 좌회전을 하고 잔디는 매 r킬로미터마다 우회전을 한다. 그러나, 준엽과 잔디가 동시에 각각 좌회전과 우회전을 해야 하는 경우에는 그냥 직진하기로 한다. 단, ℓ과 r은 서로 소인 양의 정수이고, 자동차는 평면 위에서 어디든 갈 수 있으며, 출발 후나 좌회전 또는 우회전 후에 항상 직진한다고 가정한다. 자동차가 A지점에서 B지점을 향해 출발한다고 할 때, 두 지점 사이의 거리에 관계없이 준엽과 잔디가 운전하는 자동차가 B 지점에 도착하게 되는 경우의 쌍 (l, r)을 모두 구하여라. 뭐, 정답은 l ≡ r ≡ 1 or 3(mod 4)인 모든 양의 정수 l,r입니다. 증명은 알아서. l,r이 mod4에 대해 합동이 아니면 회로만 이룸은 자명하니까요. lr이 순환마디니까. 마디가 끝나고 이동하게 되는 방향을 고려하면 그렇게 되죠.(방향이 돌잖아요) 합동이더라도 짝수일경우엔 서로소임에 모순이 되니까 이는 고려하지 않아요.