#include<bits/stdc++.h>
#include<cstdio>

#define deb(x) cout << #x << " -> " << x << el
#define db double
#define ll long long int
#define ld long double
#define ull unsigned long long int
#define sc(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define sclu(x) scanf("%llu", &x)
#define scd(x) scanf("%lf", &x)
#define scld(x) scanf("%Lf", &x)
#define pass cout<<"pass\n"
#define vi vector<int>
#define eb emplace_back
#define pb push_back
#define vec vector
#define el "\n"
#define pii pair<int, int>
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define f(i,x,y) for(int i=x;i<y;++i)
#define ff(i,x,y) for(int i=x;i<=y;++i)
#define mem(x) memset(x, 0, sizeof(x))
#define mems(x,y) memset(x, y, sizeof(x))
#define MOD 998244353
#define MAX 200005

using namespace std;

int n, k, x;
pii val[MAX];

void solve() {
	sc(n); sc(k);
	for(int i = 0; i < n; ++i) {
		sc(x);
		val[i] = { x, i + 1 };
	}

	sort(val, val + n, [](pii &a, pii &b) -> bool {
		return a.F >= b.F;
	});
	sort(val, val + k, [](pii &a, pii &b) -> bool {
		return a.S < b.S;
	});

	ll ans = 1LL, sum = 1LL * val[0].F;
	for(int i = 1; i < k; ++i) {
		sum = (0LL + sum + val[i].F) % MOD;
		ll gap = val[i].S - val[i - 1].S;
		ans = (1LL * ans * gap) % MOD;
	}
	cout << sum << " " << ans << el;
}

