use std::io; fn main() { let mut input = String::new(); io::stdin().read_line(&mut input).expect("Failed to read input"); let q: usize = input.trim().parse().expect("Invalid input"); let mut ans: Vec = vec![-1.0; q]; for tests in 0..q { let mut input = String::new(); io::stdin().read_line(&mut input).expect("Failed to read input"); let mut numbers = input.split_whitespace().map(|s| s.parse::().expect("Invalid input")); let a: f64 = numbers.next().unwrap(); let b: f64 = numbers.next().unwrap(); let t: f64 = numbers.next().unwrap(); if a == 0.0 { ans[tests] = f64::powf(2.718281828459045, f64::powf(t, 1.0 / b)); continue; } if b == 0.0{ ans[tests] = f64::powf(t, 1.0 / a); continue; } let mut max = 10.0; let mut min = 0.0; let epsilon = 1e-9; while max - min > epsilon { let mid = (max + min) / 2.0; if f64::powf(mid, a/b) * f64::ln(mid) > f64::powf(t, 1.0/b) { max = mid; } else { min = mid; } } ans[tests] = (max + min) / 2.0; } println!("{}", ans.iter().map(|&x| x.to_string()).collect::>().join("\n")); }