Sum And Product#1567

Sum And Product

1 Sekunde
128 Megabyte
Sehr leicht

A list of non-negative numbers is called satisfactory if the sum of the numbers in the list is equal to and the product is equal to . Find a satisfactory list with the smallest possible number of elements.

Eingabe

Each line is a separate test case and contains two non-negative integers and (1 \leq s,\, p \leq 10^9).

Ausgabe

For each test case, output the smallest possible size of a satisfactory list in a separate line. If such a list does not exist, output -1. Note that the list may contain non-integer numbers.

Beispiele

Beispiel 1

Loading
Loading