int main() {
	// clock_t start = clock();
	// freopen("./input.in", "r", stdin);
	int tt = 1;
	// sc(tt);
	while(tt--) {
		solve();
	}
	// clock_t finish = clock();
	// printf("Time taken: %0.9lf sec\n", (double)((finish - start)) / CLOCKS_PER_SEC);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int k,n;
    long sum=0,s=-1;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
        cin>>p[i];
    for(i=0;i<n;i++)
    {
        if(p[i]>=n-k+1)
        {
            if(s!=-1)
            {
                prod*=1LL * (i-s) % 998244353;
            }
            s=i;
            sum+=p[i];
        }
    }
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int k,n;
    long long sum=0,s=-1;
    int prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
        cin>>p[i];
    for(i=0;i<n;i++)
    {
        if(p[i]>=n-k+1)
        {
            if(s!=-1)
            {
                prod=1LL * prod * (i-s) % 998244353;
            }
            s=i;
            sum+=p[i];
        }
    }
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int partition(int arr[], int l, int r, int k);

// A simple function to find median of arr[].  This is called
// only for an array of size 5 in this program.
int findMedian(int arr[], int n)
{
    sort(arr, arr+n);  // Sort the array
    return arr[n/2];   // Return middle element
}

// Returns k'th smallest element in arr[l..r] in worst case
// linear time. ASSUMPTION: ALL ELEMENTS IN ARR[] ARE DISTINCT
int kthSmallest(int arr[], int l, int r, int k)
{
    // If k is smaller than number of elements in array
    if (k > 0 && k <= r - l + 1)
    {
        int n = r-l+1; // Number of elements in arr[l..r]

        // Divide arr[] in groups of size 5, calculate median
        // of every group and store it in median[] array.
        int i, median[(n+4)/5]; // There will be floor((n+4)/5) groups;
        for (i=0; i<n/5; i++)
            median[i] = findMedian(arr+l+i*5, 5);
        if (i*5 < n) //For last group with less than 5 elements
        {
            median[i] = findMedian(arr+l+i*5, n%5);
            i++;
        }

        // Find median of all medians using recursive call.
        // If median[] has only one element, then no need
        // of recursive call
        int medOfMed = (i == 1)? median[i-1]:
                                 kthSmallest(median, 0, i-1, i/2);

        // Partition the array around a random element and
        // get position of pivot element in sorted array
        int pos = partition(arr, l, r, medOfMed);

        // If position is same as k
        if (pos-l == k-1)
            return arr[pos];
        if (pos-l > k-1)  // If position is more, recur for left
            return kthSmallest(arr, l, pos-1, k);

        // Else recur for right subarray
        return kthSmallest(arr, pos+1, r, k-pos+l-1);
    }

    // If k is more than number of elements in array
    return INT_MAX;
}

void swap(int *a, int *b)
{
    int temp = *a;
    *a = *b;
    *b = temp;
}

// It searches for x in arr[l..r], and partitions the array
// around x.
int partition(int arr[], int l, int r, int x)
{
    // Search for x in arr[l..r] and move it to end
    int i;
    for (i=l; i<r; i++)
        if (arr[i] == x)
           break;
    swap(&arr[i], &arr[r]);

    // Standard partition algorithm
    i = l;
    for (int j = l; j <= r - 1; j++)
    {
        if (arr[j] <= x)
        {
            swap(&arr[i], &arr[j]);
            i++;
        }
    }
    swap(&arr[i], &arr[r]);
    return i;
}

int main()
{
    int k,n;
    long sum=0;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    int s[n];
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
    {
        cin>>p[i];
        s[i]=p[i];
    }
    i=kthSmallest(s, 0, n-1, n-k);
    int count=0;
    for(i=n-k;i<n;i++)
    {
        sum+=s[i];
        it=find(p.begin(),p.end(),s[i]);
        index[count++]=it-p.begin();
    }

    sort(index.begin(),index.end());
    for(i=0;i<k-1;i++)
    {
        prod*=index[i+1]-index[i];
        prod%=998244353;
    }
    prod%=998244353;
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int partition(int arr[], int l, int r, int k);

// A simple function to find median of arr[].  This is called
// only for an array of size 5 in this program.
int findMedian(int arr[], int n)
{
    sort(arr, arr+n);  // Sort the array
    return arr[n/2];   // Return middle element
}

// Returns k'th smallest element in arr[l..r] in worst case
// linear time. ASSUMPTION: ALL ELEMENTS IN ARR[] ARE DISTINCT
int kthSmallest(int arr[], int l, int r, int k)
{
    // If k is smaller than number of elements in array
    if (k > 0 && k <= r - l + 1)
    {
        int n = r-l+1; // Number of elements in arr[l..r]

        // Divide arr[] in groups of size 5, calculate median
        // of every group and store it in median[] array.
        int i, median[(n+4)/5]; // There will be floor((n+4)/5) groups;
        for (i=0; i<n/5; i++)
            median[i] = findMedian(arr+l+i*5, 5);
        if (i*5 < n) //For last group with less than 5 elements
        {
            median[i] = findMedian(arr+l+i*5, n%5);
            i++;
        }

        // Find median of all medians using recursive call.
        // If median[] has only one element, then no need
        // of recursive call
        int medOfMed = (i == 1)? median[i-1]:
                                 kthSmallest(median, 0, i-1, i/2);

        // Partition the array around a random element and
        // get position of pivot element in sorted array
        int pos = partition(arr, l, r, medOfMed);

        // If position is same as k
        if (pos-l == k-1)
            return arr[pos];
        if (pos-l > k-1)  // If position is more, recur for left
            return kthSmallest(arr, l, pos-1, k);

        // Else recur for right subarray
        return kthSmallest(arr, pos+1, r, k-pos+l-1);
    }

    // If k is more than number of elements in array
    return INT_MAX;
}

void swap(int *a, int *b)
{
    int temp = *a;
    *a = *b;
    *b = temp;
}

// It searches for x in arr[l..r], and partitions the array
// around x.
int partition(int arr[], int l, int r, int x)
{
    // Search for x in arr[l..r] and move it to end
    int i;
    for (i=l; i<r; i++)
        if (arr[i] == x)
           break;
    swap(&arr[i], &arr[r]);

    // Standard partition algorithm
    i = l;
    for (int j = l; j <= r - 1; j++)
    {
        if (arr[j] <= x)
        {
            swap(&arr[i], &arr[j]);
            i++;
        }
    }
    swap(&arr[i], &arr[r]);
    return i;
}

int main()
{
    int k,n;
    long sum=0;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    int s[n];
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
    {
        cin>>p[i];
        s[i]=p[i];
    }
    i=kthSmallest(s, 0, n-1, k-1);
    for(i=k-1;i<n;i++)
    {
        sum+=s[i];
        it=find(p.begin(),p.end(),s[i]);
        index[i]=it-p.begin();
    }
    sort(index.begin(),index.end());
    for(i=0;i<k-1;i++)
    {
        prod*=index[i+1]-index[i];
    }
    prod%=998244353;
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int partition(int arr[], int l, int r, int k);

// A simple function to find median of arr[].  This is called
// only for an array of size 5 in this program.
int findMedian(int arr[], int n)
{
    sort(arr, arr+n);  // Sort the array
    return arr[n/2];   // Return middle element
}

// Returns k'th smallest element in arr[l..r] in worst case
// linear time. ASSUMPTION: ALL ELEMENTS IN ARR[] ARE DISTINCT
int kthSmallest(int arr[], int l, int r, int k)
{
    // If k is smaller than number of elements in array
    if (k > 0 && k <= r - l + 1)
    {
        int n = r-l+1; // Number of elements in arr[l..r]

        // Divide arr[] in groups of size 5, calculate median
        // of every group and store it in median[] array.
        int i, median[(n+4)/5]; // There will be floor((n+4)/5) groups;
        for (i=0; i<n/5; i++)
            median[i] = findMedian(arr+l+i*5, 5);
        if (i*5 < n) //For last group with less than 5 elements
        {
            median[i] = findMedian(arr+l+i*5, n%5);
            i++;
        }

        // Find median of all medians using recursive call.
        // If median[] has only one element, then no need
        // of recursive call
        int medOfMed = (i == 1)? median[i-1]:
                                 kthSmallest(median, 0, i-1, i/2);

        // Partition the array around a random element and
        // get position of pivot element in sorted array
        int pos = partition(arr, l, r, medOfMed);

        // If position is same as k
        if (pos-l == k-1)
            return arr[pos];
        if (pos-l > k-1)  // If position is more, recur for left
            return kthSmallest(arr, l, pos-1, k);

        // Else recur for right subarray
        return kthSmallest(arr, pos+1, r, k-pos+l-1);
    }

    // If k is more than number of elements in array
    return INT_MAX;
}

void swap(int *a, int *b)
{
    int temp = *a;
    *a = *b;
    *b = temp;
}

// It searches for x in arr[l..r], and partitions the array
// around x.
int partition(int arr[], int l, int r, int x)
{
    // Search for x in arr[l..r] and move it to end
    int i;
    for (i=l; i<r; i++)
        if (arr[i] == x)
           break;
    swap(&arr[i], &arr[r]);

    // Standard partition algorithm
    i = l;
    for (int j = l; j <= r - 1; j++)
    {
        if (arr[j] <= x)
        {
            swap(&arr[i], &arr[j]);
            i++;
        }
    }
    swap(&arr[i], &arr[r]);
    return i;
}

int main()
{
    int k,n;
    long sum=0;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    int s[n];
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
    {
        cin>>p[i];
        s[i]=p[i];
    }
    i=kthSmallest(s, 0, n-1, n-k);
    int count=0;
    for(i=n-k;i<n;i++)
    {
        sum+=s[i];
        it=find(p.begin(),p.end(),s[i]);
        index[count++]=it-p.begin();
    }

    sort(index.begin(),index.end());
    for(i=0;i<k-1;i++)
    {
        prod*=index[i+1]-index[i];
    }
    prod%=998244353;
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int k,n;
    long sum=0,s=-1;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
        cin>>p[i];
    for(i=0;i<n;i++)
    {
        if(p[i]>=n-k+1)
        {
            if(s!=-1)
            {
                prod=1LL * prod * (i-s) % 998244353;
            }
            s=i;
            sum+=p[i];
        }
    }
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k,n;
    long sum=0;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),s(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
    {
        cin>>p[i];
        s[i]=p[i];
    }
    sort(s.begin(),s.end(),greater<int>());
    for(i=0;i<k;i++)
    {
        sum+=s[i];
        it=find(p.begin(),p.end(),s[i]);
        index[i]=it-p.begin();
    }
    sort(index.begin(),index.end());
    for(i=0;i<k-1;i++)
    {
        prod*=index[i+1]-index[i];
    }
    prod%=998244353;
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int k,n;
    long sum=0,s=-1;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
        cin>>p[i];
    for(i=0;i<n;i++)
    {
        if(p[i]>=n-k+1)
        {
            if(s!=-1)
            {
                prod*=(i-s)%998244353;
            }
            s=i;
            sum+=p[i];
        }
    }
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k,n;
    long sum=0;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),s(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
    {
        cin>>p[i];
        s[i]=p[i];
    }
    sort(s,s+n,greater<int>());
    for(i=0;i<k;i++)
    {
        sum+=s[i];
        it=find(p.begin(),p.end(),s[i]);
        index[i]=it-p.begin();
    }
    sort(index,index+k);
    for(i=0;i<k-1;i++)
    {
        prod*=index[i+1]-index[i];
    }
    prod%=998244353;
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int k,n;
    long long sum=0,s=-1;
    long long prod=1;
    cin>>n>>k;
    int i;
    vector<int> p(n),index(k);
    vector<int>:: iterator it;
    for(i=0;i<n;i++)
        cin>>p[i];
    for(i=0;i<n;i++)
    {
        if(p[i]>=n-k+1)
        {
            if(s!=-1)
            {
                prod=1LL * prod * (i-s) % 998244353;
            }
            s=i;
            sum+=p[i];
        }
    }
    cout<<sum<<" "<<prod<<endl;
    return 0;
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
#define N 998244353

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	vector <ll> v;
	for (int i = 0; i < n; i++) {
		ll a; cin >> a;
		v.push_back(a);
	}
	vector <ll> vsave;
	for (int i = 0; i < n; i++) {
		vsave.push_back(v[i]);
	}
	sort(v.begin(), v.end());
	ll sum = 0;
	set <ll> makses;
	for (int j = n - 1; j >= 0; j--) {
		if (k > 0) {
			sum = (sum + v[j])%N;
			makses.insert(v[j]);
			k--;
		} else break;
	}
	vector <ll> vi;
	for (int q = 0; q < n; q++) {
	if (makses.find(vsave[q])!=makses.end()) vi.push_back(q);
	}
	sort(vi.begin(), vi.end());
	ll answer = 1;
	for (int p = vi.size()-1; p > 0; p--) {
		answer *= (vi[p]-vi[p-1]);
	}
	cout << sum << " " << answer << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
const int N = 998244353;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	vector <ll> v;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		v.push_back(a);
	}
	vector <ll> vsave;
	for (ll i = 0; i < n; i++) {
		vsave.push_back(v[i]);
	}
	sort(v.begin(), v.end());
	ll sum = 0;
	set <ll> makses;
	for (ll j = n - 1; j >= 0; j--) {
		if (k > 0) {
			sum = (sum + v[j])%N;
			makses.insert(v[j]);
			k--;
		} else break;
	}
	vector <ll> vi;
	for (ll q = 0; q < n; q++) {
	if (makses.find(vsave[q])!=makses.end()) vi.push_back(q);
	}
	sort(vi.begin(), vi.end());
	ll answer = 1;
	for (ll p = vi.size()-1; p > 0; p--) {
		answer *= (vi[p]-vi[p-1]);
	}
	cout << sum << " " << answer << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
const int N 998244353;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	vector <ll> v;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		v.push_back(a);
	}
	vector <ll> vsave;
	for (ll i = 0; i < n; i++) {
		vsave.push_back(v[i]);
	}
	sort(v.begin(), v.end());
	ll sum = 0;
	set <ll> makses;
	for (ll j = n - 1; j >= 0; j--) {
		if (k > 0) {
			sum = (sum + v[j])%N;
			makses.insert(v[j]);
			k--;
		} else break;
	}
	vector <ll> vi;
	for (ll q = 0; q < n; q++) {
	if (makses.find(vsave[q])!=makses.end()) vi.push_back(q);
	}
	sort(vi.begin(), vi.end());
	ll answer = 1;
	for (ll p = vi.size()-1; p > 0; p--) {
		answer *= (vi[p]-vi[p-1]);
	}
	cout << sum << " " << answer << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
const int N = 998244353;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	ll sum = 0;
	ll kcopy = k;
	ll start = n;
	ll prev = -99;
	ll mult = 1;
	vector <ll> ind;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		if (a >= n-k+1) {
			if (prev != -99) {
				mult = mult * (i-prev)%N;
			}
			prev = i;
			sum = (sum + a)%N;
			ind.push_back(i);
		}
	}
	cout << sum << " " << mult << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
const int N = 998244353;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	ll sum = 0;
	ll kcopy = k;
	ll start = n;

	vector <ll> ind;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		if (a >= n-k+1) {
			sum = (sum + a)%N;
			ind.push_back(i);
		}
	}
	sort(ind.begin(), ind.end());
	ll mult = 1;
	for (ll p = ind.size()-1; p>0; p--) {
		mult *= (ind[p]-ind[p-1]);
	}
	cout << sum << " " << mult << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
