Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main(){
- ll x, y, xa, ya, xb, yb;
- cin>>x>>y>>xa>>ya>>xb>>yb;
- ll cont1=0,cont2=0;
- for(int i=0;i<=x;i++){
- for(int j=0;j<=y;j++){
- if(((xa-i)*(xa-i) + (ya-j)*(ya-j))>((xb-i)*(xb-i) + (yb-j)*(yb-j))) cont1++;
- else if(((xa-i)*(xa-i) + (ya-j)*(ya-j))<((xb-i)*(xb-i) + (yb-j)*(yb-j))) cont2++;
- }
- }
- double som = cont1+cont2;
- double ans1,ans2;
- if(som==0){
- ans1=0.5;
- ans2=0.5;
- }else{
- ans1=cont1/som;
- ans2=cont2/som;
- }
- printf("%.6lf %.6lf\n",ans2,ans1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement