Prob B

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

E

COMP6047 – Algorithm and Programming

T
T
NO
BU
Late Night Counting
Lili was currently having a trouble with sleeping. She have been doing the “counting
sheeps” method for 1 week long and got bored with it. Just in the right time, Lili got an
idea to count a random number. She said this method would make her brain tired and
make her easier to sleep. What she did is to get two number N and M , then she count

I
M numbers starting from N . Now, you are having an insomnia, so you want to try this

R
O
method.

Note: you have to print exactly one newline character (‘\n’) at the end of your answer,
T
otherwise your answer will be judged wrong.
D
S
Format Input
The input consists a line containing two numbers N and M separated by a space.
DI

Format Output
Output M lines each containing a number, the number in your counting.
OT
UT
RE

Constraints
• 1 ≤ N ≤ 100

• 1 ≤ M ≤ 10
N
IB
Sample Input 1 (standard input)
1 5
TR
DO

Sample Output 1 (standard output)


1
2
3
IS

4
5
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
Sample Input 2 (standard input)

NO
BU
6 5

Sample Output 2 (standard output)


6

I
7
8

R
O
9
10 T
D

Sample Input 3 (standard input)


S
10 10
DI

Sample Output 3 (standard output)


10
11
OT
UT
12
RE

13
14
15
16
17
N
18
19
IB
TR
DO
IS
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
NO
BU
Late Night Counting
Lili mengalami masalah tidur. Dia mencoba melakukan metode “counting sheeps” selama
1 minggu berturut-turut dan merasa bosan. Pada saat itu, Lili mendapatkan ide untuk
menghitung angka secara acak. Dia berkata bahwa metode ini akan membuat otaknya
lelah dan membantu dirinya untuk tidur lebih cepat. Lili mengambil dua buah angka N

I
dan M secara acak, kemudian menghitung M buah angka mulai dari N . Sekarang, kamu

R
O
terkena insomnia dan ingin mencoba metode Lili.

Catatan: Anda harus mencetak tepat satu karakter newline (‘\n’) di akhir jawaban,
T
atau jawaban Anda akan dianggap salah.
D
S
Format Input
Input terdiri dari 1 baris yang mengandung dua angka N dan M yang dipisahkan oleh
DI

spasi.

Format Output
OT
UT
Keluarkan M baris yang masing-masing berisi sebuah angka, yaitu angka yang ada di
RE

dalam hitungan.

Constraints
• 1 ≤ N ≤ 100
N
IB
• 1 ≤ M ≤ 10

Sample Input 1 (standard input)


TR
DO

1 5

Sample Output 1 (standard output)


1
IS

2
3
4
5
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
Sample Input 2 (standard input)

NO
BU
6 5

Sample Output 2 (standard output)


6

I
7
8

R
O
9
10 T
D

Sample Input 3 (standard input)


S
10 10
DI

Sample Output 3 (standard output)


10
11
OT
UT
12
RE

13
14
15
16
17
N
18
19
IB
TR
DO
IS
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.

You might also like