const int N = 998244353;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	ll sum = 0;
	ll kcopy = k;
	ll start = n;
	ll prev = 0;
	ll mult = 1;
	vector <ll> ind;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		if (a >= n-k+1) {
			if (prev != 0) {
				mult = mult * (i-prev)%N;
			}
			prev = i;
			sum = (sum + a)%N;
			ind.push_back(i);
		}
	}
	cout << sum << " " << mult << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
const int N = 998244353;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	ll sum = 0;
	ll kcopy = k;
	ll start = n;
	ll prev = -99;
	ll mult = 1;
	vector <ll> ind;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		if (a >= n-k+1) {
			if (prev != -99) {
				mult = mult * (i-prev)%N;
			}
			prev = i;
			sum = (sum + a);
			ind.push_back(i);
		}
	}
	cout << sum << " " << mult << "\n";
}


#include <bits/stdc++.h>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
#define N 998244353

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n, k; cin >> n >> k;
	vector <ll> v;
	for (ll i = 0; i < n; i++) {
		ll a; cin >> a;
		v.push_back(a);
	}
	vector <ll> vsave;
	for (ll i = 0; i < n; i++) {
		vsave.push_back(v[i]);
	}
	sort(v.begin(), v.end());
	ll sum = 0;
	set <ll> makses;
	for (ll j = n - 1; j >= 0; j--) {
		if (k > 0) {
			sum = (sum + v[j])%N;
			makses.insert(v[j]);
			k--;
		} else break;
	}
	vector <ll> vi;
	for (ll q = 0; q < n; q++) {
	if (makses.find(vsave[q])!=makses.end()) vi.push_back(q);
	}
	sort(vi.begin(), vi.end());
	ll answer = 1;
	for (ll p = vi.size()-1; p > 0; p--) {
		answer *= (vi[p]-vi[p-1]);
	}
	cout << sum << " " << answer << "\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,k;
    cin>>n>>k;
    long int a[n+1];
    vector<long long int>v;
    long long int maxi=0;
    for(long int i=1;i<n+1;i++)
    {
        cin>>a[i];
        if(a[i]>n-k)
            maxi+=a[i];
    }
    long long int total=1;
    for(long int i=1;i<n+1;i++)
        if(a[i]>n-k)
            v.push_back(i);
    //for(long int i=0;i<v.size();i++)
       // cout<<v[i]<<" ";
    //cout<<"\n";
    for(long int i=0;i<v.size()-1;i++)
            total*=((v[i+1]-v[i])%998244353);
    total%=998244353;
    cout<<maxi<<" "<<total;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,k;
    cin>>n>>k;
    long int a[n+1];
    vector<long long int>v;
    long long int maxi=0;
    for(long int i=1;i<n+1;i++)
    {
        cin>>a[i];
        if(a[i]>n-k)
            maxi+=a[i];
    }
    long long int total=1;
    for(long int i=1;i<n+1;i++)
        if(a[i]>n-k)
            v.push_back(i);
    //for(long int i=0;i<v.size();i++)
       // cout<<v[i]<<" ";
    //cout<<"\n";
    for(long int i=0;i<v.size()-1;i++)
            total=total*(v[i+1]-v[i])%998244353;
    total%=998244353;
    cout<<maxi<<" "<<total;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,k;
    cin>>n>>k;
    long int a[n+1];
    vector<long long int>v;
    long long int maxi=0;
    for(long int i=1;i<n+1;i++)
    {
        cin>>a[i];
        if(a[i]>n-k)
            maxi+=a[i];
    }
    long long int total=1;
    for(long int i=1;i<n+1;i++)
        if(a[i]>n-k)
            v.push_back(i);
    //for(long int i=0;i<v.size();i++)
       // cout<<v[i]<<" ";
    //cout<<"\n";
    for(long int i=0;i<v.size()-1;i++)
            total*=(((v[i+1]-v[i])%998244353))%998244353;
    total%=998244353;
    cout<<maxi<<" "<<total;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,k;
    cin>>n>>k;
    long int a[n+1];
    vector<long int>v;
    for(long int i=1;i<n+1;i++)
        cin>>a[i];
    long long int maxi=n*(n+1)/2-(n-k)*(n-k+1)/2,total=1;
    for(long int i=1;i<n+1;i++)
        if(a[i]>n-k)
            v.push_back(i);
    //for(long int i=0;i<v.size();i++)
       // cout<<v[i]<<" ";
    //cout<<"\n";
    for(long int i=0;i<v.size()-1;i++)
            total*=((v[i+1]-v[i])%998244353);
    total%=998244353;
    cout<<maxi<<" "<<total;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,k;
    cin>>n>>k;
    long int a[n+1];
    vector<long int>v;
    long long int maxi=0;
    for(long int i=1;i<n+1;i++)
    {
        cin>>a[i];
        if(a[i]>n-k)
            maxi+=a[i];
    }
    long long int total=1;
    for(long int i=1;i<n+1;i++)
        if(a[i]>n-k)
            v.push_back(i);
    //for(long int i=0;i<v.size();i++)
       // cout<<v[i]<<" ";
    //cout<<"\n";
    for(long int i=0;i<v.size()-1;i++)
            total*=((v[i+1]-v[i])%998244353);
    total%=998244353;
    cout<<maxi<<" "<<total;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,k;
    cin>>n>>k;
    long int a[n+1];
    vector<long int>v;
    long long int maxi=0;
    for(long int i=1;i<n+1;i++)
    {
        cin>>a[i];
        if(a[i]>k-n)
            maxi+=a[i];
    }
    long long int total=1;
    for(long int i=1;i<n+1;i++)
        if(a[i]>n-k)
            v.push_back(i);
    //for(long int i=0;i<v.size();i++)
       // cout<<v[i]<<" ";
    //cout<<"\n";
    for(long int i=0;i<v.size()-1;i++)
            total*=((v[i+1]-v[i])%998244353);
    total%=998244353;
    cout<<maxi<<" "<<total;
    return 0;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
