2 Dimensional Fun
All submissions for this problem are available.
Given N points in a plane, how many squares can you make from these points?
The first line contains t, the number of test cases (about 10). Then t test cases follow.
Each test case has the following form:
- The first line contains an integer N, the number of points in the given set (4 ≤ N ≤ 555).
- Then N lines follow, each line contains two integers X, Y describing coordinates of a point (-55 ≤ X, Y ≤ 55).
For each test case, print in a single line the number of squares that have vertices belong to the given set.
Input: 1 6 0 0 0 1 1 0 1 1 0 2 -1 1 Output: 2
|Time Limit:||5 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, kotlin, PERL6, TEXT, CPP17, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.