PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#TP0000060. Quy tắc mới ở Euphomia (The New Rule in Euphomia)
HỌC THEO LỘ TRÌNH
2 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Quy tắc mới ở Euphomia (The New Rule in Euphomia)
The New Rule in Euphomia
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
In Euphomia, unordered pairs of two different prime numbers are considered. Given an integer , a pair counts if both numbers are prime, , and .
Determine the number of such pairs. Following the UVa case-label format, print Case 1: X, where is the count for the given data set.
Input
- One line contains integer : the upper bound on the sum of the two primes.
Output
Print one line in the exact form Case 1: X, where is the number of distinct-prime pairs with sum at most .
Subtasks
- Subtask 1 (20 points): ; is an integer.
- Subtask 2 (30 points): ; is an integer.
- Subtask 3 (50 points): ; is an integer.
Examples
Input
10
Output
Case 1: 5
Explanation
For , the primes up to are . The five distinct-prime pairs satisfying the bound are , , , and . Pair is excluded because the primes must be different. Hence the required line is Case 1: 5.