All Tracks Math Problem

Jarvis and Numbers
Tag(s):

Very-Easy, Very-Easy

Problem
Editorial
Analytics

After defeating Mandarin in Iron man 3, Jarvis is most of time free and now he has started playing with numbers. Jarvis being an AI (Artificial Intelligence) solves almost all the riddle given by Tony Stark very quickly. This time Tony gave him a problem about base conversion’s but the problem statement given by Tony seems to be confusing and Jarvis asked for Help! Problem Statement – “123 when converted in base 16, it consist of two digits 7 and 11 so the sum of the numbers is 18,(For Given N) Find denominator of average(irreducible form) of sum of all the numbers formed on conversions from base 2 to N-1”.

Can you help Jarvis?

Input:

First line will have the number of test case (t) and then t subsequent lines will contain a number $$N$$.

Output:

For every test case, give answer in new line.

Constraints:
$$T < 10$$
$$3 <= N <= 1000$$

SAMPLE INPUT
2
5
7
SAMPLE OUTPUT
3
1
Explanation

1 st test case -> average on converting 5 to different bases is = 7/3 so answer to the problem is 3

2nd test case -> 3/1 so answer is 1

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++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

IIIT Jabalpur

Challenge Name

Beginner Practice Round 1.0

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications