PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000136. Số nguyên tố phân biệt ít nhất và số cách (Just Primes 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
Số nguyên tố phân biệt ít nhất và số cách (Just Primes II)
Just Primes II
Source: SPOJ — JPM2
Version: Phước Hưng OJ Extended; one input file per judge run.
Problem Statement
Given positive integer , find the minimum size of a set of distinct primes summing to , and the number of distinct sets of that minimum size. If no representation exists, print -1 -1. The SPOJ multi-case format is adapted to a single per PHOJ run.
Input
One integer .
Output
Two integers X Y, or -1 -1 if impossible.
Subtask
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
27
Output
3 3
Explanation
The example follows the mathematical conditions and the specified output format.