All Tracks Math Number Theory Problem

Lazy-Active vs Strict
Tag(s):

Medium, maths, prime factorization, sieve

Problem
Editorial
Analytics

Mike is a Lazy guy.He sleeps in lectures.Today the professor saw him sleeping. So he gave him an assignment.

As the prof. is a Strict guy ,he announced that he will deduct 10 marks if he fails to submit the assignment in the next lecture.

Given a number X ,He needs to find the probability that any divisor ( proper ) of X is a perfect square and a even number also.

NOTE :- Output of probability must be in N/D format ,where N and D are positive coprime numbers.

but if numerator is 0 then simply print 0.

Mike seeks for help from an Active guy who pays attention in the lecture.So now it's lazy and active vs Strict.

Can you help mike.

INPUT

  • First line of input contains an integer T denoting the test cases.
  • Following T lines, each line contains an integer X.

OUTPUT

  • output contains T lines . each line contains the answer in described format.

CONSTRAINTS

  • 1<=T<=40000
  • 1<=x<=1000000
SAMPLE INPUT
2
2
900
SAMPLE OUTPUT
0
3/26
Explanation

In first test case for 2 - {1} is only proper divisor so it's answer is 0.

In second test case 900 , there are 26 proper divisors but only 3 are perfect square and even {4,36,100} so answer is 3/26

Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: C, C++, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Scala 2.11.8, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Malaviya National Institute of Technology

Challenge Name

MNIT-Codes Episode-01

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications