#CCBCHBA0000096. Logical Sequence 2
Logical Sequence 2
Logical Sequence 2
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
Given with , print integers 1 through in ascending order, at most integers per line. Start a new line after every complete group of ; also print the remaining last group, if any. Use exactly one space between numbers and no trailing spaces.
Input
One line contains two integers and in this order.
Output
Print numbers 1.., with per full line and possibly fewer on the final line.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
3 8
Output:
1 2 3
4 5 6
7 8
Explanation:
Consecutive integers are split into groups of x; the last group may have fewer elements. For this sample, the input is 3 8; the displayed rows follow these rules exactly.
Example 2
Input:
2 5
Output:
1 2
3 4
5
Explanation:
Consecutive integers are split into groups of x; the last group may have fewer elements. For this sample, the input is 2 5; the displayed rows follow these rules exactly.