All problems

The Better of Two Estimates

mediumPythonNumPyElement-wise

Riverbend Supply runs two staffing models over the same week. One is tuned to footfall, the other to last year's sales, and they disagree from day to day. Being short-staffed costs the shop far more than being over-staffed, so the roster takes whichever model asks for more people — and it makes that choice afresh every day, rather than picking one model for the whole week. The roster can therefore follow one model on Monday and the other on Tuesday.

Task: Print the staffing figure the roster will use on each day.

Input

Three lines. The first holds a single integer n, the number of days. The second holds the first model's n figures on one line, separated by single spaces. The third holds the second model's n figures, in the same day order.

Output

One line holding n whole numbers, in day order, separated by single spaces, with no decimal point. On a day where the two models agree, that shared figure is used.

Example:

Input:
3
10 25 30
15 20 33

Output:
15 25 33

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…