Question: http://codeforces.com/contest/1015/problem/D
i figured out the cases when the ans will be 'NO'. But how can i complete 's' distance in 'k' moves..?? And what will be the distance covered in each move..?
Help me, with the logic
Asked by: Samrat_De on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.
Yes ,your approach is correct...
(s/k+1)steps up and down for s%k times and remaining steps were of length s/k..
Few corner cases would be if the maximum jump allowed is (s/k) then you can't jump the distance of(s/k+1)
if(s/k is zero) you would land in the same place at some time...(jump will have to be of zero size).