Forgot Password ?
New password will be sent to following email id
Problem Code : VTEDDY
2 6 13
Time Limit :
C , C++ , Java , Python 2
Login to submit your response.
<b>Teddy Bears, whether old or new<br> They're cute and cuddly, pink or blue<br> On Teddy Bear Day, I wanna tell you<br> No one is as adorable as you</b> <br><br> After reading the above lines a coder from the first year decided to gift a teddy to his girlfriend. He went to a teddy shop on Teddy day where there were <b>N-1</b> teddies each having a number from <b>2</b> to <b>N</b>. After going there he saw that all teddies were alive and trying to kill each other, then he noticed that teddy with number <b>X</b> are killing the teddies with number <b>2X,3X,4X,5X.....</b>After some time the killing stopped and some teddies didn't get killed.<br> After seeing the special alive teddies he thought of buying all of them but he didn't have enough money, so he decided to buy only those teddies who are alive and whose numbers are <b>palindromic</b> like 222, 121, 131. Being his batchmate you have to tell him how many teddies he can buy. <br> <img src="https://s10.postimg.org/3kdnd5yt5/teddy.png">
First line consists of <b>T</b> denoting number of test cases. <br> Each test case consists of a single integer denoting <b>N</b> denoting <b>n-1</b> teddies teddies having a number from <b>2</b> to <b>N</b>. <br>
Print number of teddies he can buy.
In the first case, the coder will buy 3 teddies having number 2,3 and 5.