← Back to List

11006번: 남욱이의 닭장 ↗

Solutions

C++14
270 B | 270 chars
#include <iostream>
using namespace std;
int T,A,B;
int main()
{
	cin>>T;
	for(int x=0; x<T; x++)
	{
		cin>>A>>B;
		for(int y=0; y<=300; y++)
		{
			for(int x=0; x<=300; x++)
			{
				if(y+2*x==A&&y+x==B)
				{
					cout<<y<<" "<<x<<endl;
					break;
				}
			}
		}
	}
}