Chef categorises an instagram account as spam, if, the following count of the account is more than 1010 times the count of followers.
Given the following and follower count of an account as XX and YY respectively, find whether it is a spam account.
Input Format
- The first line of input will contain a single integer TT, denoting the number of test cases.
- Each test case consists of two space-separated integers XX and YY — the following and follower count of an account, respectively.
Output Format
For each test case, output on a new line, YES, if the account is spam and NO otherwise.
You may print each character of the string in uppercase or lowercase. For example, the strings YES, yes, Yes and yES are identical.
Constraints
![[Solved] Instagram STARTERS 71 CodeChef [Solved] Instagram STARTERS 71 CodeChef](https://realcoder.techss24.com/wp-content/uploads/2022/12/image-1.png)
Sample 1:
Input
4 1 10 10 1 11 1 97 7
Output
NO NO YES YES
Explanation:
Test case 11: The following count is 11 while the follower count is 1010. Since the following count is not more than 1010 times the follower count, the account is not spam.
Test case 22: The following count is 1010 while the follower count is 11. Since the following count is not more than 1010 times the follower count, the account is not spam.
Test case 33: The following count is 1111 while the follower count is 11. Since the following count is more than 1010 times the follower count, the account is spam.
Test case 44: The following count is 9797 while the follower count is 77. Since the following count is more than 1010 times the follower count, the account is spam.
Solution
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
int x = sc.nextInt();
int y = sc.nextInt();
if(x>y*10){
//sauravhathi
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}Happy Learning – If you require any further information, feel free to contact me.
![[Solved] Instagram STARTERS 71 CodeChef [Solved] Instagram STARTERS 71 CodeChef](https://realcoder.techss24.com/wp-content/uploads/2022/12/Solved-Instagram-STARTERS-71-CodeChef.png)
![[Solved] Game of Love CodeCrush by NewtonSchool](https://realcoder.techss24.com/wp-content/uploads/2023/02/Solved-Game-of-Love-CodeCrush-by-NewtonSchool-300x169.png)
![[Solved] Given two strings S and T check how many minimum characters in S we should change such that T occurs as a substring in S[Solved] Given two strings S and T check how many minimum characters in S we should change such that T occurs as a substring in S](https://realcoder.techss24.com/wp-content/uploads/2022/12/Solved-Given-two-strings-S-and-T-check-how-many-minimum-characters-in-S-we-should-change-such-that-T-occurs-as-a-substring-in-S-300x197.png)
![[Solved] Geeta prefers to buy specific items, a 10 percent discount is provided if she buy more than 1200 of them](https://realcoder.techss24.com/wp-content/uploads/2022/09/Solved-Geeta-prefers-to-buy-specific-items-a-10-percent-discount-is-provided-if-she-buy-more-than-1200-of-them-300x200.png)