HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


51041 - Plane Segmentation

Volume problems

• 50900 - Put the Numbers in Descend...
• 50884 - Area and Perimeter Of The ...
• 51113 - The Menu
• 51111 - Even Numbers
• Cineplexx
• Cirku Belluci
• 51040 - Annual profit
• 51038 - Simple interest
• 51041 - Plane Segmentation
• 51039 - Automated billing system
• 50310 - Kinetic Energy
• 50314 - Falling Distance
• El Clasico
• 50481 - Car Parking
• 50480 - What quadrant is it?
• 50482 - Bank Charges
• 50430 - ATM

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
bfs.

Plane Segmentation

Question: 

The plane equation in three dimensional space can be defined as:

ax + by +cz + d=0

Where a, b and c are plane parameters and d is distance of plane from the origin.

A point lies on plane if  ax + by +cz + d=0

Write a program which counts how many of this points lie on the plane.

Input Specifications: In the first line you will be given 4 coefficients of the plane (a, b, c, d) than in the following three lines x, y, z coordinates of four points. where -20000<=a,b,c<=20000, -18000000<=d<=18000000, and -100<=x,y,z<=100 .

Output Specifications: Show how many points lie on the plane.

 

Sample Input I  
-4 2 3 -3
2 2 1
2 0 3
3 2 5
Sample Input II
2 2 2 -18
1 2 6
5 1 5
3 2 4
Sample Output I
0
Sample Output II
2

 

Sample Input II Explanation:

Based on plane equation we check if the points lie on plane or not.

Check Point 1

equation= ax + by +cz + d=1*2 + 2*2 + 2*6 + (-18)=2+4+12-18=0

Check Point 2

equation= ax + by +cz + d=2*5 + 2*1 + 2*5 + (-18)=10+2+5-18=4

Check Point 2

equation= ax + by +cz + d=2*3 + 2*2 + 2*4 + (-18)=6+4+8-18=0

Total number of points lying on plane is 2

 
 
Для отправки решений необходимо выполнить вход.

www.contester.ru