PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000124. Các biểu diễn Goldbach (Goldbach's Conjecture)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Các biểu diễn Goldbach (Goldbach's Conjecture)
Goldbach's Conjecture
Source: Kattis (NAQ 2013) — goldbach2
Version: Phước Hưng OJ Extended; one input file per judge run.
Problem Statement
Given an even integer , list all pairs of primes such that and , each pair once and in increasing order of . The NAQ 2013 multi-case format is adapted to one even integer per PHOJ run.
Input
One even integer .
Output
First print x has k representation(s); then print each pair as p+q without spaces.
Subtask
- Subtask 1 (20 points): , even.
- Subtask 2 (30 points): , even.
- Subtask 3 (50 points): , even.
Example
Input
26
Output
26 has 3 representation(s)
3+23
7+19
13+13
Explanation
The example follows the mathematical conditions and the specified output format.