Given N, find all combinations of a and b such that a^3+b^3=N.
Solution:
http://ideone.com/yrbjz8
Solution:
http://ideone.com/yrbjz8
d[0] , d[1], d[2] , d[3] ,..,d[n]
. In each move you are allowed to increase any d[i] by 1 or 2 or 5 i:0 to n .What is the minimum number of moves required to transform the sequence to permutation of [1,2,3,..,n] if it's possible else return -1.
Constraint: 1<=n<=1000
Input: