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

Bài tập thuộc lộ trình

1 lộ trình

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 NN, find the minimum size XX of a set of distinct primes summing to NN, and the number YY of distinct sets of that minimum size. If no representation exists, print -1 -1. The SPOJ multi-case format is adapted to a single NN per PHOJ run.

Input

One integer NN.

Output

Two integers X Y, or -1 -1 if impossible.

Subtask

  • Subtask 1 (20 points): 1≤N≤100001\le N\le10000.
  • Subtask 2 (30 points): 1≤N≤1000001\le N\le100000.
  • Subtask 3 (50 points): 1≤N≤5000001\le N\le500000.

Example

Input

27

Output

3 3

Explanation

The example follows the mathematical conditions and the specified output format.