PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000138. Biểu diễn tổng nguyên tố theo thứ tự từ điển (Sum-up the Primes)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Biểu diễn tổng nguyên tố theo thứ tự từ điển (Sum-up the Primes)
Sum-up the Primes
Source: UVa — 10419
Version: Phước Hưng OJ Extended; one input file per judge run.
Problem Statement
Express as a sum of exactly primes below , each odd prime at most twice and prime at most once. Print the lexicographically smallest decimal expression (as a character string), or No Solution.. One is supplied per PHOJ run; retain the header CASE 1:.
Input
One line with integers .
Output
Print CASE 1: and then the expression without spaces or No Solution..
Subtask
- Subtask 1 (20 points): , .
- Subtask 2 (30 points): , .
- Subtask 3 (50 points): , .
Example
Input
100 4
Output
CASE 1:
11+11+17+61
Explanation
The example follows the mathematical conditions and the specified output format.