PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000157. Số màu lớn nhất khi tô gạch (Tile Painting)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số màu lớn nhất khi tô gạch (Tile Painting)
Tile Painting
Source: Codeforces 1243C
Version: Phuoc Hung OJ Extended — one dataset per judge run.
Problem Statement
There are tiles numbered from to . Two distinct tiles must have the same color if divides . Find the maximum number of different colors.
Input
One line containing the integer .
Output
Print the maximum number of colors.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
4
Output
2
Explanation
Tiles have equal colors, and so do tiles , because the index difference divides . Two colors are achievable.