PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000126. Đếm cách biểu diễn Goldbach (Goldbach's Conjecture (II))
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 cách biểu diễn Goldbach (Goldbach's Conjecture (II))
Goldbach's Conjecture (II)
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
For an even integer , count representations where are prime. Pairs and represent the same way, so count only pairs with . The pair is allowed.
Input
One line containing the integer .
Output
Print one integer: the number of qualifying pairs.
Subtasks
- Subtask 1 (20 points): ; is even.
- Subtask 2 (30 points): ; is even.
- Subtask 3 (50 points): ; is even.
Examples
Input
10
Output
2
Explanation
For , consider . gives composite ; gives the prime pair ; gives . There are exactly two valid pairs, so print 2.