fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6. double ans;
  7. ll i,n,x,y,dist,maxi=0,mini=1000000000000000,a[100010],b[100010] ;
  8.  
  9. cin>>n;
  10. cin>>x>>y;
  11. for(i=0;i<n;i++)
  12. {
  13. cin>>a[i]>>b[i];
  14. }
  15. for(i=0;i<n;i++)
  16. {
  17. dist=((a[i]-x)*(a[i]-x))+((b[i]-y)*(b[i]-y));
  18. if(dist>maxi)
  19. {
  20. // bigx=a[i];
  21. // bigy=b[i];
  22. maxi=dist;
  23. }
  24. if(dist<mini)
  25. {
  26. // smallx=a[i];
  27. // smally=b[i];
  28. mini=dist;
  29. }
  30. }
  31. //cout<<maxi<<" "<<mini<<endl;
  32. ans=(double)((double)(22*(maxi-mini))/(double)7);
  33. // cout<<ans;
  34. //cout<<(double)ans/(double)7;
  35. cout << fixed << setprecision(10) << ans << endl;
  36. return 0;
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7: error: integer constant is too large for 'long' type
stdout
Standard output is empty