F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

平面上的整点

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 191    Accepted Submission(s): 12


Problem Description
  众所周知,在三维空间内,不共线的三个点可以确定一个平面,现在给出三个点的空间坐标[x1,y1,z1],[x2,y2,z2],[x3,y3,z3],请计算在这3个点确定的平面上坐标分量x, y, z分别在[lx, rx],[ly, ry],[lz,rz]内的整数点有多少个。
 

Input
多组测试数据,每组数据包括两行。
第一行是9个整数x1, y1, z1, x2, y2, z2, x3, y3, z3表示三个点的坐标。
第二行有6个整数lx, rx, ly, ry, lz, rz 表示x, y, z的范围。
所有输入数据范围为[-10000, 10000],且
lx<=rx
ly<=ry
lz<=rz
 

Output
  对每组测试数据输出一个整数,占一行,在指定定坐标范围内指定平面上有多少个整数点,若输入的三个点不能确定一个平面,直接输出"-1"。
 

Sample Input
0 0 0 0 1 0 0 0 1 -2 2 -2 2 -2 2 1 1 1 2 2 2 1 1 1 -1 1 -1 1 -1 1
 

Sample Output
25 -1
 

Hint

第二组Sample表示给定的3个点有重合点~
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-18 12:56:16, Gzip enabled