### Indian National Olympiad in Informatics

### Online Programming Contest, 4-5 December 2004

### Basic Division

Problem 2: Find the Numbers, *(K Narayan Kumar, CMI)*

This is a rather simple problem to describe. You will be given
three numbers *S*, *P* and *k*. Your task is
to find if there are integers *n*_{1},
*n*_{2},...,*n*_{k} such that
*n*_{1} + *n*_{2} +...+
*n*_{k} = *S*, *n*_{1} *
*n*_{2} * ... * *n*_{k} =
*P*. If such integers exist, print them out. If no such
sequence of integers exist, then print "NO".

For example if *S*=11, *P*=48 and *k*=3 then 3, 4 and 4 is a solution.
On the other hand, if *S*=11, *P*=100 and
*k*=3, there is no solution
and you should print "NO".

Input format

A single line with three integers *S*, *P* and
*k*.

Output format

A single word "NO" or a seqence of *k* integers
*n*_{1}, *n*_{2},...,
*n*_{k} on a single line. (The
*n*_{i}'s must add up to *S* and their
product must be *P*).

Test data

You may assume that 1 ≤
*k* ≤ 4, 1 ≤ S ≤ 1000 and
1 ≤ P ≤ 1000.

Example

We now illustrate the input and output formats using some
examples.

Sample input 1:

11 48 3

Sample output 1:

3 4 4

Sample input 2:

11 100 3

Sample output 2:

NO