Minimize operations to convert (0, 0) to (N, M) by incrementing either or both by K
Given two integers N and M, the task is to calculate the minimum number of operations required to convert (0, 0) to (N, M) using the following operations: Choose any integer K and convert (x, y) to (x + K, y + K).Choose any integer K and convert (x, y) to (x - K, y + K) or (x + K, y - K). Examples: