PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000123. Giả thuyết 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
Giả thuyết Goldbach (Goldbach's Conjecture)
Goldbach's Conjecture
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Goldbach's conjecture states that every even integer greater than can be expressed as a sum of two primes. Here, both primes must be odd.
Given an even integer , find odd primes and with , . If several pairs exist, choose the one maximizing .
Input
One line containing the integer .
Output
Print one line in the exact format n = a + b, with one space on each side of = and +. If no such pair exists, print exactly Goldbach's conjecture is wrong..
Subtasks
- Subtask 1 (20 points): ; is even.
- Subtask 2 (30 points): ; is even.
- Subtask 3 (50 points): ; is even.
Examples
Input
20
Output
20 = 3 + 17
Explanation
For , the odd-prime pairs are and . Their differences are and , respectively. Since , select and print 20 = 3 + 17.