[CSP-S Simulation Test]: Long Sky (analog)

Title Description

Osiris the Sky Dragon is like the color, one day he found three colors - red, yellow, blue.
Osiris has red $ a $, $ b $ yellow, $ c $ blue, he wanted to use to draw the best picture, but need at least $ x $ red, $ y $ and $ z $ yellow blue, it seems that is not enough. Do not worry, Osiris will be magic! He can put any two of the same color into a another color! Will he ever finish it?


Input Format

The first line of a positive integer $ t $ denotes the number of data sets.
The next six integer $ t $ row each row represent $ a, b, c, x , y, z $.


Output Format

Each data output line, if the outputs can $ "YES" $, otherwise, outputs $ "NO" $.


Sample

Sample input:

3
4 4 0 2 1 2
5 6 1 2 7 2
3 3 3 2 2 2

Sample output:

YES
of NO
YES


Data range and tips

For $ 100 \% $ data $ t \ leqslant 100,0 \ leqslant a, b, c, x, y, z \ leqslant 1,000,000 $.


answer

Large simulation must be able to look out of, daring, playing right.

For this question, we need to pay attention to is the same color (in fact, it's even easier).

It is really a simple question to get shot dead, so relaxed state of mind, but do not take it lightly.

For example the following three (names not be published):

$\alpha:$

$\beta:$

$\gamma:$

Simple question must pay attention to pay attention to pay attention again! ! !

Time complexity: $ \ Theta (T) $.

Expectations score: $ 100 $ points.

Actual score: $ 100 $ points.


Code time

#include<bits/stdc++.h>
using namespace std;
int a,b,c,x,y,z;
int sum;
int main()
{
	int T;scanf("%d",&T);
	while(T--)
	{
		scanf("%d%d%d%d%d%d",&a,&b,&c,&x,&y,&z);
		sum=0;a-=x;b-=y;c-=z;
		a>0?sum+=a>>1:sum+=a;
		b>0?sum+=b>>1:sum+=b;
		c>0?sum+=c>>1:sum+=c;
		sum<0?puts("NO"):puts("YES");
	}
	return 0;
}

rp ++

Guess you like

Origin www.cnblogs.com/wzc521/p/11619519.html