gianni swerc chief judge receive huge high quality problem judge choose problem set SWERCHe receive n problem assign beauty score difficulty the ith problem beauty score equal b_i difficulty equal d_i the beauty difficulty integer 1 10 if problem certain difficulty possible difficulty 12dots10 Gianni ask problem judgesotherwise difficulty 1 10 problem set beautiful problem difficulty problem set contain exactly 10 problem distinct difficulty you shall compute total beauty problem set sum beauty score problem choose Gianni