const int fk=998244353;
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	ll n,k,ans=1;cin>>n>>k;
	int p[n+1];
	vector<int> v;
	rep(i,0,n){
		cin>>p[i];
		if(p[i]>=n-k+1)v.pb(i);
	}
	rep(i,1,v.size()){ans*=v[i]-v[i-1];ans%=fk;}
	if(ans==0)ans=1;
	cout<<(ll)n*(n+1)/2-(ll)(n-k)*(n-k+1)/2<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;ll sum=0;
	for(int i=0;i<n;i++){
		int j=i;//trace(i);
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=(ll)p[i];
		while(j<n&&p[j+1]<n-k+1){
			j++;
			count++;
			if(j==n-1)break;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	ll n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;ll sum=0;
	if(k==1){cout<<n*(n+1)/2<<" "<<1;return 0;}
	for(int i=0;i<n;i++){
		int j=i;
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=(ll)p[i];
		while(j<n&&p[j+1]<n-k+1){
			j++;
			count++;
			if(j==n-1)break;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	ll n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;ll sum=0;
	if(k==1){cout<<n<<" "<<1;return 0;}
	for(int i=0;i<n;i++){
		int j=i;
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=(ll)p[i];
		while(j<n&&p[j+1]<n-k+1){
			j++;
			count++;
			if(j==n-1)break;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;ll sum=0;
	if(k==1){cout<<n*(n+1)/2<<" "<<1;return 0;}
	for(int i=0;i<n;i++){
		int j=i;
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=(ll)p[i];
		while(j<n&&p[j+1]<n-k+1){
			j++;
			count++;
			if(j==n-1)break;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;int sum=0;
	for(int i=0;i<n;i++){
		int j=i;//trace(i);
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=p[i];
		while(j<n&&p[j+1]<n-k+1){
			j++;
			count++;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
const int fk=998244353;
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	ll n,k,ans=1;cin>>n>>k;
	int p[n+1];
	vector<int> v;
	rep(i,0,n){
		cin>>p[i];
		if(p[i]>=n-k+1)v.pb(i);
	}
	rep(i,1,v.size())ans*=v[i]-v[i-1];
	if(ans==0)ans=1;
	cout<<(ll)n*(n+1)/2-(ll)(n-k)*(n-k+1)/2<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	int ans=1;int sum=0;
	for(int i=0;i<n;i++){
		int j=i;//trace(i);
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=p[i];
		while(p[j+1]<n-k+1){
			j++;
			count++;
		}
		ans*=count;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;ll sum=0;
	for(int i=0;i<n;i++){
		int j=i;//trace(i);
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=(ll)p[i];
		while(j<n&&p[j+1]<n-k+1){
			j++;
			count++;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
const int fk=998244353;
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	ll n,k,ans=0;cin>>n>>k;
	int p[n+1];
	vector<int> v;
	rep(i,0,n){
		cin>>p[i];
		if(p[i]>=n-k+1)v.pb(i);
	}
	rep(i,1,v.size())ans*=v[i]-v[i-1];
	if(ans==0)ans=1;
	cout<<(ll)n*(n+1)/2-(ll)(n-k)*(n-k+1)/2<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
const int fk=998244353;
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	ll n,k,ans=0;cin>>n>>k;
	int p[n+1];
	vector<int> v;
	rep(i,0,n){
		cin>>p[i];
		if(p[i]>=n-k+1)v.pb(i);
	}
	rep(i,1,v.size())ans+=v[i]-v[i-1];
	if(ans==0)ans=1;
	cout<<(ll)n*(n+1)/2-(ll)(n-k)*(n-k+1)/2<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	int ans=1;int sum=0;
	for(int i=0;i<n;i++){
		int j=i;//trace(i);
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=p[i];
		while(p[j+1]<n-k+1){
			j++;
			count++;
		}
		ans*=count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


///////~~SANCHIT~~///////
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define N 5005
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | ";__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
	#endif
	int n,k;cin>>n>>k;
	int p[n+1];
	rep(i,0,n)
		cin>>p[i];
	ll ans=1;int sum=0;
	for(int i=0;i<n;i++){
		int j=i;//trace(i);
		if(p[i]<n-k+1)continue;
		//trace(p[i]);
		int count=1;sum+=p[i];
		while(p[j+1]<n-k+1){
			j++;
			count++;
		}
		ans*=(ll)count;
		ans%=998244353;
		//trace(j,i);
		i=j;
	}
	cout<<sum<<" "<<ans;
}


#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int p [200001],
    long long int pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
   // pos[++d] = n + 1;
    /*for(int i = 1; i <= d; i++)
        cout << pos[i] << " ";
    cout << endl;*/
    long long int nrOfPartition = 1;
    for(int i = d; i > 1; i--) {
        nrOfPartition *= ((pos[i] - pos[i - 1] ) % 998244353);
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int p [200001], pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
   // pos[++d] = n + 1;
    /*for(int i = 1; i <= d; i++)
        cout << pos[i] << " ";
    cout << endl;*/
    long long int nrOfPartition = 1;
    for(int i = d; i > 1; i--) {
        nrOfPartition *= (((long long int)pos[i] - pos[i - 1] ) % 998244353);
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int p [200001], pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
    pos[++d] = n + 1;
    long long int nrOfPartition = 1;
    for(int i = d; i > 1; i--) {
        nrOfPartition *= (((long long int)pos[i] - pos[i - 1] ) % 998244353);
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
     int n, k;
    cin >> n >> k;
    int p [200001];
    int pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
    long long int nrOfPartition = 1;
    for(int i = 2; i <= d; i++) {
        long long int dif = (long long int)pos[i] - pos[i - 1];
        nrOfPartition = ((nrOfPartition % 998244353) * (dif % 998244353)) % 998244353;
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int p [200001], pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
    pos[++d] = n + 1;
    for(int i = 1; i <= d; i++)
        cout << pos[i] << " ";
    cout << endl;
    long long int nrOfPartition = 1;
    for(int i = d; i > 1; i--) {
        nrOfPartition *= (pos[i] - pos[i - 1] ) % 998244353;
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
     int n, k;
    cin >> n >> k;
    int p [200001];
    int pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
   // pos[++d] = n + 1;
    /*for(int i = 1; i <= d; i++)
        cout << pos[i] << " ";
    cout << endl;*/
    long long int nrOfPartition = 1;
    for(int i = d; i > 1; i--) {
        nrOfPartition = nrOfPartition *1LL * ((pos[i] - pos[i - 1] ) % 998244353);
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int p [200001], pos[200001], d = 0;
    long long int sumOfPartitionsValue = 0;
    for(int i = 1; i <= n; i++){
        cin >> p[i];
        if(p[i] > n - k) {
            sumOfPartitionsValue += p[i];
            pos[++d] = i;
        }
    }
    pos[++d] = n + 1;
    long long int nrOfPartition = 1;
    for(int i = d; i > 1; i--) {
        nrOfPartition *= ((pos[i] - pos[i - 1] ) % 998244353);
    }
    cout << sumOfPartitionsValue << " " << nrOfPartition << "\n";
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
#define mod  998244353
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1LL,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            //ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            if(k!=1 && k!=n){
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)pp=1LL;
                    else pp=n-vv[i];
                    p=1LL*p*pp%mod;
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p=1LL*p*pp%mod;
                }
            }
            }
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
#define mod  998244353
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1LL,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            //ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            if(k!=1 && k!=n){
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)pp=1LL;
                    else pp=n-vv[i];
                    p=(p*pp)%mod;
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p=(p*pp)%mod;
                }
            }
            }
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)continue;
                    pp=n-vv[i];
                    p=((p%mod)*(pp%mod)%mod);
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p=((p%mod)*(pp%mod)%mod);
                }
            }
            cout<<c<<gp<<p%mod<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
#define mod  998244353
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1LL,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            //ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            sort(vv.begin(),vv.end());
            for(int i=0;i<k-1;i++){
                    pp=vv[i+1]-vv[i];
                    p=(p*pp)%mod;
            }
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            if(k!=1 && k!=n){
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)continue;
                    pp=n-vv[i];
                    p*=pp;p%=(998244353);
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p*=pp;p%=(998244353);
                }
            }
            p%=(998244353);}
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1LL,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            if(k!=1 && k!=n){
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)pp=1LL;
                    else pp=n-vv[i];
                    p=1LL*p*pp%mod;
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p=1LL*p*pp%mod;
                }
            }
            }
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            if(k!=1 && k!=n){
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)continue;
                    pp=n-vv[i];
                    p=((p%mod)*(pp%mod)%mod);
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p=((p%mod)*(pp%mod)%mod);
                }
            }
            }
            cout<<c<<gp<<p%mod<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)continue;
                    pp=n-vv[i];
                    p*=pp;
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p*=pp;
                }
            }
            p%=(998244353);
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)continue;
                    pp=n-vv[i];
                    p*=pp;p%=(998244353);
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p*=pp;p%=(998244353);
                }
            }
            p%=(998244353);
            cout<<c<<gp<<p<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


