Valid Expression Codechef Starters 78 (Rated till 6 stars) problem solution
This post is all about the solution of the Valid Expression Codechef Starters 78 (Rated till 6 stars) problem solution.
Problem Statement:
The proper order for assessing an expression is multiplication, addition, and subtraction. Consider the expression You are given integers N and X. Your task is to create a string S of length N that contains only such that when these N operators are placed in order between (N+1) ones, the result of the expression is X.
If there are multiple such strings, print any one of them. If such a string does not exist, print 1.
Format of Input :
The number of cases will be indicated by a single integer TT in the first line of input.
Each test case's first and only line includes 2 space-separated integers NN and MM — the number of apples and oranges, respectively.
Format of the Output :
For every test case, output YES if the group is perfect and NO or else on a new line.
Each character can be printed in either uppercase or lowercase. The strings YES, yes, Yes, and yES, for example, are all considered identical.
0 Comments