Under construction

Still being built. Things may change

Malatang Tanghulu

Time limit1sMemory limit1024 MB

Summary
Given skewers with strawberry and grape counts and fixed insert amounts P and Q, decide whether every skewer can be balanced and print the insert counts.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

그럼 제가 선배 맘에

<서이브/남동현, 마라탕후루, 2024>

Chito, the mascot of Ajou University, opened a Malatang Tanghulu shop by combining malatang and tanghulu, two snacks that are trending these days. But on the first day, a wrong order left boxes of strawberries and Shine Muscat grapes piled up. Fresh fruit spoils quickly, so today Chito decided to give the tanghulu away free to customers.

Chito made NN tanghulu skewers in advance. While busy, Chito stuck fruit onto the skewers as it came to hand, and only later realized that the number of strawberries and Shine Muscat grapes on each skewer could differ. To keep the flavor balanced, each skewer must have the same number of strawberries as Shine Muscat grapes. However, different skewers do not need to match each other. Chito was too busy running the shop, so Chito hired a robot to make the counts equal.

Skewer ii currently has AiA_{i} strawberries and BiB_{i} Shine Muscat grapes. The robot has one problem: every time, it inserts a fixed number of fruits. Each minute, the robot performs the following action once.

  • Choose skewer ii. (1≤i≤N)(1\leq i \leq N)
  • Insert PP strawberries and QQ Shine Muscat grapes into skewer ii.

Chito thought it over and realized that the robot might not be able to make the counts equal on every skewer.

Check whether the robot can make the strawberry and Shine Muscat counts equal on every skewer.

Input

The first line contains the number of skewers NN, the number of strawberries PP the robot inserts each minute, and the number of Shine Muscat grapes QQ it inserts each minute, separated by spaces. (1≤N,P,Q≤100)(1\leq N, P, Q \leq 100)

The second line contains the number of strawberries on each skewer A1,A2,…,ANA_{1}, A_{2}, \ldots, A_{N}, separated by spaces. (1≤Ai≤100)(1\leq A_{i} \leq 100)

The third line contains the number of Shine Muscat grapes on each skewer B1,B2,…,BNB_{1}, B_{2}, \ldots, B_{N}, separated by spaces. (1≤Bi≤100)(1\leq B_{i} \leq 100)

All numbers in the input are integers.

Output

On the first line, print YES if the robot can make the strawberry and Shine Muscat counts equal on every skewer, and NO otherwise.

If the robot can do so, print on the second line the number of times the robot inserted strawberries and Shine Muscat grapes into each skewer, separated by spaces. If there are several possible answers, print any one of them.

Since the supply of strawberries and Shine Muscat grapes is not unlimited, the number of times the robot performs the action of inserting PP strawberries and QQ Shine Muscat grapes must each be within 10,000.

Examples3

  1. Example 1

    Input
    3 2 1
    3 5 7
    5 6 7
    
    Expected output
    YES
    2 1 0
    
  2. Example 2

    Input
    3 2 1
    3 5 7
    6 5 4
    
    Expected output
    NO
    
  3. Example 3

    Input
    1 100 50
    45
    45
    
    Expected output
    YES
    0