{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Description","value":{"format":"MD","content":"给定四个整数 a,b,c,m。\n\n确认是否有一个字符串满足:\n\n有 a 个 \u0027A\u0027;有 b 个 \u0027B\u0027;有 c 个 \u0027C\u0027;没有其他字符;恰好有 m 对相邻的字符是相同的(即假设字符串为 $s \u003d s_1s_2\\dots s_n$,存在 m 个 i 满足$s_i\u003ds_{i+1}$,$i\\in[1,n-1]$)"}},{"title":"Input","value":{"format":"MD","content":"第一行为一个整数 t $(1≤t≤10^4) $,表示测试样例个数。\n\n接下来 t 行,每行给定四个整数 $a,b,c,m$。$1≤a,b,c≤10^8; 0≤m≤10^8$"}},{"title":"Output","value":{"format":"MD","content":"如果存在输入 YES;否则为 NO。"}},{"title":"Input1","value":{"format":"MD","content":"3\n2 2 1 0\n1 1 1 1\n1 2 3 2"}},{"title":"Output1","value":{"format":"MD","content":"YES\nNO\nYES"}}]}