Fredo is a class teacher. Today, he wants his class to form groups for an activity. He noticed that some students are absent. The number of present students in the class is a multiple of 3. So, he asked the students to form a group of 3 students for the activity.
He knows that students will form groups as:
First three rank holders present in the class would make one group, next three would make other group and so on.
He wants to make an entry of all the groups formed. So, he wants you to maintain a table which stores the minimum and maximum ranked student's roll number for each group. He wants the groups to be ordered in the table such that the group with minimum ranked students comes first , then the next group with ranks greater than the previous group and less than rest groups , and so on.
See the sample input and output for clarity.
Table : Students
Sample Students Table:
The groups formed are:
The group with member 2013005 has all ranks less than group with member 2013044, so that group comes first in the table.