Oreperations Research

아직 제출이 없습니다시간 제한7초메모리 제한1024 MB

문제

You run a massive mining facility that extracts ore from a mine and loads it onto long trains for shipment to factories around the nation. A train consists of nn cars, where car ii has capacity c_ic\_i, indicating how many tons of ore it can carry. Ore is dropped into the train cars at an overhead loading station from two separate queues of mine carts that run on either side the train. As with the train cars, mine carts hold varying loads of ore. Queue AA has rr carts, and cart A_iA\_i carries a load of a_ia\_i. Similarly, queue BB has ss carts, and cart B_iB\_i carries a load of b_ib\_i. Initially train car 11 is at the loading station, and carts A_1A\_1 and B_1B\_1 are available to dump ore into it. The train car currently in the station can be given the load from the front cart in the AA queue, the front cart in the BB queue, or from both. If a cart doesn't dump its ore, it remains at the loading station; if it does dump its ore, it cycles back into the mine, loads up on ore, and rejoins the end of its queue. Meanwhile, the next cart in the queue moves into place and is available to dump ore.  Carts may not drop partial loads of ore and may not leave the loading station until they've emptied.  Similarly train cars may not be over-filled and may not leave the loading station until they are filled to capacity.  As soon as a train car is filled to capacity it leaves the loading station and the next train car pulls in. Your task is to determine whether given sequences of mine carts can be used to fill a given sequence of train cars to their capacity.

Figure 1 shows an example of the process.  Here queue AA has three mine carts carrying loads 44, 33 and 22, queue BB has four mine carts carrying loads 11, 55, 22 and 22, and the train has three cars with capacities 88, 55 and 44.  The starting setup is shown in the leftmost image.  After (say) the first car in queue AA dumps its load into the first train car it goes back to the mine and (eventually) returns to the end of the line in queue AA.  This situation is shown in the second image, where  the first train car still has capacity 44 to be filled.  This can be accomplished by dumping ore from the front car of both queues AA and BB. Once filled, the first train car moves out of the loading station leaving an alignment of cars and carts shown in the third image.  Here, the only way to fill the train car is for the front car of queue BB to dump its load.  This leads to the final image.  Here the last train car can be filled either by the front cars of both queues or the first two cars of queue BB.  Note that if the third train car had capacity 33 it could not be filled to full capacity.

Figure 1: Sample Input 11

입력

Input begins with a line containing three positive integers rr ss nn (r,s50,n100)r,s \leq 50, n \leq 100) indicating the number of carts in queues AA and BB and the number of train cars, respectively. This is followed by three lines containing the values a_1,a_2,,a_ra\_1, a\_2, \ldots, a\_r, b_1,b_2,,b_sb\_1, b\_2, \ldots, b\_s, and c_1,c_2,,c_nc\_1, c\_2, \ldots, c\_n, the capacities of the AA carts, the BB carts and the train cars, respectively.  The maximum capacity of any cart is 200200 and the maximum capacity of any train car is 2,000,0002\\,000\\,000.

출력

Output Yes or No indicating whether all of the train cars can be filled to capacity.