------
## 最终结论
```python
def max_score(tc, test_cases):
    results = []
    
    for case in test_cases:
        n, C, T, problems = case
        problems.sort(key=lambda x: (-x[1], x[0]))  # Sort by score descending, then difficulty ascending
        
        max_possible_score = 0
        
        for train_time in range(0, int(T) + 1):
            s = 1.0 + C * train_time
            time_left = T - train_time
            
            current_score = 0
            for a_i, p_i in problems:
                episode_time = 10
                solving_time = a_i / s
                
                if time_left >= episode_time + solving_time:
                    time_left -= (episode_time + solving_time)
                    current_score += p_i
                    s *= 0.9  # Decrease skill after watching an episode
                else:
                    break
            
            max_possible_score = max(max_possible_score, current_score)
        
        results.append(max_possible_score)
    
    return results

# Example usage:
tc = 2
test_cases = [
    (4, 1.000, 31.000, [(12, 3), (20, 6), (30, 1), (5, 1)]),
    (3, 1.000, 30.000, [(1, 10), (10, 10), (20, 8)])
]

print(max_score(tc, test_cases))
```