Artifact Content
Not logged in

Artifact 28d343930b8a6ef80ed1c2b45c80d2c5d01ab912


struct ProductOfDigits
{
	int smallestNumber( int N )
	{
		if( N < 10 )
			return 1;
		int ans = 0;
		for(int d=9; d>=2; --d)
			while( N%d == 0 )
				N/=d, ans++;
		return N==1 ? ans : -1;
	}
};