BOMBER1 - Saving Planet Bomber (Easy)
You are requested to donate your two cents to help us build a better nation: https://donate.aamaadmiparty.org/
Jay and Nemo are galactic wanderers. While travelling around in Bomber Nebula, they decided to spend some time in the famous Bingeling Empire. To manage their expenses, they took up an internship under Dr.Ein, the scientist assisting the Bomberman.
Unfortunately at the same time, Fiendish Bombers penetrated the defenses of the planet Bomber and have swarmed the entire empire. Consider the empire as NxNxN maze with each cell occupied by the enemy. You can also view it as a huge cube with side N.
The task of Jay and Nemo is now to guide the Bomberman to plant the bombs and destroy enemies. Because one of Dr. Ein's new invention, the Fire ability of the Bomberman’s bomb is infinite. That is, if it explodes at (x,y,z) it will destroy enemies in all the cells (*,y,z) , (x,*,z) and (x,y,*). Since most of the resources of the empire are captured, they are left with only M bombs. Although being good computer scientists, they are exceptionally poor at visualising things in 3 dimensions. So they ask you, <insert your name here> the greatest programmer ever to roam on Earth: Is is possible to defeat the invaders?
The first line contains T, the number of test cases. Each of the next T lines contains 2 space separated integers N and M, denoting the size of the maze and the count of available bombs respectively.
"POSSIBLE" or "IMPOSSIBLE" depending upon each test case.
1 <= T <= 10^6
1 <= N <= 10^7
0 <= M <= 10^16
Warning: Large I/O. Tested for most languages, but let me know if you are getting TLE.
Just a little question: