Monthly Budget CodeChef Solution

Problem – Monthly Budget CodeChef Solution

Akshat has X rupees to spend in the current month. His daily expenditure is Y rupees, i.e., he spends Y rupees each day.

Given that the current month has 30 days, find out if Akshat has enough money to meet his daily expenditures for this month.

Input Format

  • The first line will contain T – the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains two integers XY – the amount of money Akshat has for the current month and his daily expenditure respectively.

Output Format

For each test case, output YES if Akshat has enough money to meet his daily expenditure for 3030 days of the month, otherwise output NO.

You may print each character of YES and NO in uppercase or lowercase (for example, yesyEsYes will be considered identical).

Constraints

  • 1≤T≤100
  • 1≤X,Y≤10^5

Sample 1:

Input: 3
1000 10
250 50
1500 50
Output: YES
NO
YES

Explanation:

Test Case 1: Akshat has 1000 rupees and he wants to spend 30×10=300 rupees in the entire month. Therefore, he has enough money for the entire month.

Test Case 2: Akshat has 250 rupees and he wants to spend 30×50=1500 rupees in the entire month. Therefore, he does not have enough money for the entire month.

Test Case 3: Akshat has 1500 rupees and he wants to spend 30×50=1500 rupees in the entire month. Therefore, he has enough money for the entire month.

Monthly Budget 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=0;i<t;i++){
		    int x = sc.nextInt();
		    int y = sc.nextInt();
		    int z = y*30;
		    if(x>=z){
		        System.out.println("yes");
		    }else{
		        System.out.println("no");
		    }
		}
	}
}

Monthly Budget CodeChef Solution in C++17

#include <iostream>
using namespace std;

int main() {
	int t;
	std::cin >> t;
	while(t>0){
	    int a,b;
	    std::cin >> a>>b;
	    if((b*30)<=a){
	        std::cout << "YES" << std::endl;
	    }
	    else{
	        std::cout << "NO" << std::endl;
	    }
	    t--;
	}
	return 0;
}

Monthly Budget CodeChef Solution in Pyth 3

a=int(input())
for i in range(a):
    b,c=list(map(int,input().split()))
    k=c*30
    if(k<=b):
        print("YES")
    else:
        print("NO")
    

Monthly Budget CodeChef Solution Review:

In our experience, we suggest you solve this Monthly Budget 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 Monthly Budget CodeChef Solution

Find on CodeChef

Conclusion:

I hope this Monthly Budget 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. Required fields are marked *