//you need to use string[length+1] to figure out the length, because the last element has '\0'

#include <stdio.h>

int main(){
    int n, i, t=0;
    scanf("%d", &n);

    int a[n], temp;
    int max_num = 0, min_num = 101, maxI, minI;
    for(i=0; i<n; i++){
        scanf("%d", &a[i]);
        if(a[i] > max_num){
            max_num = a[i];
            maxI = i;
        }
        else if(a[i] <= min_num){
            min_num = a[i];
            minI = i;
        }
    }
    while(maxI > 0){
        temp = a[maxI];
        a[maxI] = a[maxI-1];
        a[maxI-1] = temp;
        if(maxI-1 == minI){
            minI++;
        }
        maxI--;
        t++;
    }
    while(minI < n-1){
        temp = a[minI];
        a[minI] = a[minI+1];
        a[minI+1] = temp;
        minI++;
        t++;
    }
    printf("%d", t);

    return 0;
}


//you need to use string[length+1] to figure out the length, because the last element has '\0'

#include <stdio.h>

int main(){
    int n, i, t=0;
    scanf("%d", &n);

    int a[n];
    int max_num = 0, min_num = 101, maxI=0, minI=0;
    for(i=0; i<n; i++){
        scanf("%d", &a[i]);
        if(a[i] > max_num){
            max_num = a[i];
            maxI = i;
        }
        if(a[i] <= min_num){
            min_num = a[i];
            minI = i;
        }
    }
    if(minI < maxI){
        minI++;
    }
    t = maxI + n-1 - minI;

    printf("%d", t);

    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<min)
        {
            min=b;
            q=i;
        }
    }
    if(p>q)
    (printf("%d",p+n-2-q));
    else
    printf("%d",p+n-1-q);
    return 0;
}


#include<stdio.h>
int p,q;
int main()
{
    int n ,s[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
    }
    int min=s[0],max=s[0];
     for(int i=0;i<n;i++)
    {
        if(s[i]>=max)
        {
            max=s[i];
            p=i;
        }
        else(s[i]<=min)
        {
            min=s[i];
            q=i;
        }
    }
    if(p>n/2||q>n/2)
    printf("%d",p+n-q-2);
    else
    printf("%d",p+n-q-1);
    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<min)
        {
            min=b;
            q=i;
        }
    }
    if(p>q)
    (printf("%d",p+n-2-q));
    else
    prinf("%d",p+n-1-q);
    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<min)
        {
            min=b;
            q=n-i-1;
        }
    }
    printf("%d",p+q-(p>(q+1-n)));
    return 0;
}


#include<stdio.h>
int p,q;
int main()
{
    int n ,s[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
    }
    int min=s[0],max=s[0];
     for(int i=0;i<n;i++)
    {
        if(s[i]>max)
        {
            max=s[i];
            p=i;
        }
        if(s[i]<min)
        {
            min=s[i];
            q=j;
        }
    }
    if(p>n/2||q>n/2)
    printf("%d",p+n-q-1);
    else
    printf("%d",p+n-q);
    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<min)
        {
            min=b;
            q=n-i-1;
        }
    }
    printf("%d",p+q>n?(p+q-1):(p+q));
    return 0;
}


#include<stdio.h>
int p,q;
int main()
{
    int n ,s[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
    }
    int min=s[0],max=s[0];
     for(int i=0;i<n;i++)
    {
        if(s[i]>=max)
        {
            max=s[i];
            p=i;
        }
        if(s[i]<=min)
        {
            min=s[i];
            q=i;
        }
    }
    if(p>n/2||q>n/2)
    printf("%d",p+n-q-2);
    else
    printf("%d",p+n-q-1);
    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<min)
        {
            min=b;
            q=i;
        }
    }
    if(p>q)
    (printf("%d",p+n-3-q));
    else
    printf("%d",p+n-1-q);
    return 0;
}


#include<stdio.h>
int p,q;
int main()
{
    int n ,s[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
    }
    int min=s[0],max=s[0];
     for(int i=0;i<n;i++)
    {
        if(s[i]>max)
        {
            max=s[i];
            p=i;
        }
        if(s[i]<min)
        {
            min=s[i];
            q=i;
        }
    }
    if(p>n/2||q>n/2)
    printf("%d",p+n-q-1);
    else
    printf("%d",p+n-q);
    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<=min)
        {
            min=b;
            q=i;
        }
    }
    if(p>q)
    (printf("%d",p+n-2-q));
    else
    printf("%d",p+n-1-q);
    return 0;
}


#include<stdio.h>
int main()
{
    int max,min,n,b,i,p=0,q=0;
    scanf("%d%d",&n,&b);
    max=b,min=b;

    for(int i=1;i<n;i++)
    {
        scanf("%d",&b);
        if(b>max)
        {
            max=b;
            p=i;
        }
        if(b<min)
        {
            min=b;
            q=n-i-1;
        }
    }
    printf("%d",p+q-((q+1-n)>p));
    return 0;
}


#include<stdio.h>
int p,q;
int main()
{
    int n ,s[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
    }
    int min=s[0],max=s[0];
     for(int i=0;i<n;i++)
    {
        if(s[i]>max)
        {
            max=s[i];
            p=i;
        }
        if(s[i]<min)
        {
            min=s[i];
            q=i;
        }
    }
    if(p>n/2||q>n/2)
    printf("%d",p+n-q-2);
    else
    printf("%d",p+n-q);
    return 0;
}


#include<stdio.h>
int p,q;
int main()
{
    int n ,s[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
    }
    int min=s[0],max=s[0];
     for(int i=0;i<n;i++)
    {
        if(s[i]>max)
        {
            max=s[i];
            p=i;
        }
        if(s[i]<min)
        {
            min=s[i];
            q=i;
        }
    }
    if(p>n/2||q>n/2)
    printf("%d",p+n-q-2);
    else
    printf("%d",p+n-q-1);
    return 0;
}


#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=0;
    min=101;
    for(i=0;i<n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    if(x<y)
    res=(y)+(n-x-1)-1;
    else
    res=(y)+(n-x-1);
    printf("%d",res);
}


#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=a[1];
    min=a[1];
    for(i=1;i<=n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    res=(y-1)+(n-x);
    printf("%d",res);
}


#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=a[1];
    min=a[1];
    for(i=1;i<=n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    res=(y-1)+(n-x);
    printf("%d",res);
}#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=a[1];
    min=a[1];
    for(i=1;i<=n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    res=(y-1)+(n-x);
    printf("%d",res);
}


#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=0;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=a[0];
    min=a[0];
    for(i=0;i<n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    if(x<y)
    res=(y)+(n-x-1)-1;
    else
    res=(y)+(n-x-1);
    printf("%d",res);
}


#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=a[0];
    min=a[0];
    for(i=0;i<n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    if(x<y)
    res=(y)+(n-x-1)-1;
    else
    res=(y)+(n-x-1);
    printf("%d",res);
}


#include<stdio.h>
int main()
{
    int i,n,res,x,y,max,min;
    scanf("%d ",&n);
    int a[n];
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    max=a[1];
    min=a[1];
    for(i=1;i<=n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            x=i;
        }
        if(a[i]>max)
        {
           max=a[i];
           y=i;
        }
    }
    if(x<y)
    res=(y-1)+(n-x)-1;
    else
    res=(y-1)+(n-x);
    printf("%d",res);
}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int arr[100],n,i,max=0,min=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&arr[i]);
        if(i==1){
            max=1;
            min=1;
        }
        if(arr[i]>arr[max])
            max=i;
        if(arr[i]<=arr[min])
            min=i;
    }
    if(max==1 && min==n)
        printf("0");
    else if(n!=2 && n%2==0)
        printf("%d",(n-min+max-1));
    else
        printf("%d",(n-min+max-2));
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int arr[100],n,i,max=0,min=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&arr[i]);
        if(i==1){
            max=1;
            min=1;
        }
        if(arr[i]>arr[max])
            max=i;
        if(arr[i]<=arr[min])
            min=i;
    }

    if(n!=2 && n%2==0)
        printf("%d",(n-min+max-1));
    else
        printf("%d",(n-min+max-2));
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int arr[100],n,i,max=0,min=0,cnt=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&arr[i]);
        if(i==1){
            max=1;
            min=1;
        }
        if(arr[i]>arr[max])
            max=i;
        if(arr[i]<=arr[min])
            min=i;
    }
    if(max==1 && min==n)
        printf("0");
    else if(n!=2 && max<min)
        printf("%d",(n-min+max-1));
    else
        printf("%d",(n-min+max-2));
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int arr[100],n,i,max=0,min=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&arr[i]);
        if(i==1){
            max=1;
            min=1;
        }
        if(arr[i]>arr[max])
            max=i;
        if(arr[i]<=arr[min])
            min=i;
    }
    if(n%2==0)
        printf("%d",(n-min+max-1));
    else
        printf("%d",(n-min+max-2));
    return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
    int n, i, j, sum = 0, temp, big = 0, small = 8878876, b = 0, s = 0 ;
    scanf("%d", &n);
    int x[n];

    for(i = 0; i < n; i++){
       scanf("%d",&x[i]);
    }

    for(i = 0; i < n; i++){
        if(big < x[i]){
            big = x[i];
            b = i;
        }
        if(small >= x[i]){
            small = x[i];
            s = i;
        }
    }

    //printf("big = %d \nsmall = %d\n", b, s);
    if(b < s){
        sum = sum +(n-1) - s;
        //printf(" sum = %d\n", sum);
        sum = sum + b;
        //printf("  after add b sum = %d\n", sum);
    }
    else{
        sum = sum + b;
        sum = sum + (n-2) - s;
    }
    printf("%d\n", sum);

    return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
    int n, i, j, sum = 0, temp, big = 0, small = 8878876, b = 0, s = 0 ;
    scanf("%d", &n);
    int x[n];

    for(i = 0; i < n; i++){
       scanf("%d",&x[i]);
    }

    for(i = 0; i < n; i++){
        if(big < x[i]){
            big = x[i];
            b = i;
        }
        if(small >= x[i]){
            small = x[i];
            s = i;
        }
    }

    printf("big = %d \nsmall = %d\n", b, s);
    if(b < s){
        sum = sum +(n-1) - s;
        //printf(" sum = %d\n", sum);
        sum = sum + b;
        //printf("  after add b sum = %d\n", sum);
    }
    else{
        sum = sum + b;
        sum = sum + (n-2) - s;
    }
    printf("%d\n", sum);

    return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
    int n, i, j, sum = 0, temp, big = 0, small = 8878876, b = 0, s = 0 ;
    scanf("%d", &n);
    int x[n];

    for(i = 0; i < n; i++){
       scanf("%d",&x[i]);
    }

    for(i = 0; i < n; i++){
        if(big < x[i]){
            big = x[i];
            b = i;
        }
        else if(small >= x[i]){
            small = x[i];
            s = i;
        }
    }

    //printf("big = %d \nsmall = %d\n", b, s);
    if(b < s){
        sum = sum +(n-1) - s;
        //printf(" sum = %d\n", sum);
        sum = sum + b;
        //printf("  after add b sum = %d\n", sum);
    }
    else{
        sum = sum + b;
        sum = sum + (n-2) - s;
    }
    printf("%d\n", sum);

    return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
    int n, i, j, sum = 0, temp, big = 0, small = 8878876, b, s ;
    scanf("%d", &n);
    int x[n];

    for(i = 0; i < n; i++){
       scanf("%d",&x[i]);
    }

    for(i = 0; i < n; i++){
        if(big < x[i]){
            big = x[i];
            b = i;
        }
        else if(small > x[i]){
            small = x[i];
            s = i;
        }
    }

   // printf("big = %d \nsmall = %d\n", b, s);
    if(b < s){
        sum = sum +(n-1) - s;
        //printf(" sum = %d\n", sum);
        sum = sum + b;
        //printf("  after add b sum = %d\n", sum);
    }
    else{
        sum = sum + b;
        sum = sum + (n-2) - s;
    }
    printf("%d\n", sum);

    return 0;
}


#include <stdio.h>
#include <math.h>

int main()
{
    int n, i, j, sum = 0, temp, big = 0, small = 8878876, b = 0, s = 0 ;
    scanf("%d", &n);
    int x[n];

    for(i = 0; i < n; i++){
       scanf("%d",&x[i]);
    }

    for(i = 0; i < n; i++){
        if(big < x[i]){
            big = x[i];
            b = i;
        }
        else if(small > x[i]){
            small = x[i];
            s = i;
        }
    }

    //printf("big = %d \nsmall = %d\n", b, s);
    if(b < s){
        sum = sum +(n-1) - s;
        //printf(" sum = %d\n", sum);
        sum = sum + b;
        //printf("  after add b sum = %d\n", sum);
    }
    else{
        sum = sum + b;
        sum = sum + (n-2) - s;
    }
    printf("%d\n", sum);

    return 0;
}


