• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

One of the services that a reliable network provides is Jitter Minimization. Let me explain some more. In network communication, one node is sender and the other one is receiver. Also data is carried in units called packets. So, sender sends (data) packets to receiver.

Jitter Minimization: This service guarantees that the amount of time between the transmission of two successive packets at the sender is equal to the amount of time between their receipt at the destination.

Karen is a network administrator at Computer Science and Engineering Faculty in SBU. She wants to verify whether the network is reliable enough for Newbies2018 or not. So she sent NN packets from one node to another one, and wrote down the transmission and receive time for each packet on a single piece of paper. But, she forgot to write whether each entry was transmission time or receive time!!

Time to help, you are given a list of transmission and receive time of NN packets. Calculate how long did it take for each packet to reach the receiver (from sender), or state that the network isn’t reliable.

ورودی

The input file contains multiple test cases. (Number of tests doesn’t exceed 100100)

For each test case, first line contains a single integer NN – The number of packets. 1N6001 \leq N \leq 600

The second line consists of 2N2N distinct integers tit_i – the entries on Karen’s paper 0ti1090 \leq t_i \leq 10^9

The input terminates with the N=0N = 0, this case should not be processed.

خروجی

For each test case print the minimum possible time between send and receive of packets, or print Unreliable Network in a single line.

مثال‌ها

ورودی نمونه ۱

3
1 3 5 6 4 7
2
1 3 4 6
3
1 2 3 4 12 15
0
Plain text

خروجی نمونه ۱

2
2
Unreliable Network
Plain text

In the first test case:

  • Packet 11 is sent at t=1,t = 1, and is received at t=3t = 3 \to Time between send and receive =2= 2
  • Packet 22 is sent at t=4,t = 4, and is received at t=6t = 6 \to Time between send and receive =2= 2
  • Packet 33 is sent at t=5,t = 5, and is received at t=7t = 7 \to Time between send and receive =2= 2

All transmission times are equal to 2,2, so network is reliable.


ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.