Biladerim Icin

All submissions for this problem are available.
### Read problem statements in [Hindi](http://www.codechef.com/download/translated/SEPT19/hindi/LAPD.pdf), [Bengali](http://www.codechef.com/download/translated/SEPT19/bengali/LAPD.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/SEPT19/mandarin/LAPD.pdf), [Vietnamese](http://www.codechef.com/download/translated/SEPT19/vietnamese/LAPD.pdf) as well. Ben Fero is a popular guy who likes inventing and solving interesting problems. Last weekend, he found a challenging problem, but he could not solve it on his own, so he decided to ask you for help. Can you help Ben Fero solve this problem? You are given three integers $A$, $B$ and $C$. Let's call a triple of integers $(a, b, c)$ *interesting* if it satisfies the following criteria:  $1 \le a \le A$, $1 \le b \le B$ and $1 \le c \le C$  for any two real numbers $x$ and $y$ such that $x \neq 0$ and $y \neq 0$, $ax^2 + 2bxy + cy^2 \gt x^2 + y^2$ holds You should find the number of interesting triples. Since this number could be very large, compute it modulo $10^9+7$. ### Input  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first and only line of each test case contains three spaceseparated integers $A$, $B$ and $C$. ### Output For each test case, print a single line containing one integer ― the number of interesting triples modulo $10^9+7$. ### Constraints  $1 \le T \le 10$  $1 \le A, C \le 10^9$  $1 \le B \le 5,000$ ### Subtasks **Subtask #1 (30 points):** $1 \le A, B, C \le 100$ **Subtask #2 (20 points):** $1 \le A, B, C \le 5,000$ **Subtask #3 (50 points):** original constraints ### Example Input ``` 2 2 5 3 3 2 4 ``` ### Example Output ``` 1 6 ``` ### Explanation **Example case 1:** There is only one interesting triple: $(2, 1, 3)$. **Example case 2:** The interesting triples are $(2, 1, 3)$, $(2, 1, 4)$, $(3, 1, 2)$, $(3, 1, 3)$, $(3, 1, 4)$ and $(3, 2, 4)$.Author:  mrkerim 
Editorial  https://discuss.codechef.com/problems/LAPD 
Tags  anand20, determinant, math, mrkerim, polynomial, sept19, sept19a, sylvesters 
Date Added:  5062019 
Time Limit:  1 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, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 