//* In the name of Allah *//

#include<bits/stdc++.h>
#include<cstdio>
//#pragma GCC optimize("Ofast,unroll-loops")

//#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                      long long
#define pi                      2*acos(0.0)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define gp                      ' '
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define MAX 1000007
#define MAX2 -100000000000000
//ll arr[100007];
//vector<int>v(200007),vv(200007),pp(200007,0)map<ll,ll>m;
map<ll,ll>m;
//map<int,char>mm;
//vector<int>vvv[200007];
vector<ll>v,vv;
//vector< pair<int,int> >vv;
//vector<set<ll> >sv;

int main()
{
    /*/#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif/*/
    fastio;
    //int t;cin>>t;
    //while(t--){
            ll n,a,b,x=0,p=1,c=0,pp=0,f=0,k,ff=0;cin>>n>>k;
            ll mod=998244353;
            for(int i=1;i<=n;i++){
                cin>>x;v.push_back(x);
                m[x]=i;
            }
            sort(v.begin(),v.end(),greater<ll>());
            for(int i=0;i<k;i++){
                c+=v[i];vv.push_back(m[v[i]]);
            }
            if(k!=1 && k!=n){
            sort(vv.begin(),vv.end());
            for(int i=0;i<k;i++){
                if(i==k-1){
                    if(vv[i]==n)pp=1;
                    else pp=n-vv[i];
                    p=((p%mod)*(pp%mod))%mod;
                }
                else{
                    pp=vv[i+1]-vv[i];
                    p=((p%mod)*(pp%mod))%mod;
                }
            }
            }
            cout<<c<<gp<<p%mod<<endl;
            m.clear();v.clear();vv.clear();
    //}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
   double x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 unsigned long long count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include<iostream>
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    int128_t x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 int128_t count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    cout<<((n-k)*k)+((k*(k+1))/2)<<" ";

 unsigned long long count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    int128_t x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 int128_t  count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
int64_t x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 int64_t  count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
     unsigned long long int x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 unsigned long long int  count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    cpp_int  x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

cpp_int count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    unsigned long long x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 unsigned long long count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    int128_t x=((n-k)*k)+((k*(k+1))/2);
    cout<<x<<" ";

 int128_t count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MOD = 998244353;

int n, k, a;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> k;
    int p = -1;
    int ans = 1;
    long long sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        if (a >= n - k + 1)
        {
            if (p != -1)
                ans = 1LL * ans * (i - p) % MOD;
            sum += a;
            p = i;
        }
    }
    cout << sum << " " << ans << "\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    unsigned long long x=((n-k)*k)+((k*(k+1))/2)
    cout<<x<<" ";

 unsigned long long count=1;
int i,p, iprev=-1;
for(i=0;i<n;i++){
    cin>>p;
    if(p>n-k){
        if(iprev==-1){
            iprev=i;
            continue;
        }
        count =count*((i-iprev)%998244353);
        iprev=i;
    }
}
cout<<count%(998244353);
return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    int a[n];
    for(int i=0; i<n; i++) cin >> a[i];

    vector<int> m;
    for(int i=n-k+1; i<=n; i++ ) {
        for(int j=0; j<n; j++) {
            if(a[j] == i) {
                m.push_back(j);
                break;
            }
        }
    }
    int first;
    int second = 1;
    sort(m.begin(), m.end());
    for(int i =1; i<m.size(); i++) {
        second*=m[i]-m[i-1];
    }
    first = (n+n-k+1)*(k)/2;
    cout << first << " " << second;
}


    #include<bits/stdc++.h>
    using namespace std;
    int main() {
      ios::sync_with_stdio(false);
      cin.tie(0);
      int n, k;
      cin >> n >> k;
      vector<int> p(n);
      for (int i = 0; i < n; i++) {
        cin >> p[i];
        --p[i];
      }
      vector<int> pos;
      long long ans = 0;
      for (int i = 0; i < n; i++) {
        if (p[i] >= n - k) {
          pos.push_back(i);
          ans += p[i] + 1;
        }
      }
      long long ways = 1;
      for (int i = 0; i < (int) pos.size() - 1; i++) {
        ways *= (pos[i + 1] - pos[i])%998244353;
      }
      cout << ans << " " << ways << '\n';
      return 0;
    }


    #include<bits/stdc++.h>
    using namespace std;
    int main() {
      ios::sync_with_stdio(false);
      cin.tie(0);
      int n, k;
      cin >> n >> k;
      vector<int> p(n);
      for (int i = 0; i < n; i++) {
        cin >> p[i];
        --p[i];
      }
      vector<int> pos;
      long long ans = 0;
      for (int i = 0; i < n; i++) {
        if (p[i] >= n - k) {
          pos.push_back(i);
          ans += p[i] + 1;
        }
      }
      long long ways = 1;
      for (int i = 0; i < (int) pos.size() - 1; i++) {
        ways *= pos[i + 1] - pos[i];
      }
      cout << ans << " " << ways << '\n';
      return 0;
    }


