link: http://opc.iarcs.org.in/index.php/problems/FINDNUMS My approach was to factorize 'P' and as it is small to brute force over all combinations of divisors. For example for S=11, P=48 and k=3 (Shown example) I would check (1,1,48),(1,2,24),(1,3,16) and so on till i reached (3,4,4) which was the answer. Could someone suggest some method to enumerate all the sets of the divisors of the number? Any other solution too would be of great help. asked 08 Jan '15, 21:02 ![]()
|
Simple brute force works: http://pastebin.com/M4CPvVZ6 Note: don't worry if you get wrong answer when submitting on the server, the test data is wrong. answered 09 Jan '15, 17:42 ![]()
|