问题4228--Problem F

4228: Problem F

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 128 MB

题目描述

You have been approached by a leading toy manufacturer to automate the process of toy acceptance and rejection after production. The toys are measured by laser and you are given these measurements and the criteria to which they must comply.

输入

For each toy, 3 measurements are given in millimeters (mm) followed by a tolerance, also in millimeters. Each measurement must be within the specified tolerance of every other measurement. A tolerance of 0 requires all measurements to be exactly the same. A first measurement of −1 signals the end of input.

输出

All you need to do is output 0 if the toy is rejected and 1 if it has been accepted. A toy is rejected if at least one of the measurement pairs falls outside the specified tolerance zone.

样例输入 Copy

5 9 20 2
5 5 5 0
-1

样例输出 Copy

0
1

来源/分类