ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN109/111_2016_Questions > задача:


PE10. 51041 - Plane Segmentation

CEN109/111_2016_Questions

Старт: 07.дек.2016 в 12:37:00
Финиш: 07.дек.2016 в 13:42:00
Турнир завершён!
• Турнирная таблица

Задачи турнира

• 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

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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