in the last contest i have participate there a problem called "Johny Likes Numbers" " 678A - Johny Likes Numbers " as i found the shortest c++ solution was using one line //////////////////////////
include
int main() { int n, k; scanf("%d %d",&n, &k); printf("%d\n",(n / k + 1) * k); } ///////////////////////// how i can found this short formula to solve mathematical problems i've tried on several problems that had mathematical formula and found it's very hard to get it done can anyone advice me to get more powerful in problems like this ?