NC222460. [USACOJan2020P]FallingPortals
描述
输入描述
The first line of input contains a single integer N.
The next line contains N space-separated integers A1,A2,…,AN.
The next line contains N space-separated integers Q1,Q2,…,QN.
输出描述
Print N lines, the i-th of which contains the journey length for cow i.
示例1
输入:
4 3 5 10 2 3 3 2 1
输出:
7/2 7/2 5/1 -1
说明:
Consider the answer for the cow originally on world 2. At time 2 worlds 1 and 2 align, so the cow can travel to world 1. At time worlds 1 and 3 align, so the cow can travel to world 3.