#include <stdio.h>
int main()
{
    int n,i,x,count,y,temp,j;
    scanf("%d ",&n);
    int ara[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    temp=ara[0];
    for(i=1;i<n;i++)
    {
        if(temp<ara[i])
                {
                    temp=ara[i];
                    x=i;
                }
    }
    temp=ara[n-1];
    for(j=n-2;j>=0;j--)
    {
        if(temp>ara[j])
            {
                temp=ara[j];
                y=j;
            }
    }
    if(x>y)
        y++;
    count=(n-1)-y+x;
        printf("%d\n",count);
}


#include <stdio.h>
int main()
{
    int ara[101],n,i,x,count,y,temp,j;
    scanf("%d ",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    temp=ara[0];
    for(i=1;i<n;i++)
    {
        if(temp<ara[i])
                {
                    temp=ara[i];
                    x=i;
                }
    }
    temp=ara[n-1];
    for(j=n-2;j>=0;j--)
    {
        if(temp>ara[j])
            {
                temp=ara[j];
                y=j;
            }
    }
    count=(--n)-y+x;
        printf("%d ",count);
}


#include <stdio.h>
int main()
{
    int ara[101],n,i,x,count,y,max,min,j;
    scanf("%d ",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    min=ara[0];
    max=ara[0];
    for(i=1;i<n;i++)
    {
        if(max<ara[i])
                {
                    max=ara[i];
                    x=i;
                }
        if(min>=ara[i])
            {
                min=ara[i];
                y=i;
            }
    }
    if(x>y)
        y++;
    count=(n-1)-y+x;
        printf("%d\n",(n-1)-y+x);
}


#include <stdio.h>
int main()
{
    int ara[1000],n,i,x,count,y,temp,j;
    scanf("%d ",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    temp=ara[0];
    for(i=1;i<n;i++)
    {
        if(temp<ara[i])
                {
                    temp=ara[i];
                    x=i;
                }
    }
    temp=ara[n-1];
    for(j=n-2;j>=0;j--)
    {
        if(temp>ara[j])
            {
                temp=ara[j];
                y=j;
            }
    }
    if(x>y)
        y++;
    count=(n-1)-y+x;
        printf("%d\n",count);
}


#include <stdio.h>
int main()
{
    int n,i,x,count,y,max,min,j;
    scanf("%d ",&n);
    int ara[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    min=ara[0];
    max=ara[0];
    for(i=1;i<n;i++)
    {
        if(max<ara[i])
                {
                    max=ara[i];
                    x=i;
                }
        if(min>=ara[i])
            {
                min=ara[i];
                y=i;
            }
    }
    if(x>y)
        y++;
    count=(n-1)-y+x;
        printf("%d\n",(n-1)-y+x);
}


#include <stdio.h>
      int main()
{
    int n,i,maxx,minn,index_max,index_min;
    scanf("%d",&n);
    int a[n];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
    }
    maxx=0;
    minn=101;
    for(i=0; i<n; i++)
    {
        if(a[i]>maxx)
        {
            maxx=a[i];
            index_max=i;
        }
        if(a[i]<=minn)
        {
            minn=a[i];
            index_min=i;
        }
    }
    n=n-1;
    if(index_max>index_min)
        index_min=index_min+1;
    printf("%d\n",index_max+n-index_min);
    return 0;
}


#include <stdio.h>
int main()
{
    int ara[101],n,i,x=0,count,y=0,max,min,j;
    scanf("%d ",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    min=ara[0];
    max=ara[0];
    for(i=1;i<n;i++)
    {
        if(max<ara[i])
                {
                    max=ara[i];
                    x=i;
                }
        if(min>=ara[i])
            {
                min=ara[i];
                y=i;
            }
    }
    if(x>y)
        y++;
        printf("%d\n",(n-1)-y+x);
}


#include <stdio.h>
int main()
{
    int ara[101],n,i,x,count,y,temp,j;
    scanf("%d ",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    temp=ara[0];
    for(i=1;i<n;i++)
    {
        if(temp<ara[i])
                {
                    temp=ara[i];
                    x=i;
                }
    }
    temp=ara[n-1];
    for(j=n-2;j>=0;j--)
    {
        if(temp>ara[j])
            {
                temp=ara[j];
                y=j;
            }
    }
    if(x>y)
        y++;
    count=(n-1)-y+x;
        printf("%d\n",count);
}


#include<stdio.h>
int main(){
	int n,m,m1,i=1,a=0,b=0,c;
	scanf("%d",&n);
	scanf("%d",&m1);
	for(i=1;i<n;i++){
		scanf("%d",&m);
		if(m>m1){
			a=i-2;
		}
		else{
			b=n-i+2;
		}
	}
	c=a+b;
	printf("%d",c);
    return 0;
}


#include<stdio.h>
int main(){
	int n,m,m1,i=1,a=0,b=0,c;
	scanf("%d",&n);
	scanf("%d",&m1);
	for(i=1;i<n;i++){
		scanf("%d",&m);
		if(m>m1){
			a=i-1;
		}
		else{
			b=n-i+1;
		}
	}
	c=a+b;
	printf("%d",c);
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,inmax,inmin,n;
    int max=0,min=11111,sum=0;
    scanf("%d",&n);
    int ar[110];
    for(i=0;i<n;i++)
        scanf("%d",&ar[i]);
    for(i=0;i<n;i++)
    {
        if(ar[i]>max)
        {
            max=ar[i];
            inmax=i;
        }
        else if(ar[i]<=min)
        {
            min=ar[i];
            inmin=i;
        }
    }
    n=n-1;
    if(inmax>inmin)
        inmin=inmin+1;
    sum=inmax+n-inmin;
    printf("%d",sum);

}


#include<stdio.h>
int main()
{
    int i,j,inmax=0,inmin=0,n;
    int max=0,min=111,sum=0;
    scanf("%d",&n);
    int ar[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&ar[i]);
        if(ar[i]>max)
        {
            max=ar[i];
            inmax=i;
        }
        else if(ar[i]<=min)
        {
            min=ar[i];
            inmin=i;
        }
    }
    n=n-1;
    if(inmax>inmin)
        inmin=inmin+1;
    inmin=n-inmin;
    sum=inmax+inmin;
    printf("%d",sum);

    return 0;

}


#include<stdio.h>
int main()
{
    int i,j,inmax,inmin,n;
    int max=0,min=11111,sum=0;
    scanf("%d",&n);
    int ar[110];
    for(i=0;i<n;i++)
        scanf("%d",&ar[i]);
    for(i=0;i<n;i++)
    {
        if(ar[i]>max)
        {
            max=ar[i];
            inmax=i;
        }
        else if(ar[i]<=min)
        {
            min=ar[i];
            inmin=i;
        }
    }
    if(inmax>inmin)
    {
        sum=(inmax-1)+(n-inmin)-1;
        printf("%d",sum);
    }
    else
    {
        sum=(inmax-1)+(n-inmin);
        printf("%d",sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,inmax=0,inmin=0,n;
    int max=0,min=111,sum=0;
    scanf("%d",&n);
    int ar[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&ar[i]);
        if(ar[i]>max)
        {
            max=ar[i];
            inmax=i;
        }
        if(ar[i]<=min)
        {
            min=ar[i];
            inmin=i;
        }
    }
    n=n-1;
    if(inmax>inmin)
        inmin=inmin+1;
    inmin=n-inmin;
    sum=inmax+inmin;
    printf("%d",sum);

    return 0;

}


#include<stdio.h>
int main()
{
    int ar[101],i,j,inmax,inmin,n;
    int max=0,min=111,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&ar[i]);
    for(i=0;i<n;i++)
    {
        if(ar[i]>max)
        {
            max=ar[i];
            inmax=i+1;
        }
        else if(ar[i]<=min)
        {
            min=ar[i];
            inmin=i+1;
        }
    }
    if(inmax>inmin)
        inmin=inmin+2;
    else
        inmin=inmin+1;
    inmin=n-inmin;
    sum=inmax+inmin;
    printf("%d",sum);

}


#include<stdio.h>
int main()
{
    int i,j,inmax,inmin,n;
    int max=0,min=1111,sum=0;
    scanf("%d",&n);
    int ar[n];
    for(i=0;i<n;i++)
        scanf("%d",&ar[i]);
    for(i=0;i<n;i++)
    {
        if(ar[i]>max)
        {
            max=ar[i];
            inmax=i;
        }
        else if(ar[i]<=min)
        {
            min=ar[i];
            inmin=i;
        }
    }
    n=n-1;
    if(inmax>inmin)
        inmin=inmin+1;
    inmin=n-inmin;
    sum=inmax+inmin;
    printf("%d",sum);

}


#include<stdio.h>
int main()
{
int n,h,l,t,i,highest,lowest;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
highest=A[0];
h=0;
for(i=0;i<n;i++)
{
if(A[i]>highest)
{
h=i;
highest=A[i];
}
}
lowest=A[0];
l=0;
for(i=0;i<n;i++)
{
if(A[i]<=lowest)
{
l=i;
lowest=A[i];
}
}
if(h<l)
{
t=h+n-l-1;
}
else if(h==l)
{
t=0;
}
else
{
t=h+n-l-2;
}
printf("%d\n",t);
return 0;
}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}
	for(i=0;i<len-1;i++){
		if(s[i]<s[i+1]){
			temp=s[i];
			s[i]=s[i+1];
			s[i+1]=temp;
			step++;
		}
	}
	for(i=0;i<len-1;i++){
		if (s[i]==max){
			step=step+i;
		}
	}

	for (i=0;i<len;i++){
		printf("%d ", s[i]);
	}

	printf("\n%d", step);

}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}

	//printf("%d, %d \n", max,min);
	/*
	for(i=0;i<len;i++)
	{
	    printf("%d ",s[i]);
	}
	*/

	for(i=len-1;i>0;i--){
		if (s[len-1]==min)
			break;
	    if (s[i]==min){
	        step=step+(len-1-i);
	        break;
	    }
	}

    //printf("%d\n",step);

	for(i=len-1-step;i<len-1;i++){
		temp=s[i];
		s[i]=s[i+1];
		s[i+1]=temp;
	}

	/*
	for(i=0;i<len;i++)
	{
	    printf("%d ",s[i]);
	}*/
	//printf("\n%d", step);

	for(i=0;i<len-1;i++){
	    if (s[0]==max)
	        break;
		else if (s[i]==max){
			step=step+i;
			break;
		}
	}

	printf("%d", step);

}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}

	//printf("%d, %d \n", max,min);
	/*
	for(i=0;i<len;i++)
	{
	    printf("%d ",s[i]);
	}
	*/

	for(i=len-1;i>=0;i--){
		if (s[len-1]==min)
			break;
	    if (s[i]==min){
	        step=step+(len-1-i);
	        break;
	    }
	}

    //printf("%d\n",step);

	for(i=len-1-step;i<len-1;i++){
		temp=s[i];
		s[i]=s[i+1];
		s[i+1]=temp;
	}

	/*
	for(i=0;i<len;i++)
	{
	    printf("%d ",s[i]);
	}*/
	//printf("\n%d", step);

	for(i=0;i<len-1;i++){
	    if (s[0]==max)
	        break;
		else if (s[i]==max){
			step=step+i;
			break;
		}
	}

	printf("%d", step);

}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}

	for(i=0;i<len-1;i++){
		if (s[len-1]==min)
			break;
		if(s[i]<s[i+1] && s[i]==min){
			temp=s[i];
			s[i]=s[i+1];
			s[i+1]=temp;
			step++;
		}
	}

	/*
	for(i=0;i<len;i++)
	{
	    printf("%d ",s[i]);
	}
	*/
	//printf("\n%d", step);

	for(i=0;i<len-1;i++){
	    if (s[0]==max)
	        break;
		else if (s[i]==max){
			step=step+i;
			break;
		}
	}

	printf("%d", step);

}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}

	for(i=len-1;i>0;i--){
		if (s[len-1]==min)
			break;
	    else if (s[i]==min){
	        step=step+(len-1-i);
	        break;
	    }
	}

	//for(i=0;i<len;i++)
	//{
	//    printf("%d ",s[i]);
	//}
	//printf("\n%d", step);

	for(i=0;i<len-1;i++){
	    if (s[0]==max)
	        break;
		else if (s[i]==max){
			step=step+i;
			break;
		}
	}

	printf("%d", step);

}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}

	for(i=0;i<len-1;i++){
		if (s[len-1]==min)
			break;
		if(s[i]<s[i+1]){
			temp=s[i];
			s[i]=s[i+1];
			s[i+1]=temp;
			step++;
		}
	}
	//printf("%d", step);
	for(i=0;i<len-1;i++){
	    if (s[0]==max)
	        break;
		if (s[i]==max){
			step=step+i;
		}
	}
	printf("%d", step);
}


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main(){
	int len, s[100],i, max=0, min= 200,temp, step=0, cpy[100];
	scanf("%d", &len);

	for (i=0;i<len;i++)
	{
		scanf("%d", &s[i]);
		if (s[i]>max)
			max=s[i];
		if (s[i]<min)
			min =s[i];
		cpy[i]=s[i];
	}
	for(i=0;i<len-1;i++){
		if(s[i]<s[i+1]){
			temp=s[i];
			s[i]=s[i+1];
			s[i+1]=temp;
			step++;
		}
	}
	for(i=0;i<len-1;i++){
		if (s[i]==max){
			step=step+i;
		}
	}

	printf("\n%d", step);

}


