|  | 
|  | 
| вернуться в форум | Good simulation problem Hint:we start from kk = 1, then kk += kk (2), kk += kk (4) but we cannot advance when kk > k.
 get to the maximum kk with this and the remaining n - kk can be easily calculated with
 (n - kk) / k + (((n - kk) % k) > 0)
 | 
 | 
|