Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 9.00

different groups for projects.

There are N students in a class.The students of a class are to be divided into different groups for projects. Each group can have only 2 students. The class teacher comes up with a brilliant idea of making the groups according to roll numbers such that the prime factorization of roll number X and roll number Y have some factors in common. The product of the common factors of X and Y is M. A single roll number can be selected in multiple groups. A roll number can be selected with itself also meaning (X,X) is a valid group. A group (X,Y) is formed iff X>=Y. Help the teacher in estimating how many groups are formed.

 

Input

  • The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
  • The first line of each test case contains two integers N and M as described above.

Output

  • For each test case, output a single line containing the number of groups as described above.

Constraints

  • 1 = T = 100
  • 1 = N,M = 1000000

Example

Input: 3 10 2 40 4 20 3 Output: 10 32 12 Explanation Case 1 : The pairs having 2 as common factor are (4,2),

Answers

(5)
Status NEW Posted 17 Sep 2017 12:09 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)