Number Theory Problem

Revision en1, by Omar_Morsi, 2017-11-21 00:42:59

Can you provide a Greedy solution for the following problem ?

Given N <= 1e18 , M <= 10,000

Provide an array D = [d1, d2, d3, ... , dk] , such that d1 * d2 * d3 * ... * dk = N, di <= M, k should be minimized, or print impossible.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Omar_Morsi 2017-11-21 00:42:59 260 Initial revision (published)