P27903 [洛谷] [GESP202312 Level 1] Xiao Yang's Counting
普及-
题目描述

Problem Description

Xiao Yang needs to count from 1 to \( N \). During the counting process, Xiao Yang wants to skip numbers that are multiples of \( M \). For example, if \( N = 5 \) and \( M = 2 \), then Xiao Yang needs to count 1, 3, and 5 in sequence.

Now, please output the numbers Xiao Yang counts in sequence.

Input Format

The input consists of 2 lines. The first line contains an integer \( N \) (\( 1 \le N \le 1,000 \)); the second line contains an integer \( M \) (\( 2 \le M \le 100 \)).

Output Format

Output several lines, each representing a number Xiao Yang counts.

Sample Input and Output

Sample Input #1

5
2

Sample Output #1

1
3
5

Sample Input #2

10
3

Sample Output #2

1
2
4
5
7
8
10
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 2
样例输出
1 3 5