http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=558
//1828057 2009-04-10 20:14:44 Accepted  1558 C++ 0 184 aslys 
//很悬
#include<iostream>
#include
<queue>
using namespace std;
int corns[7],f[101];

void fun()
{
    
int i,k;
    queue
<int>Q;
    
for(i=1;i<=6;i++)
        Q.push(corns[i]);
    
while(!Q.empty())
    
{
        k 
= Q.front();
        Q.pop();
        
for(i=1;i<k;i++)  
        
{
            
if(f[k-i] > f[k]+f[i])
            
{
                f[k
-i] = f[k]+f[i];
                Q.push(k
-i);
            }

        }

        
for(i=k+1;i<=100;i++)
        
{
            
if(f[i-k] > f[k]+f[i])
            
{
                f[i
-k] = f[k]+f[i];
                Q.push(i
-k);
            }

        }

        
for(i=1;i<=100;i++)
        
{
            
if(i+<=100)
            
{
                
if(f[i+k] > f[k]+f[i])
                
{
                    f[i
+k] = f[k]+f[i];
                    Q.push(i
+k);
                }

            }

            
else
                
break;
        }

    }

}

int main()
{
    
int t;
    cin
>>t;
    
while(t--)
    
{
        
int i,sum=0,maxs=1;
        cin
>>corns[1]>>corns[2]>>corns[3]>>corns[4]>>corns[5]>>corns[6];
        
//六种货币
        for(i=1;i<=100;i++)
            f[i]
=i;
        
for(i=1;i<=6;i++)
            f[corns[i]]
=1;
        fun();
        
for(i=1;i<=100;i++)
        
{
            
if(f[i] > maxs)
                maxs 
= f[i];
            sum
+=f[i];
        }

        printf(
"%.2lf %d\n",(double)sum/100.0,maxs);
    }

    
return 0;
}