Div2-B (Child and Set) problem.

Revision en2, by rr459595, 2018-06-19 20:42:10

Link to the problem:- http://codeforces.net/problemset/problem/437/B

I read the editorial where it says we have to use greedy approach by iterating from limit to 1. I don't understand why this approach works here.Iterating from 1 to limit doesn't work here.

Can someone help me in proving why greedy approach(iterating from limit to 1) works here ?

Thanks.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English rr459595 2018-06-19 20:42:10 42
en1 English rr459595 2018-06-19 20:41:31 362 Initial revision (published)