SKS001 - Secret Recipe
Harsh and Vishal are besties.Vishal has a secret recipe which would land both of them a job.But he his unwilling
to share his recipe.
Both of them are standing on the positive side of x-axis.Harsh is on coordinate i and Vishal on j(i<=j).Harsh can make two kinds of moves,
if he is standing on coordinate m he could either move to m+1 or a coordinate n such that n is prime.The cost of jumping is the value of the coordinate on which Harsh jumps.
Vishal would give his recipe only if Harsh reaches him in minimum total cost.Help Harsh out.
The first line of input contains two integers i and j (i<=j) as mentioned above.
Output a single line containing minimum cost to reach j from i.
Input: 2 4
he cant move backwards..(to m-1) right?Last edit: 2018-11-09 12:51:15