human
I found an interesting problem on https://codeforces.com/problemset/problem/1056/F:
Polycarp, Arkady's friend, prepares to the programming competition and decides to write a contest. The contest consists of $n$ problems and lasts for $T$ minutes. Each of the problems is defined by two positive integers $a_i$ and $p_i$ — its difficulty and the score awarded by its solution.

Polycarp's experience suggests that his skill level is defined with positive real value $s$, and initially $s=1.0$. To solve the $i$-th problem Polycarp needs $a_i/s$ minutes.

Polycarp loves to watch series, and before solving each of the problems he will definitely watch one episode. After Polycarp watches an episode, his skill decreases by $10\%$, that is skill level $s$ decreases to $0.9s$. Each episode takes exactly $10$ minutes to watch. When Polycarp decides to solve some problem, he firstly has to watch one episode, and only then he starts solving the problem without breaks for $a_i/s$ minutes, where $s$ is his current skill level. In calculation of $a_i/s$ no rounding is performed, only division of integer value $a_i$ by real value $s$ happens.

Also, Polycarp can train for some time. If he trains for $t$ minutes, he increases his skill by $C \cdot t$, where $C$ is some given positive real constant. Polycarp can train only before solving any problem (and before watching series). Duration of the training can be arbitrary real value.

Polycarp is interested: what is the largest score he can get in the contest? It is allowed to solve problems in any order, while training is only allowed before solving the first problem.

-----Input-----

The first line contains one integer $tc$ ($1 \le tc \le 20$) — the number of test cases. Then $tc$ test cases follow.

The first line of each test contains one integer $n$ ($1 \le n \le 100$) — the number of problems in the contest.

The second line of the test contains two real values $C, T$ ($0 < C < 10$, $0 \le T \le 2 \cdot 10^5$), where $C$ defines the efficiency of the training and $T$ is the duration of the contest in minutes. Value $C, T$ are given exactly with three digits...

I tried it in Python, but could not do it. Can you solve it?

 Can you provide a the largest score he can get in the contest?
assistant
#Here is the largest score he can get in the contest.

from math import sqrt
class pro(object):
    def __init__(self,dif,sc):
        self.dif=dif
        self.sc=sc

    def __lt__(self,other):
        return self.dif>other.dif

T=int(input())
mul=[1]
for i in range(100):
    mul.append(mul[i]*10/9)
inf=1000000007
for t in range(T):
    n=int(input())
    effi,tim=list(map(float,input().split()))
    prob=[]
    for i in range(n):
        x,y=list(map(int,input().split()))
        prob.append(pro(x,y))
    prob.sort()
    f=[[inf for i in range(n+1)] for j in range(1001)]
    f[0][0]=0
    totsc=0
    for i in range(n):
        totsc+=prob[i].sc
        for j in range(totsc,prob[i].sc-1,-1):
            for k in range(1,i+2):
                f[j][k]=min(f[j][k],f[j-prob[i].sc][k-1]+prob[i].dif*mul[k])
    for i in range(totsc,-1,-1):
        flag=False
        for j in range(n+1):
            if sqrt(effi*f[i][j])>=1:
                res=2*sqrt(f[i][j]/effi)-1/effi+10*j
            else:
                res=f[i][j]+10*j
            if res<=tim:
                print(i)
                flag=True
                break
        if flag==True:
            break