I have came across this problem many time but never solved any. Can anyone tell me how to approach this kind of problems and under which tag I can find more problems of similar kind. Also provide links to some problems of this kind.
this program falls under the tag of simple if else conditions and iterations of loops.
- if n==1 BOB
- if n>1 search largest prime < n and so on…
well i could remember only this many problems…
Check the comments under the editorial for this problem, you’ll find good explanation. You can find this type of problems under game-theory. This problem is basically based on observation. Hope this helps.