PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000132. Đếm tổng tiền tố nguyên tố (Consecutive Prime Sum)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm tổng tiền tố nguyên tố (Consecutive Prime Sum)
Consecutive Prime Sum
Source: CodeChef — CONSPRIMESUM
Version: Phước Hưng OJ Extended; one input file per judge run.
Problem Statement
Consider prefix sums of the increasing sequence of primes , using at least two terms. Given , count prime-valued prefix sums not exceeding . The original multiple-case format is adapted to one per run.
Input
One integer .
Output
Print the count of qualifying prime prefix sums.
Subtask
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
50
Output
3
Explanation
The example follows the mathematical conditions and the specified output format.