# DCP-442: Want a Bride in This Winter Back to All Problems

Easy Math > Basic Math

So the winter is finally here. Last night I was scrolling Pacebook and I notice a very serious event named **Ei Shit e Bou Chai**. To show my solidarity I pressed the **Going** option. My father somehow noticed and commented on my response to that event. The response was like that, "If you are able to solve the following problem I will let you marry." > You need to tell me whether it is possible to have exactly K numbers between 1 > to N such that A<sup>2</sup> + A<sup>3</sup> will be a square number where 1<= A <= N. I tried whole night to figure out any clue about the problem but failed. That’s why I am now here to have your help. Could you help me finding it? Input: ------ Input starts with an integer **T** which is the test case. For each of the T lines, you will have two integers **N** and **K**. Constraints: --------------- 1<= **T** <= 10000<br> 1<= **N, K** <= 10^5 Output: ------- For each test case, you have to print **"I am married now"** without any quote if there are a total of **K** such **A** less than or equal to **N** such that each A’s summation of square and cube (i.e. **A<sup>2</sup> + A<sup>3</sup> where A<=N**) will be a square number. Otherwise, print **"Baba amar ki biye hobe na"** without any quote. Sample Input ------------ 2 3 1 3 2 Sample Output ------------- I am married now Baba amar ki biye hobe na Explanation ---------------- In the first test case, - Let, A = 1. So, A<sup>2</sup> + A<sup>3</sup> = 2 . 2 is not a square number. - Let, A = 2. So, A<sup>2</sup> + A<sup>3</sup> = 4 + 8 = 12. 12 is not a square number. - Let, A = 3. So, A<sup>2</sup> + A<sup>3</sup> = 9 + 27 = 36. 36 is a square number. Hence we have 1 square number for A = 3 which is equal to K = 1. But in the 2nd test case, we have K = 2.So it’s not possible to have K = 2.

### Problem Limits

 Language Time Limit (seconds) C 1.00 C++ 1.00 C++14 1.00 C# 2.00 Go 2.00 Java 2.00 JavaScript 2.00 Objective-C 2.00 Perl 2.00 PHP 2.00 Python 2.00 Python3 2.00 Ruby 2.00 VB.Net 2.00

# 149/513

Solve/Submission

### Ranking

# User Language Timing
01 Rajan_sust Cpp 0.00s
03 astinaam Cpp14 0.00s
04 SaikatS Cpp 0.00s
05 emrul Cpp 0.00s
06 FariD Cpp 0.00s
07 jalal C 0.00s
08 BishalG C 0.00s
10 Chayti_Saha98 Cpp14 0.01s
11 atiqurrahman Cpp 0.01s
12 Silent_Warrior Cpp 0.01s
13 souravahmed C 0.01s
14 orpib Cpp 0.01s
15 rohijulislam Cpp 0.01s
16 AlaminJust Cpp 0.01s
17 SakibAlamin Cpp14 0.01s
18 feodorv Cpp 0.01s
20 porag_ict Cpp14 0.01s
21 Durbin Cpp14 0.01s
22 tariqiitju Cpp 0.01s
23 ashraf_neo Cpp 0.01s
24 ehsan_sshuvo Cpp 0.01s
25 kissu_pari_na Cpp14 0.01s
26 shishir09 Cpp14 0.01s
27 Sakhawat_CoU Cpp14 0.01s
28 _GhOstMan_ Cpp 0.01s
29 Ishrak Cpp 0.01s
30 Riaz_BSMRSTU Cpp 0.01s
31 tlcakash Cpp 0.01s
32 acwatlerte Cpp 0.01s
33 duronto20 Cpp 0.01s
34 ssavi Cpp 0.01s
35 sifat_15 Cpp 0.01s
36 saiful130104 Cpp 0.01s
37 mbstu_nitai Cpp 0.01s
38 The_Viper Cpp 0.01s
39 Reayz Cpp 0.01s
40 shuvo_mbstu Cpp 0.01s
41 Not_Found0001 Cpp 0.01s
43 susmoys Cpp 0.01s
44 saifkhan007420 Cpp 0.01s