Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
You are given 33 numbers A, B,A,B, and CC.
Determine whether the average of AA and BB is strictly greater than CC or not?
NOTE: Average of AA and BB is defined as \frac{(A+B)}{2}2(A+B). For example, average of 55 and 99 is 77, average of 55 and 88 is 6.56.5.
For each test case, output YES
if average of AA and BB is strictly greater than CC, NO
otherwise.
You may print each character of the string in uppercase or lowercase (for example, the strings YeS
, yEs
, yes
and YES
will all be treated as identical).
Input: 5
5 9 6
5 8 6
5 7 6
4 9 8
3 7 2
Output: YES
YES
NO
NO
YES
Test case 11: The average value of 55 and 99 is 77 which is strictly greater than 66.
Test case 22: The average value of 55 and 88 is 6.56.5 which is strictly greater than 66.
Test case 33: The average value of 55 and 77 is 66 which is not strictly greater than 66.
Test case 44: The average value of 44 and 99 is 6.56.5 which is not strictly greater than 88.
Test case 55: The average value of 33 and 77 is 55 which is strictly greater than 22.
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner my = new Scanner(System.in);
int cases = my.nextInt();
int a,b,c;
double ave;
for(int i =0;i<cases; i++)
{
a = my.nextInt();
b = my.nextInt();
c = my.nextInt();
ave = (a+b)/2.0;
if(ave>c)
System.out.println("YES");
else
System.out.println("NO");
}
}
}
# cook your dish here
for i in range(int(input())):
a,b,c=map(int,input().split())
if(((a+b)/2)>c):
print('YES')
else:
print('NO')
#include <bits/stdc++.h>
using namespace std;
void fun(){
float A,B,C;
cin>>A>>B>>C;
if((A+B)/2>C)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
signed main() {
int T;
cin>>T;
while(T--){
fun();
}
}
In our experience, we suggest you solve this Greater Average 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 Greater Average CodeChef Solution
I hope this Greater Average 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 >>