SOLVE

LATER

Prime

Problem

Editorial

Analytics

Tecnoesis, the techical festival of NIT Silchar is coming and thus Arun,Takle and Handi the core-cordinator of departmental team of CSE, decided to conduct a game. In this game, the participant will be given a whole number N and will be asked questions.

q = the sum of prime divisors of N.

p = the sum of numbers of numbers that are coprime and less than or equal to prime divisors of N .

s= the number of prime divisors of N

Constraints:

1<=T<=10^6

0<=N<=10^6

0<=K<=10^6

As it will be very difficult for Arun,Takle and Handi to tell manually whether the answer given by participant is

correct or not. So, they decided to write a code for it. As Arun is very busy in Tecnoesis preparations and Handi

is busy with his GirlFriend, they have given this task to you.

The first line of the input will consist of a single integer T. The next T lines contains 2 integers N and K, denoting the numbers.

OUTPUT

For each test case output a single integer (one per line) M i.e. (N+K+q-p-s).

Input:

2

24 2

8 2

Output:

26

10

Problem Setter : Avinash Gurjar

Explanation

In sample :

Divisors for 24 = {1,2,3,4,6,8,12,24}

prime divisors are ={2,3}

q=2+3=5;

k1=number of numbers that are coprime to prime divisor 2 and less than or equal to 2 = 1

k2=number of numbers that are coprime to prime divisor 3 and less than or equal to 3 = 2

p=k1+k2;

p=1+2=3;

number of prime divisors of 24=2 i.e 2 and 3

s=2;

required solution = N+K+q-p-s=24+2+5-2-3=26

Time Limit:
5.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,
Swift-4.1,
Visual Basic

Initializing Code Editor...

{"45d0b65": "/pagelets/show-submission/algorithm/prime-5/", "f25d4e5": "/pagelets/problems-hint/algorithm/prime-5/", "0e0af96": "/pagelets/suggested-problems/algorithm/prime-5/", "5175750": "/pagelets/problem-author-tester/algorithm/prime-5/", "5b84eb8": "/pagelets/recommended-problems/algorithm/prime-5/"}

realtime.hackerearth.com

80

f819243b9219a807afee7ab7db20f13843ec605d

58a29e5cae2309f04b28

/realtime/pusher/auth/