library_checker/math/
convolution_mod.rs

1use competitive::prelude::*;
2#[doc(no_inline)]
3pub use competitive::{
4    math::{Convolve998244353, ConvolveSteps},
5    num::{MInt, montgomery::MInt998244353},
6};
7
8#[verify::library_checker("convolution_mod")]
9pub fn convolution_mod(reader: impl Read, mut writer: impl Write) {
10    let s = read_all_unchecked(reader);
11    let mut scanner = Scanner::new(&s);
12    scan!(scanner, n, m, a: [MInt998244353; n], b: [MInt998244353; m]);
13    let c = Convolve998244353::convolve(a, b);
14    iter_print!(writer, @it c);
15}