Horje
Integer Moves codeforces solution Code Example
Integer Moves codeforces solution
#include<iostream>
#include<cmath>
using namespace std;

void solve()
{
	int x, y;
	double ans;
	cin >> x >> y;
	ans = sqrt(pow(0 - x, 2) + pow(0 - y, 2));
	if (x == 0 && y == 0)
		cout << 0 << "\n";
	else if (ans == (int)ans)
		cout << 1 << "\n";
	else
		cout << 2 << "\n";
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}




Cpp

Related
three way comparison operator c++ Code Example three way comparison operator c++ Code Example
prevent getting data from data-tooltip-content tippyjs Code Example prevent getting data from data-tooltip-content tippyjs Code Example
one dimensiol array to two dimen c++ Code Example one dimensiol array to two dimen c++ Code Example
find maximum sum in array of contiguous subarrays Code Example find maximum sum in array of contiguous subarrays Code Example
char to int in c++ Code Example char to int in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11