Get Subscription CodeChef Solution

Problem – Get Subscription CodeChef Solution

Chef wants to conduct a lecture for which he needs to set up an online meeting of exactly X minutes.

The meeting platform supports a meeting of maximum 30 minutes without subscription and a meeting of unlimited duration with subscription.

Determine whether Chef needs to take a subscription or not for setting up the meet.

Input Format

  • First line will contain T, the number of test cases. Then the test cases follow.
  • Each test case contains a single integer X – denoting the duration of the lecture.

Output Format

For each test case, print in a single line, YES if Chef needs to take the subscription, otherwise print NO.

You may print each character of the string in uppercase or lowercase (for example, the strings YESyEsyes, and yeS will all be treated as identical).

Constraints

  • 1 \leq T \leq 1001≤T≤100
  • 1 \leq X \leq 1001≤X≤100

Sample 1:

Input: 4
50
3
30
80
Output: YES
NO
NO
YES

Explanation:

Test Case 1: Without subscription, the platform allows only 30 minutes of duration. Since Chef needs to conduct a lecture of 50 minutes, he needs to buy the subscription.

Test Case 2: Without subscription, the platform allows 30 minutes of duration. Since Chef needs to conduct a lecture of 3 minutes only, he does not need to buy the subscription.

Test Case 3: Without subscription, the platform allows 30 minutes of duration. Since Chef needs to conduct a lecture of 30 minutes only, he does not need to buy the subscription.

Test Case 4: Without subscription, the platform allows only 30 minutes of duration. Since Chef needs to conduct a lecture of 80 minutes, he needs to buy the subscription.

Get Subscription CodeChef Solution in C++14

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;
	for(int i=0; i<t; i++){
	    int x;
	    cin>>x;
	    if(x<=30){
	        cout<<"no"<<" ";
	    }
	    else{
	        cout<<"yes"<<" ";
	    }
	}
	return 0;
}

Get Subscription CodeChef Solution in Java

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		
		for (int i = 1; i <= t; i++) {
		    int x = sc.nextInt();
		    
		    if(x > 30)
		    System.out.println("Yes");
		    else System.out.println("No");
		}
	}
}

Get Subscription CodeChef Solution in Python3

for i in range(int(input())):
    x=int(input())
    if(x>30):
        print("yes")
    else:
        print("no")
    
Get Subscription CodeChef Solution Review:

In our experience, we suggest you solve this Get Subscription CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

If you are stuck anywhere between any coding problem, just visit Queslers to get the Get Subscription CodeChef Solution

Find on CodeChef

Conclusion:

I hope this Get Subscription CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.