Accelerated Learning

Time: 1.0 s     Memory: 1024 MB
  • When little Joshua was in his darkest moments while studying for exams, he found this video. Unfortunately, it didn’t save him from the harsh reality of studying for exams, but it gave him a problem idea. Your task is to solve that problem. If it’s not obvious what the problem is, listen to the video for a while, and it should become clear.

    Input

    The first line of input contains the integer $N$ ($1 \leq N \leq 1000$).

    The second line contains the integers $l_1, l_2, \dots , l_N$ ($1 \leq l_i \leq 1000$).

    Output

    Print a single integer: the answer to the problem.

    Scoring

    Your solution will be tested on multiple test cases. To solve the problem, you must pass all test cases.

    Sample Input 1 Sample Output 1
    4
    1 1 1 1
    
    2
    
    Sample Input 2 Sample Output 2
    5
    1 2 2 20 5
    
    20
    
    Sample Input 3 Sample Output 3
    4
    5 2 3 1
    
    6
    
    Sample Input 4 Sample Output 4
    1
    5
    
    5
    
April fools 2024
You must log in to submit solutions to the problem.
{"contest_start_timestamp": 1711962000, "contest_duration": 7200, "contest_started": true, "contest_ended": true, "flexible_start_window_end_time": null, "only_virtual": false}