Starting Point
Submissions: 428   Accuracy:

53.72%

  Difficulty: Basic   Marks: 1

You are a traveller, lost in a jungle.But you have the Map with you.And you remember the route you travelled so you will backtrack and reach the Starting point. Your task is to print the starting point.

Input:
First line consists of T test cases. Each test cases consists of 3 lines.
First line of each test case consist of two integers X,Y denoting of Your Current location.
Second line of each test case consist of an integer N denoting of number of paths you travelled.
Third line of each test case consist of 2*N spaced integers Xi,Yj denoting the points at the paths you travelled.

Output:
Print the Starting point in respective line.

Constraints:
1<=T<=20
1<=N<=20
1<=X,Y<=10

Example:
Input:

1
1 1
2
1 0 0 1

Output:
0 0

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.