Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Author: Sudarshan a.k.a sidchelseafan
- Institute: Bits Hyd */
- #include<iostream>
- #include<cstring>
- #include<string>
- #include<cstdio>
- #include<cmath>
- #include<vector>
- #include<set>
- using namespace std;
- #define ll long long
- #define mp make_pair
- #define pb push_back
- #define MX -1e9
- #define SZ 200
- using namespace std;
- pair<double,double> arr[SZ+5];
- bool cmp(pair<double,double>& l,pair<double,double>& r){
- if (l.first!=r.first)
- return (l.first < r.first);
- else
- return (l.second < r.second);
- }
- int main(){
- int n;
- while(1){
- scanf("%d",&n);
- if (n==0)
- break;
- else{
- for (int i=0;i<n;i++)
- scanf("%lf %lf",&arr[i].first,&arr[i].second);
- set < double > q;
- int f=0;
- for (int i=0;i<n-1;i++){
- for (int j=i+1;j<n;j++){
- if (arr[j].first==arr[i].first)
- f=1;
- else
- q.insert((arr[j].second-arr[i].second)/(arr[j].first-arr[i].first));
- }
- }
- printf("%d\n",(int)q.size()+f);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement