CF 1837A - Grasshopper on a Line
2023-06-26 10:03 作者:您是打尖儿还是住店呢 | 我要投稿
You are given two integers x and k. Grasshopper starts in a point 0 on an OX axis. In one move, it can jump some integer distance, that is not divisible by k, to the left or to the right. What's the smallest number of moves it takes the grasshopper to reach point x? What are these moves? If there are multiple answers, print any of them.
给定两个整数 x 和 k。 Grasshopper 从 0 点开始
在 OX 轴上。 在一次移动中,它可以向左或向右跳跃一段整数距离,该距离不能被 k 整除。
蚱蜢到达 x 点所需的最少移动次数是多少? 这些动作是什么? 如果有多个答案,请打印其中任何一个。