solution of 1st problem
solution of 2nd problem