use crate::Solution;
use pmath::isqrt;
problem!(Problem0100, 100, "Arranged Probability");
impl Solution for Problem0100 {
fn solve(&self) -> String {
let min_c = u64::try_from(isqrt(2 * 10u128.pow(24) - 2 * 10_u128.pow(12) + 1) + 1)
.expect("Overflow");
let mut d = 1;
let mut c = 1;
while c < min_c || c % 2 == 0 {
(d, c) = (3 * d + 4 * c, 2 * d + 3 * c);
}
let b = c.div_ceil(2);
b.to_string()
}
}