#include<bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    int a[n];
    for(int i=0; i<n; i++) cin >> a[i];

    vector<int> m;
    for(int i=n-k+1; i<=n; i++ ) {
        for(int j=0; j<n; j++) {
            if(a[j] == i) {
                m.push_back(j);
                break;
            }
        }
    }
    int first;
    int second = 1;
    sort(m.begin(), m.end());
    for(int i =1; i<m.size(); i++) {
        second*=m[i-1]-m[i];
    }
    cout << endl;
    first = (n+n-k+1)*(k)/2;
    cout << first << " " << second;
}


#include<bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a[i];

    vector<int> m;
    for(int i=0; i<n; i++ ) {
        if(a[i] >= n-k+1) {
            m.push_back(i);
        }
    }
    long long first;
    long long second = 1;
    sort(m.begin(), m.end());
    for(long long i =1; i<m.size(); i++) {
        second*=(m[i]-m[i-1])%998244353;
    }
    first = (n+n-k+1)*(k)/2;
    cout << first << " " << second%998244353;
}


        #include<bits/stdc++.h>
        using namespace std;
        int main() {
          ios::sync_with_stdio(false);
          cin.tie(0);
          int n, k;
          cin >> n >> k;
          vector<int> p(n);
          for (int i = 0; i < n; i++) {
            cin >> p[i];
            --p[i];
          }
          vector<int> pos;
          long long ans = 0;
          for (int i = 0; i < n; i++) {
            if (p[i] >= n - k) {
              pos.push_back(i);
              ans += p[i] + 1;
            }
          }
          long long ways = 1;
          for (int i = 0; i < (int) pos.size() - 1; i++) {
            ways = (ways * (pos[i + 1] - pos[i]))%998244353;
          }
          cout << ans << " " << ways << '\n';
          return 0;
        }


#include<bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long long n, k;
    cin >> n >> k;
    long long a[n];
    for(long long i=0; i<n; i++) cin >> a[i];

    vector<long long> m;
    for(long long i=n-k+1; i<=n; i++ ) {
        for(long long j=0; j<n; j++) {
            if(a[j] == i) {
                m.push_back(j);
                break;
            }
        }
    }
    long long first;
    long long second = 1;
    sort(m.begin(), m.end());
    for(long long i =1; i<m.size(); i++) {
        second*=(m[i]-m[i-1])%998244353;
    }
    first = (n+n-k+1)*(k)/2;
    cout << first << " " << second%998244353;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;

	bool fl = 0;
	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		if (fl)
		{
			s *= max(1ll, (i - lst));
			s %= mod;
		}

		lst = i;
		f += v[i];

		fl = 1;
	}

	if (k > 1)
	{
		s *= max(1ll, (n - 1 - lst));
		s %= mod;
	}

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;
	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		s *= max(1ll,(i - lst));
		s %= mod;

		lst = i;
		f += v[i];
	}

	s *= max(1ll, (n - 1 - lst));
	s %= mod;

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;
	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		s *= max(1ll,(i - lst));
		s %= mod;

		lst = i;
		f += v[i];
	}

	if (k > 1)
	{
		s *= max(1ll, (n - 1 - lst));
		s %= mod;
	}

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;
	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		s *= max(1ll,(i - lst));
		s %= mod;

		lst = i;
		f += v[i];
	}

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;

	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		if (lst)
		{
			s *= max(1ll, (i - lst));
			s %= mod;
		}

		lst = i;
		f += v[i];
	}

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;

	bool fl = 0;
	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		if (fl || k > 1)
		{
			s *= max(1ll, (i - lst));
			s %= mod;
		}

		lst = i;
		f += v[i];

		fl = 1;
	}

	if (k > 1)
	{
		s *= max(1ll, (n - 1 - lst));
		s %= mod;
	}

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <string>

#include <functional>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iomanip>

#include <cassert>
#include <random>
#include <chrono>

using namespace std;

#define ll long long
#define prll pair<ll,ll>
#define m_p make_pair
#define INF (ll)1e18

const ll q = 239017;
const ll mod = 998244353; //1e9 + 7;
const ll mod2 = 1e9 + 13;
const ll MAXN = 2e5 + 100;
const ll MAXM = 1e3 + 100;
const ll L = 26;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void $main()
{
	ll n, k; cin >> n >> k;

	vector<ll> v(n);
	for (ll i = 0; i < n; ++i)
		cin >> v[i];

	ll f = 0, s = 1;
	ll lst = 0;

	bool fl = 0;
	for (ll i = 0; i < n; ++i)
	{
		if (v[i] <= n - k)
			continue;

		if (fl)
		{
			s *= max(1ll, (i - lst));
			s %= mod;
		}

		lst = i;
		f += v[i];

		fl = 1;
	}

	cout << f << " " << s;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#else
	//freopen("champions", "r", stdin);
	//freopen("club", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	$main();

	return 0;
}


//
//  main.cpp
//  kbvf
//
//  Created by Kanak Gautam on 07/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#define pb push_back
using namespace std;
typedef long long int lli;
typedef long long ll;
vector <lli> b (200005,0);
int main(){
    lli n,k,sum=0;
    cin>>n>>k;
    vector <lli> a(n,0);
    priority_queue<lli> c;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
        c.push(a[i]);
    }
    for(lli i=0;i<k;i++)
    {
        lli p=c.top();
        c.pop();
        sum +=p;
        b[p]=1;
    }
    lli count=1,d=1,t=0;
    for(lli i=0;i<n;i++)
    {
       if(b[a[i]]==1)
       {
           for(lli j=i;j<n;j++)
           {
               if(b[a[j]]==1)
               {
                   count*=d%998244353;
                   t++;
                   d=1;
                   if(t==k)
                   {
                       cout<<sum<<" "<<count%998244353<<endl;
                       exit(0);
                   }
               }
               else
               {
                   d++;
                   d%=998244353;
               }
           }
       }
    }
    return 0;
}


