In this example i have learned several new things like.

-> cout.setf(ios::fixed) combined with cout.precision(2) will always give the output of number upto 2 decimal places.
   Therefore 120 will be printed as 120.00 so cool...!

-> for the inputs of the form {300 120.00} (i.e. 2 numbers seperated by a space) we can use {cin>>a>>b}.
   similarly this chain can be extended to any length.