fun solve(n: Int, x: Int, y: Int, s: String) : Int { var res = 0; var last = 0; for(ch in s) { if(ch == '0') last = 0; else last = (y - last).coerceAtMost(x); res += last; } return res; }
fun main(args: Array<String>){ val r = Scanner(System.`in`) val tc = r.nextInt(); for(i in 1 .. tc) { val n = r.nextInt(); val x = r.nextInt(); val y = r.nextInt(); val s = r.next(); println(solve(n,x,y,s)) } }