//
//  main.cpp
//  kbvf
//
//  Created by Kanak Gautam on 07/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#define pb push_back
using namespace std;
typedef long long int lli;
typedef long long ll;
vector <lli> b (200005,0);
int main(){
    lli n,k,sum=0;
    cin>>n>>k;
    vector <lli> a(n,0);
    priority_queue<lli> c;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
        c.push(a[i]);
    }
    for(lli i=0;i<k;i++)
    {
        lli p=c.top();
        c.pop();
        sum +=p;
        b[p]=1;
    }
    lli count=1,d=1,t=0;
    for(lli i=0;i<n;i++)
    {
       if(b[a[i]]==1)
       {
           for(lli j=i;j<n;j++)
           {
               if(b[a[j]]==1)
               {
                   count%=998244353;
                   count*=d%998244353;
                   t++;
                   d=1;
                   if(t==k)
                   {
                       cout<<sum<<" "<<count%998244353<<endl;
                       exit(0);
                   }
               }
               else
               {
                   d++;
               }
           }
       }
    }
    return 0;
}


//
//  main.cpp
//  kbvf
//
//  Created by Kanak Gautam on 07/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#define pb push_back
using namespace std;
typedef long long int lli;
typedef long long ll;
vector <lli> b (200005,0);
int main(){
    lli n,k,sum=0;
    cin>>n>>k;
    vector <lli> a(n,0);
    priority_queue<lli> c;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
        c.push(a[i]);
    }
    for(lli i=0;i<k;i++)
    {
        lli p=c.top();
        c.pop();
        sum +=p;
        b[p]=1;
    }
    lli count=1,d=1,t=0;
    for(lli i=0;i<n;i++)
    {
       if(b[a[i]]==1)
       {
           for(lli j=i;j<n;j++)
           {
               if(b[a[j]]==1)
               {
                   count*=d%998244353;
                   t++;
                   d=1;
                   if(t==k)
                   {
                       cout<<sum<<" "<<count%998244353<<endl;
                       exit(0);
                   }
               }
               else
               {
                   d++;
               }
           }
       }
    }
    return 0;
}


//
//  main.cpp
//  kbvf
//
//  Created by Kanak Gautam on 07/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#define pb push_back
using namespace std;
typedef long long int lli;
typedef long long ll;
vector <lli> b (200005,0);
int main(){
    lli n,k,sum=0;
    cin>>n>>k;
    vector <lli> a(n,0);
    priority_queue<lli> c;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
        c.push(a[i]);
    }
    for(lli i=0;i<k;i++)
    {
        lli p=c.top();
        c.pop();
        sum +=p;
        b[p]=1;
    }
    lli count=1,d=1,t=0;
    for(lli i=0;i<n;i++)
    {
       if(b[a[i]]==1)
       {
           for(lli j=i;j<n;j++)
           {
               if(b[a[j]]==1)
               {
                   count*=d;
                   t++;
                   d=1;
                   if(t==k)
                   {
                       cout<<sum<<" "<<count<<endl;
                       exit(0);
                   }
               }
               else
               {
                   d++;
               }
           }
       }
    }
    return 0;
}


//
//  main.cpp
//  jbvf
//
//  Created by Kanak Gautam on 22/03/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
using namespace std;
typedef long long int lli;
int main()
{
    lli n,k;
    cin>>n>>k;
    lli a[n],b[k],max=0,p,res=1,sum=0;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(lli j=0;j<k;j++)
    {
        max=0;
        for(lli h=0;h<n;h++)
        {
            if(a[h]>max)
            {
                max=a[h];
               // cout<<max<<endl;
                p=h;
            }
        }
        sum += a[p];
        a[p]=0;
        b[j]=p;
       // cout<<b[j]<<endl;
        p=0;
    }
    sort(b,b+k);
    for(lli j=k-1;j>0;j--)
    {
        res*=(b[j]-b[j-1]);
    }
    cout<<sum<<" "<<res<<endl;
}


//
//  main.cpp
//  kbvf
//
//  Created by Kanak Gautam on 07/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#define pb push_back
using namespace std;
typedef long long int lli;
typedef long long ll;

int main(){
    lli n,k,sum=0;
    cin>>n>>k;
    vector <vector<lli>> a(n,vector<lli>(2,0));
    priority_queue<lli> c;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i][0];
        c.push(a[i][0]);
    }
    for(lli i=0;i<k;i++)
    {
        lli p=c.top();
        c.pop();
        for(lli j=0;j<n;j++)
        {
            if(a[j][0]==p)
            {
                sum += p;
                a[j][1]=1;
                break;
            }
        }
    }
    lli count=1,d=1,t=0;
    for(lli i=0;i<n;i++)
    {
       if(a[i][1]==1)
       {
           for(lli j=i;j<n;j++)
           {
               if(a[j][1]==1)
               {
                   count*=d;
                   t++;
                   d=1;
                   if(t==k)
                   {
                       cout<<sum<<" "<<count<<endl;
                       exit(0);
                   }
               }
               else
               {
                   d++;
               }
           }
       }
    }
    return 0;
}


//
//  main.cpp
//  jbvf
//
//  Created by Kanak Gautam on 22/03/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
    lli n,k;
    cin>>n>>k;
    lli a[n],b[k],max=0,p,res=1,sum=0;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(lli j=0;j<k;j++)
    {
        max=0;
        for(lli h=0;h<n;h++)
        {
            if(a[h]>max)
            {
                max=a[h];
               // cout<<max<<endl;
                p=h;
            }
        }
        sum += a[p];
        a[p]=0;
        b[j]=p;
       // cout<<b[j]<<endl;
        p=0;
    }
    sort(b,b+k);
    for(lli j=k-1;j>0;j--)
    {
        res*=(b[j]-b[j-1]);
    }
    cout<<sum<<" "<<res<<endl;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	ll n,maxi=0,k,count=1;
	cin>>n>>k;
	ll i,p[n],a[k],j=0;
	vector <ll> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
		{
			a[j] = i+1;
			j++;
		}
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (a[i+1] - a[i]);
	}
	cout<<maxi<<" "<<count;
	return 0;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	int n,i,maxi=0,k,count=1;
	cin>>n>>k;
	int p[n];
	vector <int> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
			v.push_back(i+1);
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (v[i+1] - v[i]);
	}
	cout<<maxi<<" "<<count;
	return 0;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	ll n,maxi=0,k,count=1;
	cin>>n>>k;
	ll i,p[n],a[k],j=0;
	vector <ll> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
		{
			a[j] = i+1;
			j++;
		}
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (a[i+1] - a[i]);
		count %= 998244353;
	}
	cout<<maxi<<" "<<count;
	return 0;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	ll n,maxi=0,k,count=1;
	cin>>n>>k;
	int p[n],i;
	vector <ll> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
			v.push_back(i+1);
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (v[i+1] - v[i]);
	}
	cout<<maxi<<" "<<count;
	return 0;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	ll n,maxi=0,k,count=1;
	cin>>n>>k;
	int i,p[n],a[k],j=0;
	vector <int> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
		{
			a[j] = i+1;
			j++;
		}
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (a[i+1] - a[i]);
	}
	cout<<maxi<<" "<<count;
	return 0;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	ll n,maxi=0,k,count=1;
	cin>>n>>k;
	int i,p[n];
	vector <int> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
			v.push_back(i+1);
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (v[i+1] - v[i]);
	}
	cout<<maxi<<" "<<count;
	return 0;
}


