#P1662. 数7
数7
Description
There are people standing in a circle. Starting from person , they count numbers; the initial direction is . If the number someone says is a multiple of or contains the digit , then the counting direction flips. Which numbered person says number ?
For example, for the first numbers:
| Number | Index of the person who says it |
|---|---|
Input Format
One line containing an integer .
Output Format
One line containing an integer, the index of the person who says number .
1000
1311
Hint
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号