leha planning journey Moscow Saratov he hate train decide city carthe path Moscow Saratov represent straight line straight reality problem consider straight distance Moscow Saratov n km Lets Moscow situate point coordinate 0 km Saratov coordinate n kmdrive long time difficult Formally Leha cover kilometer stop rest consider difficulty cover 1th kilometer a_i 1 it guarantee 1 n 1 a_i le a_i 1 the difficulty journey denote sum difficulty kilometer journeyfortunately rest site Moscow Saratov every integer point 1 n 1 contain rest site when Leha enter rest site rest kilometer difficulty a_1 kilometer difficulty a_2 onFor example n 5 rest site coordinate 2 difficulty journey 2a_1 2a_2 a_3 kilometer difficulty a_1 second a_2 Leha rest kilometer difficulty a_1 fourth a_2 a_3 another example n 7 rest site coordinate 1 5 difficulty Lehas journey 3a_1 2a_2 a_3 a_4Leha do not know integer point contain rest site so consider possible situation obviously 2n 1 different distribution rest site distribution different exist point x contain rest site exactly distribution Leha consider distribution equiprobable he want calculate p expect value difficulty journeyobviously p cdot 2n 1 integer number you calculate modulo 998244353