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

Сборники > Beginners > задача:


51041 - Plane Segmentation

Задачи сборника

• 50895 - Hours Minutes and Seconds
• 50902 - Translate Score into Grade
• 50890 - Convert Celsius to Fahrenheit
• 50889 - Convert to Minutes and Sec...
• 50900 - Put the Numbers in Descend...
• 50884 - Area and Perimeter Of The ...
• 51040 - Annual profit
• 51038 - Simple interest
• 51041 - Plane Segmentation
• 51039 - Automated billing system
• El Clasico
• 51007 - Function f(x)
• 50481 - Car Parking
• 50480 - What quadrant is it?
• 50482 - Bank Charges
• 50430 - ATM
• 51029 - Buy Three Items

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

Если у вас есть предложения или пожелания по работе 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