Skills Training 1

Daniel loves squares!

Everything in Daniel’s life is a square, even the many houses he owns, and range of his wifi connection!

Given \(N\) houses, each with a location \(X\)i, \(Y\)i on a zero-indexed \(X\) by \(Y\) grid, with a wifi square range with a length of \(L\) (\(X\)i, \(Y\)i in the center, and always odd), and with a strength of \(S\), find the house with Daniel can sit in with the greatest overlapping wifi connection. There will always only be one answer.


Input Specification:

The first line will contain \(N\), \(X\) and \(Y\)

The next \(N\) lines will contain \(X\)i, \(Y\)i, \(L\) and \(S\)


TIME CONSTRAINT: 0.5s

Sample Input:

3 5 5
1 1 3 1
4 3 5 2
2 1 1 1

Sample Output:

2 1

Diagram: https://docs.google.com/drawings/d/1fzO305NPFY5V-O2NE_FpPtbxL7hf791NmzlpmvzTlQo

Submit Solution

Problem author: Vincent