HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN109/111_2016_Questions > problem:


PE10. 51041 - Plane Segmentation

CEN109/111_2016_Questions

Start: Dec.07.2016 at 12:37:00 PM
Finish: Dec.07.2016 at 01:42:00 PM
The contest is finished!
• Contest scoreboard

Contest problems

• PE02. 51028 - Isosceles Triangles
• PE03. 51029 - Buy Three Items
• PE04. 51030 - Number of Right Tria...
• PE05. 51031 - Convert from Hex to...
• PE06. 51032 - Triangle Property
• PE07. 51033 - Sum of the series
• PE08. 51034 - Area of 3 Shapes
• PE09. 51040 - Annual profit
• PE10. 51041 - Plane Segmentation
• PE11. 51038 - Simple interest
• PE12. 51039 - Automated billing system
• RE1. 51077 - Grades Histogram
• RE2. 51078 - Max trade
• hw3. 51057 - Number of students
• hw4. 51058 - Third grade students
• hw5. 51059 - Football teams
• hw6. 51060 - Public Transportation

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