Mhow can i solve this task?
i tried sorting and then adding but it is TLE
DYour Sorting is too slow... Try learning some other sort algorithm like quicksort?
Mbut are u sure it can be solved this way?
its np to try some other sorting but can this be solved in pascal with time limit of 0.1 sec.
In the contest the limit was 1 sec