You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 1913D.go
    path of file: ./repos/codeforces-go/main/1900-1999
    
    the code of the file until where you have to start completion: package main

import (
	"bufio"
	. "fmt"
	"io"
)

// https://space.bilibili.com/206214
func cf1913D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod = 998244353

	var T, n, v int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		s := make([]int, n+1)
		type data struct{ i, v, f int }
		st := []data{{-1, 0, 0}}
		stSum := 0
		for i := 0; i < n; i++ {
			Fscan(in, &v)
			for st[len(st)-1].v > v {
				stSum -= st[len(st)-1].f
				st = st[:len(st)-1]
			}
			f := (stSum + s[i] - s[st[len(st)-1].i+1]) % mod
			if l
    
func cf1913D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod = 998244353

	var T, n, v int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		s := make([]int, n+1)
		type data struct{ i, v, f int }
		st := []data{{-1, 0, 0}}
		stSum := 0
		for i := 0; i < n; i++ {
			Fscan(in, &v)
			for st[len(st)-1].v > v {
				stSum -= st[len(st)-1].f
				st = st[:len(st)-1]
			}
			f := (stSum + s[i] - s[st[len(st)-1].i+1]) % mod
			if len(st) == 1 {
				f++ // 把前面全删了
			}
			stSum = (stSum + f) % mod
			s[i+1] = s[i] + f
			st = append(st, data{i, v, f})
		}
		Fprintln(out, (stSum+mod)%mod)
	}
}