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.
給定兩個整數(shù) x 和 k。 Grasshopper 從 0 點(diǎn)開始
? 在 OX 軸上。 在一次移動中,它可以向左或向右跳躍一段整數(shù)距離,該距離不能被 k 整除。
蚱蜢到達(dá) x 點(diǎn)所需的最少移動次數(shù)是多少? 這些動作是什么? 如果有多個答案,請打印其中任何一個。
標(biāo)簽: