PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000179. Những món quà có đúng ba ước
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Những món quà có đúng ba ước
Namit In Trouble
PHOJ ID: PRIME000184
Original source: SPOJ NGIRL
Version: PHOJ Extended, one dataset per run.
Problem statement
There are gifts at positions ; the gift at position costs . Count (1) positions whose numbers have exactly three positive divisors and (2) such positions whose costs are strictly greater than .
Input
One line with integers and .
Output
Print two integers: the total number of eligible gifts, and how many of those cost more than .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
20 7
Output
2 1
Explanation
The only positions with exactly three divisors up to 20 are 4 and 9; only 9 is strictly greater than 7.