there n shovel Polycarps shop the ith shovel cost burle shovel cost 1 burle second shovel cost 2 burle shovel cost 3 burle Polycarps want sell shovel pairsvisitor likely buy pair shovel total cost end 9s because Polycarp wants choose pair shovel sell way sum cost end maximum possible number nine for example choose shovel cost 12345 37454 total cost 49799 end ninesyou compute number pair shovel total cost end maximum possible number nine two pair consider different shovel present pair