how we can find p1 = p2 = …pn, if both are in line variable and this all are also part of a single test case
# cook your dish here
for i in range(t):
for j in range(n):
if pi > 8 :
if pi > si:
Problem Link: WATSCORE Problem - CodeChef
U can store the max score of each problem in some datastructure like dictionary or list .
first u will put for 1->5
then u find 1 again then now 1 will give u 50 then update the value of at . now 1->50
then u find 2 . then 2->30.
then u find 2 again but now it will give u less score then previous so don,t update it.
then u will find 9 which is non scorable so ignore it.
so the answer will be 50+30=80.