Couple-Bachelor-Spinster Numbers

Can any number be expressed as a subtraction of two squares? The numbers, which can be expressed in such a way, are called square-couple numbers. Your job is to find out a) If a number is square couple number. b) If the number is square couple then find that format. c) Find out how many square couple numbers are there within a certain range (including the terminal numbers). Input Each set of input is given in a single line. Each input set may contain one or two signed 32 bit integer numbers. Input is terminated by end of file. Output If there is only a single number N on a single line then print two non-negative integer numbers a and b, such that a2 − b2 = N. If the number cannot be expressed in such a format then print the line ‘Bachelor Number.’ on a single line if it is even or else print ’Spinster Number.’ on a single line if it is odd. Note that −231 ≤ N < 231. If there are two numbers n1 and n2 in the input then print how many bachelor numbers are in the interval [n1, n2]. Note that 0 ≤ n1 ≤ n2 and (n2−n1) ≤ 1, 000, 000. Sample Input 6 12 3 Sample Output Bachelor Number. 42 21