Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///HELLO THERE~!
- ///CREATED BY MD SADMAN MEHEDI SIVAN(IUT CSE-SWE^19)
- #include <bits/stdc++.h>
- #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- #define read freopen("blue.txt","r",stdin);
- #define write freopen("red.txt","w",stdout);
- #define pie 2*acos(0.0);
- typedef long long ll;
- using namespace std;
- int main()
- {
- fastio;
- int n,l;
- cin>>n>>l;
- int sivan[n+1];
- for(int i=0; i<n; i++)
- cin>>sivan[i];
- float f=0;
- float r;
- sort(sivan,sivan+n);
- float a=(float)sivan[0]-0;
- float b=l-(float)sivan[n-1];
- float bakon=max(a,b);
- for(int i=0; i<n-1; i++)
- {
- r=(float)sivan[i+1]-sivan[i];
- if(r>=f)
- f=r;
- }
- float q=(f/2.0);
- if(bakon>q)
- cout<<fixed<<setprecision(10)<<bakon;
- else
- cout<<fixed<<setprecision(10)<<q;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement