<?php                                                                                                                                                          
                                                                                                                                                               
function fget_array()                                                                                                                                          
{                                                                                                                                                              
    return explode(' ', trim(fgets(STDIN)));                                                                                                                   
}                                                                                                                                                              
                                                                                                                                                               
$num = fget_array();                                                                                                                                           
$result = 0;                                                                                                                                                   
$i = 0;                                                                                                                                                        
foreach (fget_array() as $a) {                                                                                                                                 
    if ($i >= $num[0]) break;                                                                                                                                  
    if (empty($a)) continue;                                                                                                                                   
    $result += 1 / $a;                                                                                                                                         
    $i++;                                                                                                                                                      
}                                                                                                                                                              
$result = 1 / $result;                                                                                                                                         
echo $result.PHP_EOL; 