#include #if __has_include() #include #endif using namespace std; #define done(...) return pp(__VA_ARGS__) #define LL(...) ll __VA_ARGS__;lin(__VA_ARGS__) #define defpp templatevoid pp(const auto&...a){[[maybe_unused]]const char*c="";((o<(a...);} #define entry defpp void main();void main2();}int main(){my::io();my::main();}namespace my{ #define use_ml998244353 using ml=atcoder::modint998244353; namespace my{ auto&operator<<(ostream&o,const atcoder::modint998244353&x){return o<<(int)x.val();} void io(){cin.tie(nullptr)->sync_with_stdio(0);cout<>...>>a);} constexpr auto square(auto x){return x*x;} constexpr auto cube(auto x){return x*x*x;} bool amax(auto&a,const auto&b){return aT-S)done(0); amax(U,0); ll F=T-S; use_ml998244353 ml ans=0; ans+=cube(F)/6; ans+=square(F); ans-=ml(F)*U*U/2; ans-=ml(F)*U/2; ans+=ml(F)*11/6; ans+=cube(U)/3; ans-=square(U)/2; ans-=ml(U)*5/6; ans+=1; pp(ans); }}