(String args[])
| 8 | return (Jos(n - 1,k) + k-1) % n + 1; |
| 9 | } |
| 10 | public static void main(String args[]) |
| 11 | { |
| 12 | Scanner I = new Scanner(System.in); |
| 13 | int n = I.nextInt(), k = I.nextInt(); |
| 14 | System.out.println(Jos(n,k)); |
| 15 | I.close(); |
| 16 | } |
| 17 | } |
| 18 | /*when starting pos is 0 |
| 19 | import java.util.*; |