fork download
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include<bits/stdc++.h>
  3. #define f for
  4. #define ll long long
  5. #define ull unsigned long long
  6. #define endl "\n"
  7. using namespace std;
  8. double pi = acos(-1);
  9. void Open()
  10. {
  11. #ifndef ONLINE_JUDGE
  12. freopen("Input.txt", "r", stdin);
  13. freopen("Output.txt", "w", stdout);
  14. #endif
  15. }
  16. //#define all(a) a.begin(), a.end()
  17. ll gcd(ll a, ll b)
  18. {
  19. return b == 0 ? a : gcd(b, a % b);
  20. }
  21. void PrintNumber(int n, int len)
  22. {
  23. if (!len)
  24. return;
  25. cout << (n & 1);
  26. }
  27. void PrintAllSubset(int n)
  28. {
  29. f(int i = 0; i < (1 << n); i++)
  30. {
  31. PrintNumber(i, n);
  32. cout << endl;
  33. }
  34. }
  35.  
  36. //int a[1000003];
  37. int main()
  38. {
  39. //Open();
  40. //freopen("mex.in","r",stdin);
  41. std::ios_base::sync_with_stdio(0);
  42. cin.tie(NULL);
  43. //cout<<3;
  44. map<int,bool>mp;
  45. double r,a1,a2,a3;
  46. cin>>r;
  47. a1=r*(sqrt(r*r*3));
  48. a2=3.141592*r*r;
  49. a3=0.5*r*(sqrt(-(0.5*r)*(0.5*r)+r*r));
  50. cout<<a1+a2-a3;
  51. }
  52.  
Success #stdin #stdout 0s 4544KB
stdin
Standard input is empty
stdout
Standard output is empty