How to write code in C language

CSDN Q & A 2022-01-15 02:50:52

llk Often with wy go together yh Small restaurants eat covered rice , One day after they ate llk Paid the money of the two people together , however wy Don't want to owe llk The money . Now? wy I have some loose money in my hand ,llk I also have some loose money in my hand ,wy I wonder if I can just make the two not owe each other , however wy Stupid , You can help wy Do you ?

Input
Multiple sets of test data , Enter... On the first line of each group 3 Nonnegative integers ,C,n,m.C representative wy Owe llk The money ,n representative wy The kind of face value of the money in hand ,m representative llk The kind of face value of the money in hand . Next n That's ok , Two numbers per line v, c, Represent the wy The face value is v My coins are c individual . And then the next m That's ok , Two numbers per line v,c, Represent the llk The face value is v My coins are c individual . (C <= 10000; 1<=n, m<50; 0<=v < =100; 0<=c<=10 )

Output
Output one row per group of data , If there is a scheme that makes wy and llk Two don't owe each other , Output YES, Otherwise output NO.

Sample Input
7 1 1
10 1
1 10
Sample Output
YES
HINT
wy Give it to llk a sheet 10 yuan ,llk I gave it to wy Three 1 yuan


thank
Similar articles

2022-01-15

2022-01-15

2022-01-15