#include <bits/stdc++.h>   using namespace std;   bool comp(pair<int, int> a, pair<int, int> b) {     if (a.second < b.second) return true;     return false;   }   bool com(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     long long n, k;     cin >> n >> k;     vector<long long> ar(n);     vector<pair<long long, long long> > br(n);     for (long long i = 0; i < n; ++i) cin >> ar[i], br[i] = {ar[i], i};     sort(br.begin(), br.end(), com);     br.resize(k);     sort(br.begin(), br.end(), comp);     long long mx = br[0].first, sec = 1;     for (long long i = 1; i < br.size(); ++i) {       mx += br[i].first;       sec = (sec * (br[i].second - br[i - 1].second)) % 998244353;     }     cout << mx <<     << sec;     return 0;   }   