int main() {
	int n,i,b;
	scanf("%d\n%d",&n,&b);
	int max=b,min=b,max_i=n-1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i>1)
        printf("%d",max_i+n-min_i-2);
    else
        printf("%d",max_i+n-min_i-1);
}


int main() {
	int n,i,b;
	scanf("%d%d",&n,&b);
	int max=b,min=b,max_i=1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i-1>0)
        printf("%d",max_i+n-min_i-2);
    else
        printf("%d",max_i+n-min_i-1);
}


int main() {
	int n,i,b;
	scanf("%d\n%d",&n,&b);
	int max=b,min=b,max_i=1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i>=1)
        printf("%d",max_i+n-min_i-2);
    else
        printf("%d",max_i+n-min_i-1);
}


int main() {
	int n,i,b;
	scanf("%d\n%d",&n,&b);
	int max=b,min=b,max_i=1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i-1>0)
        printf("%d",max_i+n-min_i-2);
    else
        printf("%d",max_i+n-min_i-1);
}


int main() {
	int n,i,b;
	scanf("%d\n%d",&n,&b);
	int max=b,min=b,max_i=1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i>1)
        printf("%d",max_i+n-min_i-2);
    else
        printf("%d",max_i+n-min_i-1);
}


int main() {
	int n,i,b;
	scanf("%d\n%d",&n,&b);
	int max=b,min=b,max_i=1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i>1)
        printf("%d",max_i+n-min_i-2);
    else
        printf("%d",max_i+n-min_i-1);
    return 0;
}


int main() {
	int n,i,b;
	scanf("%d%d",&n,&b);
	int max=b,min=b,max_i=1,min_i=1;
	for(i=2;i<=n;i++) {
		scanf("%d",&b);
		if(b>max) {
			max=b;
			max_i=i;
		}
		if(b<=min) {
			min=b;
			min_i=i;
		}
	}
    if(max_i-min_i-1>0)
        printf("%d\n",max_i+n-min_i-2);
    else
        printf("%d\n",max_i+n-min_i-1);
}


#include<stdio.h>
int main()
{
    int i,j,n,max,k,min;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
    scanf("%d",&a[i]);
    }
    max=a[0];
    min=a[0];
    for(i=0;i<n;i++)
    {
        if(a[i]>max)
        {
            max=a[i];
            j=i;
        }
    }
    for(i=0;i<n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            k=i;
        }
    }
    printf("%d",j+n-k-1);
}


#include<stdio.h>
int main()
{
    int i,j,n,max,k,min;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
    scanf("%d",&a[i]);
    }
    max=a[0];
    min=a[0];
    for(i=0;i<n;i++)
    {
        if(a[i]>=max)
        {
            max=a[i];
            j=i;
        }
    }
    for(i=0;i<n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            k=i;
        }
    }
    if(a[0]=max)
    {
        j=0;
    }
    if(j>k)
    printf("%d",j+n-k-2);
    else
        printf("%d",j+n-k-1);

}


#include<stdio.h>
int main()
{
    int i,j,n,max,k,min;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
    scanf("%d",&a[i]);
    }
    max=a[0];
    min=a[0];
    for(i=0;i<n;i++)
    {
        if(a[i]>max)
        {
            max=a[i];
            j=i;
        }
    }
    for(i=0;i<n;i++)
    {
        if(a[i]<=min)
        {
            min=a[i];
            k=i;
        }
    }
    if(j>k)
    printf("%d",j+n-k-2);
    else
        printf("%d",j+n-k-1);
}


#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
    int n,m,k;
    double a,b;
    cin>>n;
    vector <int> x(n);
    for(int i=0;i<n;i++)    cin>>x[i];
    cin>>m;
    vector <int> y(m);
    for(int i=0;i<m;i++)    cin>>y[i];
    cin>>k;
    vector <int> z(k);
    for(int i=0;i<k;i++)    cin>>z[i];
    cin>>a>>b;
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    sort(z.begin(),z.end());
    double numerator=b*y[m-1],second=numerator+a*z[0],r1=x[n-1];
    double result=r1*sqrt(numerator/second);
    cout<<result<<endl;
}


