use std::io::*; fn rec(sai: &[usize], res: &mut Vec, v: usize, c: usize, n: usize) { if c == n { res.push(v); return; } for i in 0..sai.len() { rec(&sai, res, v * sai[i], c + 1, n); } } fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let p: usize = itr.next().unwrap().parse().unwrap(); let c: usize = itr.next().unwrap().parse().unwrap(); let sai1: Vec = [2, 3, 5, 7, 11, 13].to_vec(); let sai2: Vec = [4, 6, 8, 9, 10, 12].to_vec(); let mut ans = 0; let all = 6usize.pow((p + c) as u32); let mut a = Vec::new(); let mut b = Vec::new(); rec(&sai1, &mut a, 1, 0, p); rec(&sai2, &mut b, 1, 0, c); for i in 0..a.len() { for j in 0..b.len() { ans += a[i] * b[j]; } } println!("{:.10}", ans as f64 / all as f64); }