Chef and pair
All submissions for this problem are available.
Chef's father gave him a integer N and asked him to count all such pair of x and y such that xy is equal to N i.e., x raised to the power y is equal to N. Chef also wants to calculate summation of (x+y) for all the pairs satisfying the above condition. Help Chef in solving this problem.Note: x and y are integers.
InputThe first line of input contains an integer T denoting the number of test cases.
Each line of the test case contains an integer N.
OutputOutput of each test case will contain two lines. First line will contain the count of such pair which chef wants and next line will contain the summation of (x+y) for all such pairs.
Constraints and Subtasks
Subtask 1: 5 points
Input: 2 5 8 Output: 1 6 2 14
Case #1: 5 can only be written as 51 and no other pair exist. So the count of pair will be 1 and summation will be 6. Case #2: 8 has two such pair 81 and 23 .
|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, SCALA, 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, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions