시간복잡도: O(1)
// you can use includes, for example:
// #include <algorithm>
#include <cmath>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
int solution(int X, int Y, int D) {
// write your code in C++14 (g++ 6.2.0)
return ceil((double)(Y-X) / D);
}
그냥 수식을 활용해서 푸는 문제였다.