#SP0000033. Trò chơi lập danh sách (A List Game)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Trò chơi lập danh sách (A List Game)
A List Game
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
Two friends play a game with positive integers. The first player chooses a positive integer . The second player writes a list of positive integers such that
Every entry must be at least . A valid list of entries earns the second player points.
You are the second player. Find the maximum number of points you can earn. Print only the maximum number of points, not the list itself.
Input
A single line containing the integer chosen by the first player.
Output
Print one integer: the largest possible for which a valid list exists.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
1000
Output
6
Explanation
For , choose six entries: and . Their corresponding factors yield
A longer list would require splitting at least one of these six prime factors into a product of integers greater than . As and are prime, no such split exists. Therefore the answer is .
Input
2310
Output
5
Explanation
We have . The list satisfies the product condition and scores points. Each of the five factors is prime, so none can be split into smaller integers greater than to make the list longer.