Short IIProblem code: SHORT2 |
All submissions for this problem are available.
Given a prime number p, find the number of pairs of integers (a, b) such that p < a, p < b and ab is divisible by (a-p)(b-p).
Input
The first line contains the number of test cases t (1 ? t ? 5). Then t test cases follow, each test case consists of a line containing one prime integer p (1 < p < 1012).
Output
For each test case output one line containing the required number. It's guaranteed that this number won't exceed 263-1.
Example
Input: 3 2 23 59 Output: 14 80 116 Explanation:
In the first test case the sought pairs are (3,3), (3,4), (3,5), (3,8), (4,3), (4,4), (4,6), (5,3), (5,12), (6,4), (6,8), (8,3), (8,6) and (12,5).
| Author: | gennady.korotkevich |
| Date Added: | 30-09-2011 |
| Time Limit: | 3 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

How is a=3, b=4 satisfying
hey rohit , its not
ohh..thanks!
What's the constraint for a,b
@adu101992: As there's no
k thanks :)
How cum anything divided by
@chandu_333 The prime number
@phantom11 thank u
Does JS mean Javascript ?
Are negative integers