Dãy số lặp Bắc Giang


Submit solution

Points: 20
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Python

Cho dãy số có quy luật như sau: 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, ...

Cho một số tự nhiên N, hãy tìm số thứ N của dãy số trên (các số được đánh thứ tự từ 1).

Input:

- Một số tự nhiên N.

Output:

- In ra số ở vị trí thứ N của dãy số.

Ví dụ 1:

Input
5

Output
3

Ví dụ 2:

Input
8

Output
4

Comments

There are no comments at the moment.