#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
    int n,m,k;
    double a,b;
    cin>>n;
    vector <int> x(n);
    for(int i=0;i<n;i++)    cin>>x[i];
    cin>>m;
    vector <int> y(m);
    for(int i=0;i<m;i++)    cin>>y[i];
    cin>>k;
    vector <int> z(k);
    for(int i=0;i<k;i++)    cin>>z[i];
    cin>>a>>b;
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    sort(z.begin(),z.end());
    double numerator=b*(double)(y[m-1]),second=numerator+a*(double)(z[0]),r1=x[n-1];
    double result=r1*sqrt(numerator/second);
    cout.precision(10);
    cout<<result<<endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{

int n,l,k,a,b;

cin>>n;
int t1[n];

for(int i=0;i<n;i++)
    cin>>t1[i];

cin>>k;
int t2[k];

for(int i=0;i<k;i++)
    cin>>t2[i];

cin>>l;
int t3[l];

for(int i=0;i<l;i++)
    cin>>t3[i];

sort(t1,t1+n);
sort(t2,t2+k);
sort(t3,t3+l);

cin>>a>>b;

cout<<sqrt( (b*t1[n-1]*t1[n-1]*t2[k-1])*1.0 / (a*t3[0] + b*t2[k-1])*1.0 );

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{

int n,l,k,a,b;

cin>>n;
int t1[n];

for(int i=0;i<n;i++)
    cin>>t1[i];

cin>>k;
int t2[k];

for(int i=0;i<k;i++)
    cin>>t2[i];

cin>>l;
int t3[l];

for(int i=0;i<l;i++)
    cin>>t3[i];

sort(t1,t1+n);
sort(t2,t2+k);
sort(t3,t3+l);

cin>>a>>b;
double v = (double(b)*t1[n-1]*t1[n-1]*t2[k-1]) / (double(a)*t3[0] + b*t2[k-1]);
cout<<fixed<<setprecision(10)<<sqrt(v);

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{

int n,l,k,a,b;

cin>>n;
int t1[n];

for(int i=0;i<n;i++)
    cin>>t1[i];

cin>>k;
int t2[k];

for(int i=0;i<k;i++)
    cin>>t2[i];

cin>>l;
int t3[l];

for(int i=0;i<l;i++)
    cin>>t3[i];

sort(t1,t1+n);
sort(t2,t2+k);
sort(t3,t3+l);

cin>>a>>b;

cout<<fixed<<setprecision(10)<<sqrt( (b*t1[n-1]*t1[n-1]*t2[k-1])*1.0 / (a*t3[0] + b*t2[k-1])*1.0 );

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{

int n,l,k,a,b;

cin>>n;
int t1[n];

for(int i=0;i<n;i++)
    cin>>t1[i];

cin>>k;
int t2[k];

for(int i=0;i<k;i++)
    cin>>t2[i];

cin>>l;
int t3[l];

for(int i=0;i<l;i++)
    cin>>t3[i];

sort(t1,t1+n);
sort(t2,t2+k);
sort(t3,t3+l);

cin>>a>>b;
double v = (b*t1[n-1]*t1[n-1]*t2[k-1])*1.0 / (a*t3[0] + b*t2[k-1])*1.0 ;
cout<<fixed<<setprecision(10)<<sqrt(v);

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{

int n,l,k,a,b;

cin>>n;
int t1[n];

for(int i=0;i<n;i++)
    cin>>t1[i];

cin>>k;
int t2[k];

for(int i=0;i<k;i++)
    cin>>t2[i];

cin>>l;
int t3[l];

for(int i=0;i<l;i++)
    cin>>t3[i];

sort(t1,t1+n);
sort(t2,t2+k);
sort(t3,t3+l);

cin>>a>>b;
double v = (b*t1[n-1]*t1[n-1]*t2[k-1]) / (a*t3[0] + b*t2[k-1]);
cout<<fixed<<setprecision(10)<<sqrt(v);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll , ll>
#define pci pair<char,int>
#define fi first
#define se second
//cout << setprecision(5) << f << '\n';
/*
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    //ascending
    return (a.second < b.second);
}
bool comp(pii a , pii b)
{ // descending
    if(a.second == b.second)return(a.first > b.first);
    return(a.second > b.second);
}

 // Inserts str2 in str1 starting
    // from 6th index of str1
    str1.insert(6, str2);
*/
//map<pii,int> m; m[mp(0,0)]=0; pii ans=mp(1,1e9); ans.x , ans.y
//template<class T>
//using min_heap = priority_queue<T , vector<T> , greater<T>>;
//template<class T>
//using max_heap = priority_queue<T>;
//sort(B.begin() , B.end() , [](const box &l , const box &r){return l.x1 < r.x1;});
//min_heap<pair<ll , size_t>> byx2;
//max_heap<pair<ll , size_t>> byy1;
//using vll = vector<ll>
//vi gone(n , 0);
//sortdesc(arr, arr+n, greater<int>());
// x | (1 << n) returns x with nth bit set
//  x & (-x) returns the rightmost 1 of x
//getline(cin , s);
// vector<vector<int>> dist(size of the outer vector = n , vector<int>(size of EACH VECTOR in the vector = 10));
/*for(int k=0;k<4;k++)
use this for four adjacent ;
                {
                    int ni = i + int (k = 0) - int (k = 1);
                    int nj = j + int (k = 2) - int (k = 3);
                    if(ni < 0 || nj < 0 || ni >= n || nj >= m )continue;
                }
                */

/*
-----------BFS----------------

           // was[][] is for visited
            int was[n][m];
            for(int i=0;i<n;i++)
            {
                for(int j = 0; j < m ; j++)
                {
                 was[i][j] = 0;
                }
             }
              pii q[n*m];

             was[n-1][m-1] = 1; // n,m is starting node
              q[0] = mp(n-1 , m-1);
              int l = 0 , r = 1;
              while(l < r )
            {
                int i = q[l].fi;
                int j = q[l].se;
                for(int k = 0; k < 4;k++)
                {
                    int ni = i + int (k == 0) - int (k == 1); // for this disable int long long
                    int nj = j + int (k == 2) - int (k == 3);
                    if(ni < 0 || nj < 0 || ni >= n || nj >= m|| was[ni][nj])continue;
                    q[r++] = mp(ni , nj);
                    was[ni][nj] = 1;
                }
                l+=1;
            }

-----------BFS----------------
*/
/*
-------------DFS--------------
bool visit[N];
int par[N];
vector<int> g[N];
void dfs1(int v)
{
    visit[v] = true;
    for(auto child : g[v])
    {
         if(!visit[child])
              dfs1(child);
    }

}

void dfs2(int v, int p)
{
    par[v] = p;
    for(auto child : g[v])
    {
          if(child == par[v])
                continue;
          dfs(child,v);
    }

}
-------------DFS--------------
*/
/*
----------------DFS for calculating depth of each element as well as number of children---------------
#define maxn 200005
#define pb push_back
vector<int>adj[maxn];
int depth[maxn] , size[maxn] , det[maxn];
int dfs(int u , int f)
{
    depth[u] = depth[f] + 1;
    size[u] = 1;
    for(auto i : adj[u])
    {
        size[u] += dfs(i , u);
    }
    det[u] = size[u] - depth[u];
    return size[u];
}
dfs(1 , 0);
---------------------DFS---------------------------
*/
#define pb push_back
#define int long long
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}

/*int dfs(string s , char c)
{
    int n = s.length();
    if(n == 1)
    {
        if(c == s[0]) return 0;
        else return 1;

    }
    int lc = 0;

    for(int i=0;i<n/2;i++)
    {
        if(s[i] != c){lc += 1;}
    }
int rc = 0;
    for(int i=n/2;i<n;i++)
    {
        if(s[i] != c){rc += 1;}
    }
    return min(dfs(s.substr(0 , n/2) , c + 1) + rc , dfs(s.substr(n/2 , n) , c + 1) + lc);
}
*/
//cout<<sum==1?"Carrots":sum==2?"Kiwis":"Grapes"
//printf("%s\n",sum==1?"Carrots":sum==2?"Kiwis":"Grapes");
float distance(int x1, int y1, int x2, int y2)
{
    // Calculating distance
    return sqrt(pow(x2 - x1, 2) +
                pow(y2 - y1, 2) * 1.0);
}
int factorial(int n)
{
    // single line to find factorial
    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
const int X[]={1,0,-1,0,1,1,-1,-1};
const int Y[]={0,1,0,-1,1,-1,1,-1};
signed main()
{   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t = 1;
    //cin>>t;
    while(t--){

       //----------------------------------------------//

     int a , b , c;
     cin>>a;
     int m1 = 0 , m2 = 0 , m3 = INT_MAX;
     for(int i=0;i<a;i++)
     {
        int u;
        cin>>u;
        m1 = max(u , m1);
     }
     cin>>b;
     for(int i=0;i<b;i++)
     {
        int u;
        cin>>u;
        m2 = max(u , m2);
     }
     cin>>c;
     for(int i=0;i<c;i++)
     {
        int u;
        cin>>u;
        m3 = min(m3 , u);
     }
     int j , k;
     cin>>j>>k;
     float ans = 1;
     ans *= m1;
     float h = k*m2;
     h /= (h + (j*m3) - 0.0);
     h = sqrtf(h);
     ans *= h;
     //cout<<m1<<" "<<m2<<" "<<m3;
     cout<<setprecision(12) <<ans;

        //---------------------------------------------//

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll , ll>
#define pci pair<char,int>
#define fi first
#define se second
//cout << setprecision(5) << f << '\n';
/*
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    //ascending
    return (a.second < b.second);
}
bool comp(pii a , pii b)
{ // descending
    if(a.second == b.second)return(a.first > b.first);
    return(a.second > b.second);
}

 // Inserts str2 in str1 starting
    // from 6th index of str1
    str1.insert(6, str2);
*/
//map<pii,int> m; m[mp(0,0)]=0; pii ans=mp(1,1e9); ans.x , ans.y
//template<class T>
//using min_heap = priority_queue<T , vector<T> , greater<T>>;
//template<class T>
//using max_heap = priority_queue<T>;
//sort(B.begin() , B.end() , [](const box &l , const box &r){return l.x1 < r.x1;});
//min_heap<pair<ll , size_t>> byx2;
//max_heap<pair<ll , size_t>> byy1;
//using vll = vector<ll>
//vi gone(n , 0);
//sortdesc(arr, arr+n, greater<int>());
// x | (1 << n) returns x with nth bit set
//  x & (-x) returns the rightmost 1 of x
//getline(cin , s);
// vector<vector<int>> dist(size of the outer vector = n , vector<int>(size of EACH VECTOR in the vector = 10));
/*for(int k=0;k<4;k++)
use this for four adjacent ;
                {
                    int ni = i + int (k = 0) - int (k = 1);
                    int nj = j + int (k = 2) - int (k = 3);
                    if(ni < 0 || nj < 0 || ni >= n || nj >= m )continue;
                }
                */

/*
-----------BFS----------------

           // was[][] is for visited
            int was[n][m];
            for(int i=0;i<n;i++)
            {
                for(int j = 0; j < m ; j++)
                {
                 was[i][j] = 0;
                }
             }
              pii q[n*m];

             was[n-1][m-1] = 1; // n,m is starting node
              q[0] = mp(n-1 , m-1);
              int l = 0 , r = 1;
              while(l < r )
            {
                int i = q[l].fi;
                int j = q[l].se;
                for(int k = 0; k < 4;k++)
                {
                    int ni = i + int (k == 0) - int (k == 1); // for this disable int long long
                    int nj = j + int (k == 2) - int (k == 3);
                    if(ni < 0 || nj < 0 || ni >= n || nj >= m|| was[ni][nj])continue;
                    q[r++] = mp(ni , nj);
                    was[ni][nj] = 1;
                }
                l+=1;
            }

-----------BFS----------------
*/
/*
-------------DFS--------------
bool visit[N];
int par[N];
vector<int> g[N];
void dfs1(int v)
{
    visit[v] = true;
    for(auto child : g[v])
    {
         if(!visit[child])
              dfs1(child);
    }

}

void dfs2(int v, int p)
{
    par[v] = p;
    for(auto child : g[v])
    {
          if(child == par[v])
                continue;
          dfs(child,v);
    }

}
-------------DFS--------------
*/
/*
----------------DFS for calculating depth of each element as well as number of children---------------
#define maxn 200005
#define pb push_back
vector<int>adj[maxn];
int depth[maxn] , size[maxn] , det[maxn];
int dfs(int u , int f)
{
    depth[u] = depth[f] + 1;
    size[u] = 1;
    for(auto i : adj[u])
    {
        size[u] += dfs(i , u);
    }
    det[u] = size[u] - depth[u];
    return size[u];
}
dfs(1 , 0);
---------------------DFS---------------------------
*/
#define pb push_back
#define int long long
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}

/*int dfs(string s , char c)
{
    int n = s.length();
    if(n == 1)
    {
        if(c == s[0]) return 0;
        else return 1;

    }
    int lc = 0;

    for(int i=0;i<n/2;i++)
    {
        if(s[i] != c){lc += 1;}
    }
int rc = 0;
    for(int i=n/2;i<n;i++)
    {
        if(s[i] != c){rc += 1;}
    }
    return min(dfs(s.substr(0 , n/2) , c + 1) + rc , dfs(s.substr(n/2 , n) , c + 1) + lc);
}
*/
//cout<<sum==1?"Carrots":sum==2?"Kiwis":"Grapes"
//printf("%s\n",sum==1?"Carrots":sum==2?"Kiwis":"Grapes");
float distance(int x1, int y1, int x2, int y2)
{
    // Calculating distance
    return sqrt(pow(x2 - x1, 2) +
                pow(y2 - y1, 2) * 1.0);
}
#define float double
int factorial(int n)
{
    // single line to find factorial
    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
const int X[]={1,0,-1,0,1,1,-1,-1};
const int Y[]={0,1,0,-1,1,-1,1,-1};
signed main()
{   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t = 1;
    //cin>>t;
    while(t--){

       //----------------------------------------------//

     int a , b , c;
     cin>>a;
     int m1 = 0 , m2 = 0 , m3 = INT_MAX;
     for(int i=0;i<a;i++)
     {
        int u;
        cin>>u;
        m1 = max(u , m1);
     }
     cin>>b;
     for(int i=0;i<b;i++)
     {
        int u;
        cin>>u;
        m2 = max(u , m2);
     }
     cin>>c;
     for(int i=0;i<c;i++)
     {
        int u;
        cin>>u;
        m3 = min(m3 , u);
     }
     int j , k;
     cin>>j>>k;
     float ans = 1;
     ans *= m1;
     float h = k*m2;
     h /= (h + (j*m3) - 0.0);
     h = sqrtf(h);
     ans *= h;
     //cout<<m1<<" "<<m2<<" "<<m3;
     cout<<setprecision(12) <<ans;

        //---------------------------------------------//

    }
    return 0;
}


/*
  compiler404
*/
#include <bits/stdc++.h>
using namespace std;

#define mp                       make_pair
#define pb                       push_back
#define eb                       emplace_back
#define all(x)                   (x).begin(),(x).end()
#define fi                       first
#define se                       second
#define rep(i,x,y,s)             for(int i=x;(x<=y?i<=y:i>=y);i=(x<=y?i+s:i-s))
#define fore(it, l)              for(auto it=l.begin(); it!=l.end(); it++)

typedef long long int            ll;
typedef vector<int> 	           vi;
typedef pair<int,int> 	         pi;
typedef tuple<int, int, int>     ti;

#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))

int main()
{
	ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, m, k, a, b;
  cin >> n;
  vi r1(n);
  rep(i, 0, n-1, 1)
    cin >> r1[i];

  cin >> m;
  vi p1(m);
  rep(i, 0, m-1, 1)
    cin >> p1[i];

  cin >> k;
  vi p2(k);
  rep(i, 0, k-1, 1)
    cin >> p2[i];

  sort(all(r1));
  sort(all(p1));
  sort(all(p2));

  cin >> a >> b;
  long double x, y, d, ans=0;
  rep(i, 0, n-1, 1){
    rep(j, 0, m-1, 1){
      //rep(l, 0, k-1, 1){
        x = b*p1[j]*r1[i]*r1[i], y = b*p1[j] + a*p2[0];
        d = x/y;
        d = sqrt(d);
        ans = max(ans, d);
      //}
    }
  }
  printf("%.12Lf",ans);
}


/*
  compiler404
*/
#include <bits/stdc++.h>
using namespace std;

#define mp                       make_pair
#define pb                       push_back
#define eb                       emplace_back
#define all(x)                   (x).begin(),(x).end()
#define fi                       first
#define se                       second
#define rep(i,x,y,s)             for(int i=x;(x<=y?i<=y:i>=y);i=(x<=y?i+s:i-s))
#define fore(it, l)              for(auto it=l.begin(); it!=l.end(); it++)

typedef long long int            ll;
typedef vector<int> 	           vi;
typedef pair<int,int> 	         pi;
typedef tuple<int, int, int>     ti;

#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))

int main()
{
	ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, m, k, a, b;
  cin >> n;
  vi r1(n);
  rep(i, 0, n-1, 1)
    cin >> r1[i];

  cin >> m;
  vi p1(m);
  rep(i, 0, m-1, 1)
    cin >> p1[i];

  cin >> k;
  vi p2(k);
  rep(i, 0, k-1, 1)
    cin >> p2[i];

  sort(all(r1));
  sort(all(p1));
  sort(all(p2));

  cin >> a >> b;
  long double x, y, d, ans=0;
  rep(i, 0, n-1, 1){
    rep(j, 0, m-1, 1){
      rep(l, 0, k-1, 1){
        x = b*p1[j]*r1[i]*r1[i], y = b*p1[j] + a*p2[l];
        d = x/y;
        d = sqrt(d);
        ans = max(ans, d);
      }
    }
  }
  printf("%.12Lf",ans);
}


/*
  compiler404
*/
#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define rep(i, x, y, s) for (int i = x; (x <= y ? i <= y : i >= y); i = (x <= y ? i + s : i - s))
#define fore(it, l) for (auto it = l.begin(); it != l.end(); it++)

typedef long long int ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;

#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, m, k, p1, p2, r1;
  int mr1 = 0, mp1 = 0, mp2 = 100000;

  cin >> n;
  rep(i, 0, n - 1, 1)
  {
    cin >> r1;
    mr1 = max(mr1, r1);
  }
  cin >> m;
  rep(i, 0, m - 1, 1)
  {
    cin >> p1;
    mp1 = max(mp1, p1);
  }
  cin >> k;
  rep(i, 0, k - 1, 1)
  {
    cin >> p2;
    mp2 = max(mp2, p2);
  }
  double a, b;
  cin >> a >> b;
  cout << fixed << setprecision(8) << (mr1 * sqrt((b * mp1) / (b * mp1 + a * mp2))) << "\n";
}


/*
  compiler404
*/
#include <bits/stdc++.h>
using namespace std;

#define mp                       make_pair
#define pb                       push_back
#define eb                       emplace_back
#define all(x)                   (x).begin(),(x).end()
#define fi                       first
#define se                       second
#define rep(i,x,y,s)             for(int i=x;(x<=y?i<=y:i>=y);i=(x<=y?i+s:i-s))
#define fore(it, l)              for(auto it=l.begin(); it!=l.end(); it++)

typedef long long int            ll;
typedef vector<int> 	           vi;
typedef pair<int,int> 	         pi;
typedef tuple<int, int, int>     ti;

#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))

int main()
{
	ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, m, k, a, b;
  cin >> n;
  vi r1(n);
  rep(i, 0, n-1, 1)
    cin >> r1[i];

  cin >> m;
  vi p1(m);
  rep(i, 0, m-1, 1)
    cin >> p1[i];

  cin >> k;
  vi p2(k);
  rep(i, 0, k-1, 1)
    cin >> p2[i];

  sort(all(r1));
  sort(all(p1));
  sort(all(p2));

  cin >> a >> b;
  long double x, y, d, ans=0;
  //rep(i, 0, n-1, 1){
    rep(j, 0, m-1, 1){
      //rep(l, 0, k-1, 1){
        x = b*p1[j]*r1[n-1]*r1[n-1], y = b*p1[j] + a*p2[0];
        d = x/y;
        d = sqrt(d);
        ans = max(ans, d);
      //}
    }
  //}
  printf("%.12Lf",ans);
}


/*
  compiler404
*/
#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define rep(i, x, y, s) for (int i = x; (x <= y ? i <= y : i >= y); i = (x <= y ? i + s : i - s))
#define fore(it, l) for (auto it = l.begin(); it != l.end(); it++)

typedef long long int ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;

#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, m, k, p1, p2, r1;
  int mr1 = 0, mp1 = 0, mp2 = 100000;

  cin >> n;
  rep(i, 0, n - 1, 1)
  {
    cin >> r1;
    mr1 = max(mr1, r1);
  }
  cin >> m;
  rep(i, 0, m - 1, 1)
  {
    cin >> p1;
    mp1 = max(mp1, p1);
  }
  cin >> k;
  rep(i, 0, k - 1, 1)
  {
    cin >> p2;
    mp2 = min(mp2, p2);
  }
  double a, b;
  cin >> a >> b;
  cout << fixed << setprecision(8) << (mr1 * sqrt((b * mp1) / (b * mp1 + a * mp2))) << "\n";
}


// Problem : B. Olympic Medal
// Contest : Codeforces - Codeforces Round #132 (Div. 2)
// URL : https://codeforces.com/contest/215/problem/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define all(a) a.begin(),a.end()
#define x first
#define y second
#define MOD 1000000007
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    // your code goes here
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,l;
    cin >> n;
    long double a,b;
    vector<long double> rad1(n);
    for(int i = 0;i<n;i++)cin >> rad1[i];
    cin >> m;
    vector<long double> density1(m);
    for(int i = 0;i<m;i++)cin >> density1[i];
    cin >> l;
    vector<long double> density2(l);
    for(int i = 0;i<l;i++)cin >> density2[i];
    cin >> a >> b;
    long double maxaR2 = -1;
    for(int i = 0;i<n;i++){
    	for(int j = 0;j<m;j++){
    		for(int k = 0;k<l;k++){
    			long double p1,p2,r1,r2;
        		r1 = rad1[i];
                p1 = density1[j];
                p2 = density2[k];
                r2 = sqrt(p1*b*r1*r1/(p1*b+p2*a));
                if(r2 > maxaR2){
                maxaR2 = r2;
                //cout << r1 << " " << p1 << " " << p2 << "\n";
                }
    		}
    	}
    }
     cout << setprecision(20) << maxaR2 << "\n";
    return 0;
}


// Problem : B. Olympic Medal
// Contest : Codeforces - Codeforces Round #132 (Div. 2)
// URL : https://codeforces.com/contest/215/problem/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define all(a) a.begin(),a.end()
#define x first
#define y second
#define MOD 1000000007
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    // your code goes here
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,l;
    cin >> n;
    long double a,b;
    vector<long double> rad1(n);
    long double p1=-1,p2=INF,r1=-1,r2;
    for(int i = 0;i<n;i++)cin >> rad1[i],r1 = max(r1,rad1[i]);
    cin >> m;
    vector<long double> density1(m);
    for(int i = 0;i<m;i++)cin >> density1[i],p1 = max(p1,density1[i]);
    cin >> l;
    vector<long double> density2(l);
    for(int i = 0;i<l;i++)cin >> density2[i],p2 = min(p2,density2[i]);
    cin >> a >> b;
    r2 = sqrt(p1*b*r1*r1/(p1*b+p2*a));

     cout << setprecision(20) << r2 << "\n";
    return 0;
}


/*
 ______   _________ _      _       _
|  ____ \|___   ___| |    | |     | |
| |    \ \   | |   | |____| |     | |
| |    | |   | |   |  ____  |     | |
| |____/ /___| |___| |    | |_____| |
|_______/|_________|_|    |_________|

*/
#include<bits/stdc++.h>
using namespace std;
#define ed end()
#define INF 1e18
#define fi first
#define se second
#define bg begin()
#define MAX 200001
#define si set<int>
#define sll set<ll>
#define ll long long
#define pb push_back
#define pf push_front
#define pi 3.14159265
#define spii set<pii>
#define mll map<ll,ll>
#define vll vector<ll>
#define vi vector<int>
#define vvi vector<vi>
#define MOD 1000000007
#define p_b pop_back()
#define p_f pop_front()
#define u_b upper_bound
#define l_b lower_bound
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define mii map<int,int>
#define mii map<int,int>
#define mci map<char,int>
#define pii pair<int,int>
#define mci map<char,int>
#define vd vector<double>
#define u_s unordered_set
#define u_m unordered_map
#define b_s binary_search
#define max_of max_element
#define min_of min_element
#define vtiii vector<tiii>
#define gcd(a,b) __gcd(a,b)
#define pstv(x) if(x<0) x=0
#define ngtv(x) if(x>0) x=0
#define read(x) for(auto &i:x)
#define visit(x) for(auto i:x)
#define usi unordered_set<int>
#define ull unsigned long long
#define print(a) cout<<a<<"\n"
#define printn(a) cout<<a<<endl
#define pqi priority_queue<int>
#define tiii tuple<int,int,int>
#define ptr(x) x.begin(),x.end()
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define str_in(x) string x; cin>>x
#define rptr(x) x.rbegin(),x.rend()
#define umii unordered_map<int,int>
#define umci unordered_map<char,int>
#define _for(i,a,n) for(i=a;i<n;i++)
#define for_(i,a,n) for(i=a;i>n;i--)
#define maxof(x)  max_element(ptr(x))
#define minof(x)  min_element(ptr(x))
#define _pow(a,b,c) ull c=1;for(;b--;c*=a)
#define srt(x) sort(x.begin(),x.begin()+n)
#define sum(x,s) ll s=0; for(auto i:x) s+=i
#define adjdif(x) for_(i,n-1,0) x[i]-=x[i-1]
#define ub(x,a) upper_bound(ptr(x),a)-x.begin()
#define lb(x,a) lower_bound(ptr(x),a)-x.begin()
#define rotate_l(x,a)  rotate(x.bg,x.bg+a,y.ed)
#define v_in(x,n) vll x(n);for(auto &i:x) cin>>i
#define bs(x,a) binary_search(ptr(x),a)-x.begin()
#define pre_sum(x) _for(i,1,x.size()) x[i]+=x[i-1]
#define rotate_r(x,a)  rotate(x.bg,x.bg+x.sz-a,y.ed)
#define FOR(i,x) for(auto i=x.begin();i!=x.end();i++)
#define out(x) for(auto i:x)  cout<<i<<" "; cout<<"\n"
#define outn(x) for(auto i:x) cout<<i<<" "; cout<<endl
#define ____ ios::sync_with_stdio(0);  cin.tie(nullptr);
#define vp_in(x,n) vpll x(n); for(auto &i:x) cin>>x.fi>>x.se
#define v_in2(x,y,n) vll x(n),y(n); _for(i,0,n) cin>>x[i]>>y[i]
#define s_in(x,n) sll x; for(i=0,int a;i<n,cin>>a;i++) x.insert(a)
#define m_in(x,n) mll x; for(i=0,int a,b;i<n,cin>>a>>b;i++) x[a]=b

float t,n,i,j,k,a,b,c,m,l,r,p1,p2,r1,r2,q,s;
void dihan()
{
    cin>>n; v_in(x,n); r1=*maxof(x);
    cin>>m; v_in(y,m); p1=*maxof(y);
    cin>>k; v_in(z,k); p2=*minof(z);

    //cout<<r1<<" "<<p1<<" "<<p2<<endl;
    cin>>a>>b;
    r2=sqrt((b*p1)/((a*p2)+(b*p1)))*r1;

    printf("%.12f\n",r2);
}

int main(){____ dihan();}


/*
 ______   _________ _      _       _
|  ____ \|___   ___| |    | |     | |
| |    \ \   | |   | |____| |     | |
| |    | |   | |   |  ____  |     | |
| |____/ /___| |___| |    | |_____| |
|_______/|_________|_|    |_________|

*/
#include<bits/stdc++.h>
using namespace std;
#define ed end()
#define INF 1e18
#define fi first
#define se second
#define bg begin()
#define MAX 200001
#define si set<int>
#define sll set<ll>
#define ll long long
#define pb push_back
#define pf push_front
#define pi 3.14159265
#define spii set<pii>
#define mll map<ll,ll>
#define vll vector<ll>
#define vi vector<int>
#define vvi vector<vi>
#define MOD 1000000007
#define p_b pop_back()
#define p_f pop_front()
#define u_b upper_bound
#define l_b lower_bound
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define mii map<int,int>
#define mii map<int,int>
#define mci map<char,int>
#define pii pair<int,int>
#define mci map<char,int>
#define vd vector<double>
#define u_s unordered_set
#define u_m unordered_map
#define b_s binary_search
#define max_of max_element
#define min_of min_element
#define vtiii vector<tiii>
#define gcd(a,b) __gcd(a,b)
#define pstv(x) if(x<0) x=0
#define ngtv(x) if(x>0) x=0
#define read(x) for(auto &i:x)
#define visit(x) for(auto i:x)
#define usi unordered_set<int>
#define ull unsigned long long
#define print(a) cout<<a<<"\n"
#define printn(a) cout<<a<<endl
#define pqi priority_queue<int>
#define tiii tuple<int,int,int>
#define ptr(x) x.begin(),x.end()
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define str_in(x) string x; cin>>x
#define rptr(x) x.rbegin(),x.rend()
#define umii unordered_map<int,int>
#define umci unordered_map<char,int>
#define _for(i,a,n) for(i=a;i<n;i++)
#define for_(i,a,n) for(i=a;i>n;i--)
#define maxof(x)  max_element(ptr(x))
#define minof(x)  min_element(ptr(x))
#define _pow(a,b,c) ull c=1;for(;b--;c*=a)
#define srt(x) sort(x.begin(),x.begin()+n)
#define sum(x,s) ll s=0; for(auto i:x) s+=i
#define adjdif(x) for_(i,n-1,0) x[i]-=x[i-1]
#define ub(x,a) upper_bound(ptr(x),a)-x.begin()
#define lb(x,a) lower_bound(ptr(x),a)-x.begin()
#define rotate_l(x,a)  rotate(x.bg,x.bg+a,y.ed)
#define v_in(x,n) vll x(n);for(auto &i:x) cin>>i
#define bs(x,a) binary_search(ptr(x),a)-x.begin()
#define pre_sum(x) _for(i,1,x.size()) x[i]+=x[i-1]
#define rotate_r(x,a)  rotate(x.bg,x.bg+x.sz-a,y.ed)
#define FOR(i,x) for(auto i=x.begin();i!=x.end();i++)
#define out(x) for(auto i:x)  cout<<i<<" "; cout<<"\n"
#define outn(x) for(auto i:x) cout<<i<<" "; cout<<endl
#define ____ ios::sync_with_stdio(0);  cin.tie(nullptr);
#define vp_in(x,n) vpll x(n); for(auto &i:x) cin>>x.fi>>x.se
#define v_in2(x,y,n) vll x(n),y(n); _for(i,0,n) cin>>x[i]>>y[i]
#define s_in(x,n) sll x; for(i=0,int a;i<n,cin>>a;i++) x.insert(a)
#define m_in(x,n) mll x; for(i=0,int a,b;i<n,cin>>a>>b;i++) x[a]=b

double t,n,i,j,k,a,b,c,m,l,r,p1,p2,r1,r2,q,s;
void dihan()
{
    cin>>n; v_in(x,n); r1=*maxof(x);
    cin>>m; v_in(y,m); p1=*maxof(y);
    cin>>k; v_in(z,k); p2=*minof(z);

    cin>>a>>b; r2=sqrt((b*p1)/((a*p2)+(b*p1)))*r1;
    printf("%.12f\n",r2);
}

int main(){____ dihan();}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define ff first
#define ss second
#define inp(a) int a; cin>>a;
#define inpa(a,n) vector<int>a(n+1); FOR(i,1,n) cin>>a[i];
#define PI 3.141592653589793238
#define QUICK ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vec(x) vector<x>
#define pii pair<int,int>
#define mem(a,b) memset(a, b, sizeof a)
#define FOR(i,j,n) for(int i= j; i<=n; i++)
#define CASE int t; cin>>t; while(t--)
#define setBits(n) __builtin_popcountll(n)
#define prec(n) fixed<<setprecision(n)
#define print(x) for(auto c : x) cout << c << " ";
#define dbg(x) cerr << #x << " :: "<< x << endl;
#define dbg2(x,y) cerr << #x << " :: "<<x <<"\t" << #y << " :: "<<y <<endl;
#define upcase(s)  transform(s.begin(), s.end(), s.begin(), ::toupper)
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//#define int ll
const int INF = 1e9;
const int MOD = 1e9 + 7;
//////////// template ends here //////////////////////////

void solve(){
	inp(n); inpa(x,n); inp(m); inpa(y,m); inp(k); inpa(z,k);
	inp(a); inp(b);

	ld r2 = 0, r1 = 0, d1=y[1] ,d2=z[1] ;

	FOR(i,1,n)
		r1 = max(x[i], (int)r1);

	FOR(i,1,m){
		d1 = max(y[i], (int)d1);
	}

	FOR(i,1,k){
		d2 = min((int)d2, z[i]);
	}

	 r1 *= r1;

	int num = b*d1*r1;
	int den = a*d2 + b*d1;
	dbg2(d1, d2)
	r2 = (ld)num / (ld)den;
	r2 = sqrt(r2);

	 cout <<prec(12)<< r2 << endl;
}

int32_t main(){
	#ifndef ONLINE_JUDGE
		freopen ("input.txt","r",stdin);
		freopen ("output.txt","w",stdout);
	 #endif
	QUICK;
	// start Here..EveryDay Counts..!!
	//CASE{
		solve();
	//}
	printclock;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define ff first
#define ss second
#define inp(a) int a; cin>>a;
#define inpa(a,n) vector<int>a(n+1); FOR(i,1,n) cin>>a[i];
#define PI 3.141592653589793238
#define QUICK ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vec(x) vector<x>
#define pii pair<int,int>
#define mem(a,b) memset(a, b, sizeof a)
#define FOR(i,j,n) for(int i= j; i<=n; i++)
#define CASE int t; cin>>t; while(t--)
#define setBits(n) __builtin_popcountll(n)
#define prec(n) fixed<<setprecision(n)
#define print(x) for(auto c : x) cout << c << " ";
#define dbg(x) cerr << #x << " :: "<< x << endl;
#define dbg2(x,y) cerr << #x << " :: "<<x <<"\t" << #y << " :: "<<y <<endl;
#define upcase(s)  transform(s.begin(), s.end(), s.begin(), ::toupper)
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define int ll
const int INF = 1e9;
const int MOD = 1e9 + 7;
//////////// template ends here //////////////////////////

void solve(){
	inp(n); inpa(x,n); inp(m); inpa(y,m); inp(k); inpa(z,k);
	inp(a); inp(b);

	ld r2 = 0, r1 = 0, d1=y[1] ,d2=z[1] ;

	FOR(i,1,n)
		r1 = max(x[i], (int)r1);

	FOR(i,1,m){
		d1 = max(y[i], (int)d1);
	}

	FOR(i,1,k){
		d2 = min((int)d2, z[i]);
	}

	r1 *= r1;

	int num = b*d1*r1;
	int den = a*d2 + b*d1;
	dbg2(d1, d2)
	r2 = (ld)num / (ld)den;
	r2 = sqrt(r2);

	cout <<prec(12)<< r2 << endl;
}

int32_t main(){
	#ifndef ONLINE_JUDGE
		freopen ("input.txt","r",stdin);
		freopen ("output.txt","w",stdout);
	 #endif
	QUICK;
	// start Here..EveryDay Counts..!!
	//CASE{
		solve();
	//}
	printclock;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define ff first
#define ss second
#define inp(a) int a; cin>>a;
#define inpa(a,n) vector<int>a(n+1); FOR(i,1,n) cin>>a[i];
#define PI 3.141592653589793238
#define QUICK ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vec(x) vector<x>
#define pii pair<int,int>
#define mem(a,b) memset(a, b, sizeof a)
#define FOR(i,j,n) for(int i= j; i<=n; i++)
#define CASE int t; cin>>t; while(t--)
#define setBits(n) __builtin_popcountll(n)
#define prec(n) fixed<<setprecision(n)
#define print(x) for(auto c : x) cout << c << " ";
#define dbg(x) cerr << #x << " :: "<< x << endl;
#define dbg2(x,y) cerr << #x << " :: "<<x <<"\t" << #y << " :: "<<y <<endl;
#define upcase(s)  transform(s.begin(), s.end(), s.begin(), ::toupper)
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//#define int ll
const int INF = 1e9;
const int MOD = 1e9 + 7;
//////////// template ends here //////////////////////////

void solve(){
	inp(n); inpa(x,n); inp(m); inpa(y,m); inp(k); inpa(z,k);
	inp(a); inp(b);

	ld r2 = 0, r1 = 0, ans = 0;

	FOR(i,1,n)
		r1 = max(x[i], (int)r1);
	 r1 *= r1;

	 FOR(i,1,m){
	 	FOR(j,1,k){
	 		int num = b*y[i]*r1;
	 		int den = a*z[j]  + b*y[i];
	 		r2 = (ld)num / (ld)den;
	 		r2 = sqrt(r2);
	 		ans = max(ans, r2);
	 	}
	 }
	 cout <<prec(12)<< ans << endl;
}

int32_t main(){
	#ifndef ONLINE_JUDGE
		freopen ("input.txt","r",stdin);
		freopen ("output.txt","w",stdout);
	 #endif
	QUICK;
	// start Here..EveryDay Counts..!!
	//CASE{
		solve();
	//}
	printclock;
}


#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <bits/stdc++.h>
#include <stdlib.h>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    std::ios::sync_with_stdio(false);
//    std::fstream fin("output.txt");
//    std::fstream fout("out.txt");
long double n,m,r1=0,p2=5001,a,b,k;
vector<long double> p1;
cin>>n;
while(n--)
{
    long double temp;
    cin>>temp;
    r1=max(temp,r1);
}
cin>>m;
while(m--)
{
    long double temp;
    cin>>temp;
    p1.push_back(temp);
}
cin>>k;
while(k--)
{
    long double temp;
    cin>>temp;
    p2=min(p2,temp);
}
cin>>a>>b;
long double anst=0;
for(int i=0;i<p1.size();i++)
{
    long double tmp=p1[i]/(b*p1[i]+a*p2);
    anst=max(anst,tmp);
}
long double ans=r1*sqrt(b*anst);
cout<<fixed<<setprecision(12)<<ans<<endl;

    return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <bits/stdc++.h>
#include <stdlib.h>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    std::ios::sync_with_stdio(false);
//    std::fstream fin("output.txt");
//    std::fstream fout("out.txt");
long double n,m,r1=0,p2=5001,a,b,k, p1=0;
cin>>n;
while(n--)
{
    long double temp;
    cin>>temp;
    r1=max(temp,r1);
}
cin>>m;
while(m--)
{
    long double temp;
    cin>>temp;
    p1=max(p1,temp);
}
cin>>k;
while(k--)
{
    long double temp;
    cin>>temp;
    p2=min(p2,temp);
}
cin>>a>>b;
long double anst=p1/(b*p1+a*p2);
long double ans=r1*sqrt(b*anst);
cout<<fixed<<setprecision(12)<<ans<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
   int n;
   cin>>n;
   vector <int> r1(n);

    for(int i=0;i<n;i++)
    {
        cin>>r1[i];
    }
    sort(r1.begin(),r1.end());
    int m;
   cin>>m;
   vector <int> p1(m);
    for(int i=0;i<m;i++)
    {
        cin>>p1[i];
    }
    sort(p1.begin(),p1.end());
    int k;
   cin>>k;
   vector <int> p2(k);
    for(int i=0;i<k;i++)
    {
        cin>>p2[i];
    }
    sort(p2.begin(),p2.end());
    int a,b;
    cin>>a>>b;
    double calc=sqrt( (double)(b*p1[m-1]*r1[n-1]*r1[n-1])/(double)(a*p2[0]+b*p1[m-1]));
    cout<<fixed<<setprecision(12)<< calc;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
   long long int n;
   cin>>n;
   vector <long int> r1(n);

    for(long long int i=0;i<n;i++)
    {
        cin>>r1[i];
    }
    sort(r1.begin(),r1.end());
    long long int m;
   cin>>m;
   vector <long int> p1(m);
    for(long long int i=0;i<m;i++)
    {
        cin>>p1[i];
    }
    sort(p1.begin(),p1.end());
    long long int k;
   cin>>k;
   vector <long int> p2(k);
    for(long long int i=0;i<k;i++)
    {
        cin>>p2[i];
    }
    sort(p2.begin(),p2.end());
    long long int a,b;
    cin>>a>>b;
    double calc=sqrt( (double)(b*p1[m-1]*r1[n-1]*r1[n-1])/(double)(a*p2[0]+b*p1[m-1]));
    cout<<fixed<<setprecision(12)<< calc;
}


#include <bits/stdc++.h>
using namespace std;
#define data_type int
#define endl "\n"
int main()
{
    int x,y,z;
    double r1=0,p2=50001.0,a,ans=0,A,B;

    cin>>x;
    while(x--)
        cin>>a, r1=max(r1,a);

    cin>>y;
    vector<double>arr(y);
    for(auto &i:arr)
        cin>>i;

    cin>>z;
    while(z--)
        cin>>a,p2=min(p2,a);

    cin>>A>>B;
    for(auto i:arr)
            ans=max(ans,sqrt((B*i)/((A*p2)+(B*i)))*r1);

    cout<<fixed<<setprecision(10)<<ans<<endl;

    return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define data_type int
#define endl "\n"
int main()
{
    int x,y,z;
    double r1=0,p2=50001.0,a,ans=0,A,B,p1=0;

    cin>>x;
    while(x--)
        cin>>a, r1=max(r1,a);

    cin>>y;
    while(y--)
        cin>>a,p1=max(p1,a);

    cin>>z;
    while(z--)
        cin>>a,p2=min(p2,a);

    cin>>A>>B;

    cout<<fixed<<setprecision(10)<<sqrt((B*p1)/((A*p2)+(B*p1)))*r1<<endl;

    return 0;

}


#include <vector>
#include <string>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <fstream>

#define frt(s, n, t) for(int i = s; (i > n && t < 0) || (i < n && t > 0); i += t)
#define fr(s, n) for (int i = s; i < n; i++)
#define eol "\n"

using namespace std;

typedef long long unsigned ull;
typedef long long ll;

typedef unordered_map<int, int> umii;
typedef unordered_set<int> usi;
typedef unordered_set<ll> usll;
typedef unordered_set<ull> usull;
typedef vector<int> vint;
typedef pair<string, int> psi;

int main() {
	cout.precision(20);
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	ll n, m, k, t;
	cin >> n;
	ll maxR1 = -1, maxP1 = -1, minP2 = 5005;
	fr(0, n) {
		cin >> t;
		maxR1 = max(maxR1, t);
	}
	cin >> m;
	fr(0, m) {
		cin >> t;
		maxP1 = max(maxP1, t);
	}
	cin >> k;
	fr(0, k) {
		cin >> t;
		minP2 = min(minP2, t);
	}
	ll a, b;
	cin >> a >> b;
	cout << sqrtl((maxR1*maxR1*maxP1) / (minP2*a / b + maxP1));
}


#include <vector>
#include <string>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <fstream>

#define frt(s, n, t) for(int i = s; (i > n && t < 0) || (i < n && t > 0); i += t)
#define fr(s, n) for (int i = s; i < n; i++)
#define eol "\n"

using namespace std;

typedef long long unsigned ull;
typedef long long ll;

typedef unordered_map<int, int> umii;
typedef unordered_set<int> usi;
typedef unordered_set<ll> usll;
typedef unordered_set<ull> usull;
typedef vector<int> vint;
typedef pair<string, int> psi;

int main() {
	cout.precision(20);
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	ll n, m, k, t;
	cin >> n;
	ll maxR1 = -1, maxP1 = -1, minP2 = 5005;
	fr(0, n) {
		cin >> t;
		maxR1 = max(maxR1, t);
	}
	cin >> m;
	fr(0, m) {
		cin >> t;
		maxP1 = max(maxP1, t);
	}
	cin >> k;
	fr(0, k) {
		cin >> t;
		minP2 = min(minP2, t);
	}
	ll a, b;
	cin >> a >> b;
	cout << sqrtl(double(maxR1*maxR1*maxP1) / (double(minP2*a) / b + maxP1));
}


#include <vector>
#include <string>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <fstream>

#define frt(s, n, t) for(int i = s; (i > n && t < 0) || (i < n && t > 0); i += t)
#define fr(s, n) for (int i = s; i < n; i++)
#define eol "\n"

using namespace std;

typedef long long unsigned ull;
typedef long long ll;

typedef unordered_map<int, int> umii;
typedef unordered_set<int> usi;
typedef unordered_set<ll> usll;
typedef unordered_set<ull> usull;
typedef vector<int> vint;
typedef pair<string, int> psi;

int main() {
	cout.precision(20);
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	ll n, m, k, t;
	cin >> n;
	ll maxR1 = -1, maxP1 = -1, minP2 = 5005;
	fr(0, n) {
		cin >> t;
		maxR1 = max(maxR1, t);
	}
	cin >> m;
	fr(0, m) {
		cin >> t;
		maxP1 = max(maxP1, t);
	}
	cin >> k;
	fr(0, k) {
		cin >> t;
		minP2 = min(minP2, t);
	}
	ll a, b;
	cin >> a >> b;
	cout << sqrtl(long double(maxR1*maxR1*maxP1) / (long double(minP2*a) / b + maxP1));
}


#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
typedef double db;
#define pii pair<int,int>
#define pll pair<long long,long long>
#define usi unordered_set<int>
#define usl unordered_set<long long>
#define umii unordered_map<int,int>
#define umsi unordered_map<string,int>
#define umll unordered_map<long long,long long>
#define fi first
#define sec second
#define pub push_back
#define pob pop_back
#define B begin
#define E end
#define mp make_pair
#define vi vector<int>
#define vl vector<long long>
#define vii vector<pii>
#define vll vector<pll>
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define endl '\n'
#define PIE 3.141592653
#define MOD 1000000007
#define f(i,a,b,c) for(ll i=a;i<=b;i+=c)
#define frev(i,n,b,c)  for(ll i=n;i>=b;i-=c)
const ll inf = 1000000000000000000;
using namespace std;

//            < = = = = =    GCD     = = = = = >

ll gcd(ll a,ll b)
{
	if(a<b)	gcd(b,a);
	if(b==0)	return a;
	return gcd(b,a%b);
}

//            < = = = = =    LCM     = = = = = >

ll lcm(ll a,ll b)
{
	ll x=(a/gcd(a,b))*b;
	return x;
}

//            < = = = = =    power  x^n     = = = = = >

ll power(ll x , ll n , ll m=inf){
	if(x==0){
		return 0;
	}
	if(n==0){
		return 1;
	}
	ll ans;
	if(n%2==0){
		ll smallAns = power(x,n/2,m);
		ans = (smallAns*smallAns)%m;
	} else {
		ll smallAns = power(x,n-1,m);
		ans = x;
		ans = (ans*smallAns)%m;
	}
	// for negative values also
	return (ans+m)%m;

}

//            < = = = = =    CHECK FOR PRIME     = = = = = >

bool isprime(int n){
   if(n==2){
        return true;
    }
    else if(n%2==0){
        return false;
    }
    else{
        for(int i=3;i*i<=n;i+=2){
            if(n%i==0){
                return false;
            }
        }
        return true;
    }
}

//            < = = = = =    SOLVE    = = = = = >

// bool cmp(pll x, pll y){
//     ll dx = min(2*(x.first),x.second)-min(x.first,x.second);
//     ll dy = min(2*(y.first),y.second)-min(y.first,y.second);
//     return dx>dy;
// }

// void rec(int ){
//     if(){

//         return;
//     }

//     return;
// }

int solve() {fastio
    int nr1,np1,np2;
    cin>>nr1;
    int r1[nr1];
    int mr1=INT_MIN;
    for (int i = 0; i < nr1; i++) {
        /* code */
        cin>>r1[i];
        if(r1[i]>mr1)mr1=r1[i];
    }
    cin>>np1;
    int p1[np1];
    int mp1=INT_MIN;
    for (int i = 0; i < np1; i++) {
        /* code */
        cin>>p1[i];
         if(p1[i]>mp1)mp1=p1[i];
    }
    cin>>np2;
    int p2[np2];
    int mp2=INT_MAX;
    for (int i = 0; i < np2; i++) {
        /* code */
        cin>>p2[i];
         if(p2[i]<mp2)mp2=p2[i];
    }
    double a,b;
    cin>>a>>b;
    double dmr1=mr1,dmp2=mp2,dmp1=mp1;
    //mr1 = mr1;
    double den =a/b;
    // cout<<den<<endl;
    double p2p1 = dmp2/dmp1;
    // cout<<p2p1<<endl;
    den = den*p2p1;
    // cout<<den<<endl;
    den = den + 1;
    //cout<<den<<endl;
    //den = den;
    //cout<<den<<endl;
    double r2 = dmr1*dmr1;
    r2 = r2/den;

    r2 = sqrt(r2);
    cout<<fixed<<setprecision(12)<<r2;
    return 0;
}

//            < = = = = =    MAIN     = = = = = >

int main() {fastio

 	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

    int t=1;
     // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
typedef double db;
#define pii pair<int,int>
#define pll pair<long long,long long>
#define usi unordered_set<int>
#define usl unordered_set<long long>
#define umii unordered_map<int,int>
#define umsi unordered_map<string,int>
#define umll unordered_map<long long,long long>
#define fi first
#define sec second
#define pub push_back
#define pob pop_back
#define B begin
#define E end
#define mp make_pair
#define vi vector<int>
#define vl vector<long long>
#define vii vector<pii>
#define vll vector<pll>
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define endl '\n'
#define PIE 3.141592653
#define MOD 1000000007
#define f(i,a,b,c) for(ll i=a;i<=b;i+=c)
#define frev(i,n,b,c)  for(ll i=n;i>=b;i-=c)
const ll inf = 1000000000000000000;
using namespace std;

//            < = = = = =    GCD     = = = = = >

ll gcd(ll a,ll b)
{
	if(a<b)	gcd(b,a);
	if(b==0)	return a;
	return gcd(b,a%b);
}

//            < = = = = =    LCM     = = = = = >

ll lcm(ll a,ll b)
{
	ll x=(a/gcd(a,b))*b;
	return x;
}

//            < = = = = =    power  x^n     = = = = = >

ll power(ll x , ll n , ll m=inf){
	if(x==0){
		return 0;
	}
	if(n==0){
		return 1;
	}
	ll ans;
	if(n%2==0){
		ll smallAns = power(x,n/2,m);
		ans = (smallAns*smallAns)%m;
	} else {
		ll smallAns = power(x,n-1,m);
		ans = x;
		ans = (ans*smallAns)%m;
	}
	// for negative values also
	return (ans+m)%m;

}

//            < = = = = =    CHECK FOR PRIME     = = = = = >

bool isprime(int n){
   if(n==2){
        return true;
    }
    else if(n%2==0){
        return false;
    }
    else{
        for(int i=3;i*i<=n;i+=2){
            if(n%i==0){
                return false;
            }
        }
        return true;
    }
}

//            < = = = = =    SOLVE    = = = = = >

// bool cmp(pll x, pll y){
//     ll dx = min(2*(x.first),x.second)-min(x.first,x.second);
//     ll dy = min(2*(y.first),y.second)-min(y.first,y.second);
//     return dx>dy;
// }

// void rec(int ){
//     if(){

//         return;
//     }

//     return;
// }

int solve() {fastio
    int nr1,np1,np2;
    cin>>nr1;
    int r1[nr1];
    int mr1=INT_MIN;
    for (int i = 0; i < nr1; i++) {
        /* code */
        cin>>r1[i];
        if(r1[i]>mr1)mr1=r1[i];
    }
    cin>>np1;
    int p1[np1];
    int mp1=INT_MIN;
    for (int i = 0; i < np1; i++) {
        /* code */
        cin>>p1[i];
         if(p1[i]>mp1)mp1=p1[i];
    }
    cin>>np2;
    int p2[np2];
    int mp2=INT_MAX;
    for (int i = 0; i < np2; i++) {
        /* code */
        cin>>p2[i];
         if(p2[i]<mp2)mp2=p2[i];
    }
    double a,b;
    cin>>a>>b;
    double dmr1=mr1,dmp2=mp2,dmp1=mp1;
    //mr1 = mr1;
    double den =a/b;
    cout<<den<<endl;
    double p2p1 = dmp2/dmp1;
    cout<<p2p1<<endl;
    den = den*p2p1;
    cout<<den<<endl;
    den = den + 1;
    cout<<den<<endl;
    //den = den;
    //cout<<den<<endl;
    double r2 = dmr1*dmr1;
    r2 = r2/den;

    r2 = sqrt(r2);
    cout<<fixed<<setprecision(12)<<r2;
    return 0;
}

//            < = = = = =    MAIN     = = = = = >

int main() {fastio

 	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

    int t=1;
     // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define present(container, element) (container.find(element) != container.end()
#define all(c) c.begin(), c.end()
#define cpresent(container, element) (find(all(container),element) != container.end())
#define tr(container, it) for(auto it = container.begin(); it != container.end(); it++)
using namespace std;
int main()
{
//declare variable type t
int n,m;
char c;
cin>>n>>m>>c;
char mat[n+2][m+2];
for(int i=0;i<(n+2);i++)
{
    for(int j=0;j<(m+2);j++)
    {
        mat[i][j]='.';
    }
}
vector <pair <int, int> > v;
set <char> deputy;
for(int i=1;i<=n;i++)
{
    for(int j=1;j<=m;j++)
    {
        cin>>mat[i][j];
        if(mat[i][j]==c)
        {
            v.push_back(make_pair(i,j));
        }
    }
}

for(int i=0;i<(n+2);i++)
{
    for(int j=0;j<(m+2);j++)
    {
        if(mat[i][j]==c)
        {
            if((mat[i-1][j]!='.') && (mat[i-1][j]!=c))
            {
                deputy.insert(mat[i-1][j]);
            }
            if((mat[i][j-1]!='.') && (mat[i][j-1]!=c))
            {
                deputy.insert(mat[i][j-1]);
            }
            if((mat[i+1][j]!='.') && (mat[i+1][j]!=c))
            {
                deputy.insert(mat[i+1][j]);
            }
            if((mat[i][j+1]!='.') && (mat[i][j+1]!=c))
            {
                deputy.insert(mat[i][j+1]);
            }
        }
    }
}
cout<<deputy.size();

return 0;
}


#include <bits/stdc++.h>
#define present(container, element) (container.find(element) != container.end()
#define all(c) c.begin(), c.end()
#define cpresent(container, element) (find(all(container),element) != container.end())
#define tr(container, it) for(auto it = container.begin(); it != container.end(); it++)
using namespace std;
int main()
{
//declare variable type t

int n;
cin>>n;
int r1=0;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    if(a>r1)
    r1=a;
}
int m;
cin>>m;
int p1=0;
for(int i=0;i<m;i++)
{
    int a;
    cin>>a;
    if(a>p1)
    p1=a;
}
int k;
cin>>k;
int p2=5000;
for(int i=0;i<k;i++)
{
    int a;
    cin>>a;
    if(p2>a)
    p2=a;
}
int A,B;
cin>>A>>B;
cout<<setprecision(15);
double numer = pow(r1,2);
long double denom = 1.0 + (((long double)A/(long double)B)*((long double)p2/(long double)p1));
long double num = numer/denom;
long double final = sqrt(num);
cout<<final;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5,MOD=1e9+7;
int a,b,m,n,k,i;
double c,mx,ans;
vector<double>x,y,z;
int main(){
    cin>>m;
    for(i=0;i<m;i++){
        cin>>c;
        x.push_back(c);
    }
    cin>>n;
    for(i=0;i<n;i++){
        cin>>c;
        y.push_back(c);
    }
    cin>>k;
    for(i=0;i<k;i++){
        cin>>c;
        z.push_back(c);
    }
    cin>>a>>b;
    for(double r1:x){
        for(double p1:y){
            for(double p2:z){
                mx=double(r1/sqrt(a*p2/(b*p1)+1));
                ans=double(max(ans,mx));
            }
        }
    }
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5,MOD=1e9+7;
int a,b,m,n,k,i;
double c,mx,ans;
vector<double>x,y,z;
int main(){
    cin>>m;
    for(i=0;i<m;i++){
        cin>>c;
        x.push_back(c);
    }
    cin>>n;
    for(i=0;i<n;i++){
        cin>>c;
        y.push_back(c);
    }
    cin>>k;
    for(i=0;i<k;i++){
        cin>>c;
        z.push_back(c);
    }
    cin>>a>>b;
    for(double r1:x){
        for(double p1:y){
            for(double p2:z){
                mx=double(r1/sqrt(a*p2/(b*p1)+1));
                ans=double(max(ans,mx));
            }
        }
    }
    cout << fixed << setprecision(9) << ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5,MOD=1e9+7;
int m,n,k,i;
double c,mx,ans,a,b;
vector<double>x,y,z;
int main(){
    cin>>m;
    for(i=0;i<m;i++){
        cin>>c;
        x.push_back(c);
    }
    cin>>n;
    for(i=0;i<n;i++){
        cin>>c;
        y.push_back(c);
    }
    cin>>k;
    for(i=0;i<k;i++){
        cin>>c;
        z.push_back(c);
    }
    cin>>a>>b;
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    sort(z.begin(),z.end());
    ans=x[m-1]/sqrt(a*z[0]/(b*y[n-1])+1);
    cout << fixed << setprecision(9) << ans<<endl;
    return 0;
}


//Author : Abhishek Yadav
#include <bits/stdc++.h>
#define endl "\n"
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(ll i=0;i<(n);++i)
#define repA(i,a,n) for(ll i=a;i<=(n);++i)
#define repD(i,a,n) for(ll i=a;i>=(n);--i)

using namespace std;
using ll = long long;

void solve()
{
	int n;
	cin >> n;
	int r1[n];
	rep(i, n)cin >> r1[i];
	int m; cin >> m;
	int dout[m];
	rep(i, m)cin >> dout[i];
	int k; cin >> k;
	int din[k];
	rep(i, k)cin >> din[i];
	int A, B;
	cin >> A >> B;

	double res = 0;
	rep(a, n)
	{
		rep(b, m)
		{
			rep(c, k)
			{
				double temp = sqrt((double)(B * r1[a] * r1[a] * dout[b]) / (A * din[c] + B * dout[b]));
				res = max(res, temp);
			}
		}
	}

	cout << fixed << setprecision(12) << res;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

#ifndef ONLINE_JUDGE

	// For getting input from input.txt file
	freopen("input.txt", "r", stdin);

	// Printing the Output to output.txt file
	freopen("output.txt", "w", stdout);

#endif

	ll t = 1;
	//cin>>t;
	while (t--)
		solve();
	return 0;
}


//Author : Abhishek Yadav
#include <bits/stdc++.h>
#define endl "\n"
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(ll i=0;i<(n);++i)
#define repA(i,a,n) for(ll i=a;i<=(n);++i)
#define repD(i,a,n) for(ll i=a;i>=(n);--i)

using namespace std;
using ll = long long;

void solve()
{
	int n;
	cin >> n;
	int r1[n];
	int maxr1 = -1;
	rep(i, n) {cin >> r1[i]; maxr1 = max(r1[i], maxr1);}
	int m; cin >> m;
	int dout[m];
	rep(i, m)cin >> dout[i];
	int k; cin >> k;
	int din[k];
	rep(i, k)cin >> din[i];
	int A, B;
	cin >> A >> B;

	double res = 0;

	rep(b, m)
	{
		rep(c, k)
		{
			double temp = maxr1 * sqrt((double)(B * dout[b]) / (A * din[c] + B * dout[b]));
			res = max(res, temp);
		}
	}

	cout << fixed << setprecision(12) << res;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

#ifndef ONLINE_JUDGE

	// For getting input from input.txt file
	freopen("input.txt", "r", stdin);

	// Printing the Output to output.txt file
	freopen("output.txt", "w", stdout);

#endif

	ll t = 1;
	//cin>>t;
	while (t--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long int lld;
#define FastIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
double getComb (double n, double x){
    if (x > n){
        return 0;
    }
    else{
        double r = 1.0;
        for(double i = 1.0; i<=x; i += 1){
            double a = n-i+1;
            double b = a / i;
            r*=b;
        }
        return r;
    }
}
void merge(lld brr[], lld arr[], lld l, lld m, lld r){
    lld i , j ,  k;
    lld n1 = m-l+1;
    lld n2 = r - m;
    lld L1[n1],L2[n1];
    lld R1[n2],R2[n2];
    for (i = 0; i < n1; i++){
        L1[i] = arr[l + i];
        L2[i] = brr[l + i];
    }
    for (j = 0; j < n2; j++){
        R1[j] = arr[m+1+j];
        R2[j] = brr[m+1+j];
    }
    i = 0;
    j = 0;
    k = l;
    while (i < n1 && j < n2)
    {
        if (L1[i] <= R1[j]){
            arr[k] = L1[i];
            brr[k] = L2[i];
            i++;
        }
        else{
            arr[k] = R1[j];
            brr[k] = R2[j];
            j++;
        }
        k++;
    }
        while (i   <   n1){
            arr[k] = L1[i];
            brr[k] = L2[i];
            i++;
            k++;
        }
        while (j   <   n2){
            arr[k] = R1[j];
            brr[k] = R2[j];
            j++;
            k++;
        }
}
void mergeSort(lld brr[], lld arr[], lld l, lld r){
    if (l < r)
    {
        lld m = l+(r-l)/2;
        mergeSort(brr, arr,l, m);
        mergeSort(brr,arr,m+1,r);
        merge(brr, arr, l, m, r);
    }
}
int main () {
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("inputf.in",  "r",  stdin);
    // for writing output to output.txt
    freopen("outputf.in", "w", stdout);
    #endif
    FastIO
    lld n, m;
    lld k, i;
    lld A, B;
    cin >> n;
    lld j;
    double X[n];
    for(i = 0; i<n; i+=1){
        cin >>X[i];
    }
    cin >> m;
    double Y[m];
    for(i = 0; i<m; i+=1){
        cin >>Y[i];
    }
    cin >> k;
    double Z[k];
    for(i = 0; i<k; i+=1){
        cin >>Z[i];
    }
    cin >> A;
    cin >> B;
    double max_rad = X[0];
    for(i = 0; i<n; i+=1){
        if (X[i]>max_rad){
            max_rad= X[i];
        }
    }
    double max = (B*Y[0])/((B*Y[0])+(A*Z[0]));
    for(i = 0; i<m; i+=1){
    for(j = 0; j<k; j+=1){
        if ((B*Y[i])/((B*Y[i])+(A*Z[j]))>max){
            max =(B*Y[i])/((B*Y[i])+(A*Z[j]));
        }
    }
    }
    cout << fixed << setprecision(12) << sqrt(pow(max_rad, 2) * max) << "\n";
    return 0;
}


// みなさん私はカーティキー・シャルマです。LNMIITで勉強しています。私は2年目で、コロナパンデミックが発
// 生しています。世界は終わりそうだ。だから私はそれを最大限に生きたいと思っています。それはつまり、コー
// ドを最大限に意味しているのです。私の好きなアニメは「キメツノヤイバ」で、私の一番の男の子はゼニツで、
// 私の一番の女の子はネズコです。私の好きな呼吸スタイルは息吹です。私の最高の悪魔の血の芸術は、
// ククシボによって使用される月の息です。ムーザンは亡くなり、今ではタンジローがポップの新しい魔王です。
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(lld i = 0; i < n; i+=1)
#define fod(i,n) for(lld i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main ()
{
      #ifndef ONLINE_JUDGE
      freopen("inputf.in",  "r",   stdin);
      freopen("outputf.in", "w",  stdout);
      #endif
      FastIO
      lld n;
      cin >> n;
      vector <dbl> x, y, z;
      for(lld i = 0; i < n; i += 1){
      	dbl r;
      	cin >> r;
      	x.push_back(r);
      }
      lld m;
      cin >> m;
      for(lld i = 0; i < m; i += 1){
      	dbl r;
      	cin >> r;
      	y.push_back(r);
      }
      lld k;
      cin >> k;
      for(lld i = 0; i < k; i += 1){
      	dbl r;
      	cin >> r;
      	z.push_back(r);
      }
      dbl a, b;
      cin >> a >> b;
      sort(x.begin(), x.end());
      dbl r1 = x[n-1];
      dbl max = std::numeric_limits<dbl>::min();
      for(lld i = 0; i < m; i += 1){
      	for(lld j = 0; j < k; j += 1){
      		dbl w = (b*y[i])/((b*y[i])+(a*z[j]));
      		if (w > max){
      			max=w;
      		}
      	}
      }
      cout << fixed << setprecision(12) << (sqrt(max)*r1) << "\n";
      return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<bool> vb;

const int MAX=5005;

int x[MAX], y[MAX], z[MAX];

int main(){
    ios::sync_with_stdio(false); cin.tie(0);

    int n,m,k,a,b;

    cin >> n;
    for(int i=0; i<n; i++)
        cin >> x[i];

    cin >> m;
    for(int i=0; i<m; i++)
        cin >> y[i];

    cin >> k;
    for(int i=0; i<k; i++)
        cin >> z[i];

    cin >> a >> b;

    int r1, r2, p1, p2;

    r1 = *max_element(x, x+n);
    p1 = *max_element(y, y+m);
    p2 = *min_element(z, z+k);

    long double ans = r1 * 1.0 * sqrt((p1*b*1.0)/(p1*b+p2*a*1.0));

    cout.precision(12);
    cout << fixed << ans << '\n';

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<bool> vb;

const int MAX=5005;

int x[MAX], y[MAX], z[MAX];

int main(){
    ios::sync_with_stdio(false); cin.tie(0);

    int n,m,k,a,b;

    cin >> n;
    for(int i=0; i<n; i++)
        cin >> x[i];

    cin >> m;
    for(int i=0; i<m; i++)
        cin >> y[i];

    cin >> k;
    for(int i=0; i<k; i++)
        cin >> z[i];

    cin >> a >> b;

    int r1, r2, p1, p2;

    r1 = *max_element(x, x+n);
    p1 = *max_element(y, y+m);
    p2 = *min_element(z, z+k);

    double ans = sqrt((r1*r1*p1*b*1.0)/(p1*b+p2*a*1.0));

    cout.precision(12);
    cout << fixed << ans << '\n';

    return 0;
}


#include<bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
#define loop(x,s,n) for(int x = s; x < n; x++)
using namespace std;
int32_t max_elem(int arr[],int n){
    int res=INT_MIN;
    loop(i,0,n){
        if(res<arr[i])
            res=arr[i];
    }
    return res;
}
int32_t min_elem(int arr[],int n){
    int res=INT_MAX;
    loop(i,0,n){
        if(res>arr[i])
            res=arr[i];
    }
    return res;
}

int32_t main(){
    int r1,p1,p2;
    cin>>r1;
    int r1v[r1];
    loop(i,0,r1){
        cin>>r1v[i];
    }
    cin>>p1;
    int p1v[p1];
    loop(i,0,p1){
        cin>>p1v[i];
    }
    cin>>p2;
    int p2v[p2];
    loop(i,0,p2){
        cin>>p2v[i];
    }
    double A,B;
    cin>>A>>B;
    int max_r1 = max_elem(r1v,r1);
    int min_p2 = min_elem(p2v,p2);
    int max_p1 = max_elem(p1v,p1);
    // cout<<max_r1<<" "<<min_p2<<" "<<max_p1<<endl;
    // cout<<min_p2*A/B/max_p1<<endl;
    double ans = max_r1 * sqrt(1/(1+min_p2*A/B/max_p1));
    cout<<setprecision(12)<<ans<<endl;
}


#include<bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
#define loop(x,s,n) for(int x = s; x < n; x++)
using namespace std;
int32_t max_elem(int arr[],int n){
    int res=INT_MIN;
    loop(i,0,n){
        if(res<arr[i])
            res=arr[i];
    }
    return res;
}
int32_t min_elem(int arr[],int n){
    int res=INT_MAX;
    loop(i,0,n){
        if(res>arr[i])
            res=arr[i];
    }
    return res;
}

int32_t main(){
    int r1,p1,p2;
    cin>>r1;
    int r1v[r1];
    loop(i,0,r1){
        cin>>r1v[i];
    }
    cin>>p1;
    int p1v[p1];
    loop(i,0,p1){
        cin>>p1v[i];
    }
    cin>>p2;
    int p2v[p2];
    loop(i,0,p2){
        cin>>p2v[i];
    }
    float A,B;
    cin>>A>>B;
    int max_r1 = max_elem(r1v,r1);
    int min_p2 = min_elem(p2v,p2);
    int max_p1 = max_elem(p1v,p1);
    // cout<<max_r1<<" "<<min_p2<<" "<<max_p1<<endl;
    // cout<<min_p2*A/B/max_p1<<endl;
    float ans = max_r1 * sqrt(1/(1+min_p2*A/B/max_p1));
    cout<<ans<<endl;
}


#include <iostream>
#include<cmath>
#include<string>
#include <iomanip>
#include<algorithm>
#include<vector>
using namespace std;
int r1[100000];
int p1[100000];
int p2[100000];
int main(void){
cin.tie(0),iostream::sync_with_stdio(0);
int n,m,k;
cin>>n;
for(int i=0;i<n;i++)
    cin>>r1[i];
cin>>m;
for(int i=0;i<m;i++)
    cin>>p1[i];
cin>>k;
for(int i=0;i<k;i++)
    cin>>p2[i];
sort(r1,r1+n);
sort(p1,p1+m);
sort(p2,p2+k);
double A,B,c;
cin>>A>>B;
c=A/B;
double r2=(p1[m-1]*r1[n-1]*r1[n-1])/(c*p2[0]+p1[m-1]);
r2=sqrt(r2);
cout<<fixed<<setprecision(12)<<r2;

}