Can someone help me with this problem?
You are given a permutation p of numbers from 1 to n. You are allowed to make the following operation: for an integer i (1<=i<=n-1), swap i and i+1. A permutation Q is beautiful if qi is different from i for every 1<=i<=n. Call g(p) the minimum number of operations to make permutation p beautiful. Calculate the sum of f(p)^2 for every permutation p modulo 998244353.
Input: Contains a single line consisting of only integer n (1<=n<=2e5)
Output: Calculate the sum modulo 998244353
Sample:
Input: 4
Output: 27