#P2755. 洗牌问题

洗牌问题

Description

There are 2n 2n cards, numbered as

1,2,3n,n+1,2n1,2,3 \dots n,n+1, \dots 2n

which is also the initial order of the deck. One shuffle transforms the sequence into

$$n+1,1,n+2,2,n+3,3,n+4,4 \dots 2n,n $$. It can be proven that for any natural number $ n $, there exists a smallest positive integer $ m $ such that after performing the shuffle $ m $ times, the deck returns to its initial order for the first time. Given $ n $ ($ n \le 10^8 $), compute this $ m $. ## Input Format One line containing a positive integer $ n $. ## Output Format One line containing a positive integer $ m $. ```input1 20 ``` ```output1 20 ``` ## Hint For $ 100\% $ of the testdata, $ 1 \le n \le 10^8 $. Translated by ChatGPT 5$$