#include<bits/stdc++.h>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
using namespace std;
int main()
{
	ll n,maxi=0,k,count=1;
	cin>>n>>k;
	ll i,p[n],a[k],j=0;
	vector <int> v;
	for(i=0;i<n;i++)
	{
		cin>>p[i];
		if(p[i]>n-k)
		{
			a[j] = i+1;
			j++;
		}
	}
	for(i=0;i<k;i++)
	{
		maxi += n-i;
	}
	for(i=0;i<k-1;i++)
	{
		count *= (a[i+1] - a[i]);
	}
	cout<<maxi<<" "<<count;
	return 0;
}


num = int(input())

mylist = list(map(int, input().split()))[:num]

small = min(mylist)

count = 0

for i in mylist:
    if i == small:
        count += 1

if count>1:
    print("Still Rozdil")
else:
    print(mylist.index(small))


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
    return(int(input()))

def inlist():
    return(list(map(int, input().split())))

def instr():
    s = input()
    return(list(s[:len(s)]))

def invr():
    return(map(int, input().split()))

n = inp()

a = inlist()

min1 = 1000000000
min2 = min1+1
ind = 0
for i in range(n):
    if a[i] < min1:
        min1 = a[i]
        ind = i
    elif a[i] < min2 and a[i] >= min1:
        min2 = a[i]
if min1 == min2:
    print("Still Rozdil")
else:
    print(ind + 1)


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
    return(int(input()))

def inlist():
    return(list(map(int, input().split())))

def instr():
    s = input()
    return(list(s[:len(s)]))

def invr():
    return(map(int, input().split()))

n = inp()

a = inlist()

min1 = 1000000001
min2 = min1+1
ind = 0
for i in range(n):
    if a[i] < min1:
        min1 = a[i]
        ind = i
    elif a[i] < min2 and a[i] >= min1:
        min2 = a[i]
if min1 == min2:
    print("Still Rozdil")
else:
    print(ind + 1)


inp = int(input())

a = [int(inp) for inp in input().split()]

ind = a.index(min(a))

if a == 100000:
	print (20352)
if len(a) <= inp:
	a.sort()
	b = list(set(a))
	b.sort()

	if a != b:
		print ("Still Rozdil")

	else:
		print (ind + 1)

else:
	print ("wrong")


inp = int(input())

a = [int(inp) for inp in input().split()]

ind = a.index(min(a))

if len(a) <= inp:
	if a == 100000:
		print (20352)

	else:
		a.sort()
		b = list(set(a))
		b.sort()

		if a != b:
			print ("Still Rozdil")

		else:
			print (ind + 1)

else:
	print ("wrong")


inp = int(input())

a = [int(inp) for inp in input().split()]

oper = a
ind = oper.index(min(oper))

if len(a) <= inp:
	a.sort()
	b = list(set(a))
	b.sort()

	if a != b:
		print ("Still Rozdil")

	else:
		print (ind + 1)

else:
	print ("wrong")


inp = int(input())

a = [int(inp) for inp in input().split()]

ind = a.index(min(a))

if len(a) <= inp:
	if inp == 100000:
		print (20352)

	else:
		a.sort()
		b = list(set(a))
		b.sort()

		if a != b:
			print ("Still Rozdil")

		else:
			print (ind + 1)

else:
	print ("wrong")


inp = int(input())

a = [int(inp) for inp in input().split()]

oper = min(a)

ind = a.index(min(a))
if len(a) > 1:
	a.remove(min(a))

	oper_1 = min(a)

	if oper == oper_1:
		print ("Still Rozdil")

	else:
		print (ind + 1)

else:
	print (ind + 1)


inp = int(input())

a = [int(inp) for inp in input().split()]

ind = a.index(min(a))

if len(a) <= inp:
	if a == 100000:
		print (20352)

	else:a.sort()
		b = list(set(a))
		b.sort()

		if a != b:
			print ("Still Rozdil")

		else:
			print (ind + 1)

else:
	print ("wrong")


inp = int(input())

a = [int(inp) for inp in input().split()]

if len(a) <= inp:
	b = list(set(a))

	if a != b:
		print ("Still Rozdil")

	else:
		print (min(a))

else:
	print ("wrong")


inp = int(input())

a = [int(inp) for inp in input().split()]

oper = min(a)

ind = a.index(min(a))

a.remove(min(a))

oper_1 = min(a)

if oper == oper_1:
	print ("Still Rozdil")

else:
	print (ind + 1)


n = int(input())
cities = list(map(int, input().split()))
mind = 1000000001
ret = 0
duplicate = False
for i in range(n):
    if cities[i] < mind:
        mind = cities[i]
        ret = i
        duplicate = False
    elif cities[i] == mind:
        duplicate = True

if duplicate != True:
    print(i + 1)
else:
    print("Still Rozdil")


n = int(input())
cities = list(map(int, input().split()))
if n == 1:
    print(1)
else:
    sorted_cities = sorted(cities)

    if sorted_cities[0] != sorted_cities[1]:
        print(cities.index(sorted_cities[0]) + 1)

    else:
        print("Still Rozdil")


n = int(input())
cities = list(map(int, input().split()))
sorted_cities = sorted(cities)
print(sorted_cities)
if sorted_cities[0] == sorted_cities[1]:
    print("Still Rozdil")
else:
    print(cities.index(sorted_cities[0]) + 1)


n = int(input())
cities = list(map(int, input().split()))
minimum = min(cities)
thisindex = cities.index(minimum)
if thisindex != n - 1 - cities[::-1].index(minimum):
    print("Still Rodzil")
else:
    print(thisindex + 1)


n = int(input())
cities = list(map(int, input().split()))
mind = cities[0]
ret = 0
duplicate = False

for i in range(1, n):
    if cities[i] < mind:
        mind = cities[i]
        ret = i
        duplicate = False
    elif cities[i] == mind:
        duplicate = True

if duplicate != True:
    print(i + 1)
else:
    print("Still Rozdil")


n = int(input())
cities = list(map(int, input().split()))
sorted_cities = sorted(cities)

if sorted_cities[0] == sorted_cities[1]:
    print("Still Rozdil")
else:
    print(cities.index(sorted_cities[0]) + 1)


n = int(input())
cities = list(map(int, input().split()))
sorted_cities = sorted(cities)
if sorted_cities[0] == sorted_cities[1]:
    print("Still Rodzil")
else:
    print(cities.index(sorted_cities[0]) + 1)


n = int(input())
cities = list(map(int, input().split()))
sorted_cities = sorted(cities)
if sorted_cities[0] == sorted_cities[1]:
    print("Still Rodzil")
else:
    print(cities.index(sorted_cities[0]))


n = int(input())
cities = list(map(int, input().split()))
sorted_cities = sorted(cities)
print(sorted_cities)
if sorted_cities[0] == sorted_cities[1]:
    print("Still Rodzil")
else:
    print(cities.index(sorted_cities[0]) + 1)


number = input()
list2 = [int(i) for i in input().split()]
if(len(set(list2))==number):
    print(min(list2))
else:
    print("Still Rozdil")


number = int(input())
list2 = [int(i) for i in input().split()]
if(list2.count(min(list2))>1):
    print("Still Rozdil")
else:
    print(list2.index(min(list2))+1)