CHEFONDATE-Editorial

PROBLEM LINK:

Contest
Practice

Setter: Daanish Mahajan
Tester: Abhinav Sharma, Manan Grover
Editorialist: Kiran

DIFFICULTY:

294

PREREQUISITES:

None

PROBLEM:

Chef and his girlfriend is on a date. Chef has X dollars and the bill amount is of Y dollars. The objective is to find out if Chef has enough money to pay the bill

EXPLANATION:

  • The objective of this problem is to input two distinct values, compare its values.

  • We input two distinct values to two variables X & Y (representing the money Chef has and the bill amount respectively).

  • Solution:

  1. If X>Y, Chef has enough money to pay the bill -Print "Yes"

  2. If X<Y, Chef has to borrow from his girlfriend -Print "No"

TIME COMPLEXITY:

O(1)

SOLUTION:

Editorialist's Solution
	int t;
	cin>>t;
	
for(int i=0;i<t;i++)
{
    int x,y;
    cin>>x>>y;
    if(y>x)
    cout<<"No"<<"\n";
    else
    cout<<"Yes"<<"\n";
}