Codeforces Round #291 (Div. 2)--b<set>--han Solo and Lazer Gun

Source: Internet
Author: User

There is n Imperial Stormtroopers on the field. The battle field is a plane with Cartesian coordinate system. Each stormtrooper are associated with the coordinates (x, y) on the this plane.

Han Solo has the newest duplex lazer gun to fight these stormtroopers. It is situated at the point (x0, y0). In one shot it can destroy all the stormtroopers, situated on some line that crosses point (x0, C13>y0).

Your task is to determine what minimum number of shots Han Solo needs to defeat all the Stormtroopers.

The gun is the newest invention, it shoots very quickly and even after a very large number of shots the Stormtroopers don ' T has enough time to realize what's happening and change their location.

Input

The first line contains three integers n, xy0 (1≤ n ≤100 0, -4≤ x0, y0≤104)-the number of Stormtroopers on the battle field and the coordinates of your gun.

Next n lines contain II integers each xi, yi ( -1 04≤ xi, yi ≤104)-the coordinates of the Stormtroopers On the battlefield. It is guaranteed this no Stormtrooper stands at the same point with the gun. Multiple Stormtroopers can stand at the same point.

Output

Print a single integer-the minimum number of shots Han Solo needs to destroy all the Stormtroopers.

Sample Test (s) input
4 0 0
1 1
2 2
2 0
-1-1
Output
2
Input
2 1 2
1 1
1 0
Output
1
Note

Explanation to the first and second samples from the statement, respectively:

Aim point at x, y there are n individuals, connected together, a shot, set new skills get~

#include <cstdio>#include<Set>using namespacestd;Set<Double>se;intMain () {intN,x,y,x1,y1,flag =0; scanf ("%d%d%d",&n,&x,&y);  for(inti =1; I <= N; i++) {scanf ("%d%d",&x1,&y1); if(y = = y1) flag =1; ElseSe.insert ((Double) (x-x1)/(Yy1)); } printf ("%d\n", Se.size () +flag);}
View Code

Codeforces Round #291 (Div. 2)--b<set>--han Solo and Lazer Gun

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.