code- https://ide.codingblocks.com/s/280717 i tride to code but not showing correct output
use this code
this is correct approach of this problem