Advertisement
Guest User

codeforce - Vanya and Lanterns

a guest
Dec 11th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6. ll n,l;
  7. cin>>n>>l;
  8. ll ara[n+1];
  9. for(int i=0;i<n;i++)cin>>ara[i];
  10. sort(ara,ara+n);
  11. ll r= max(ara[0],l-ara[n-1])*2;
  12. for(int i=0;i<n-1;i++)
  13. r=max(r,ara[i+1]-ara[i]);
  14. cout.precision(20);
  15. cout<<fixed<<r/2.0<<endl;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement