Help me in solving HTMLT2P05 problem

My issue

Subtask 1 (10 points):
1

M

10
1≤M≤10
Subtask 2 (20 points): The sum of
N
N across all test cases won’t exceed
20
20.
Subtask 3 (70 points): No further constraints.

My code

// your code goes here

Learning course: Projects using HTML / CSS
Problem Link: Task - 5B Practice Problem in Projects using HTML / CSS