API Response (JSON)
{
"problem": {
"name": "D. Alyona and a tree",
"description": {
"content": "Alyona has a tree with _n_ vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive integer, in the vertex _i_ she wrote _a__i_. Moreover, the girl wrote a positive inte",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF740D"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Alyona has a tree with _n_ vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive integer, in the vertex _i_ she wrote _a__i_. Moreover, the girl wrote a positive inte...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "Alyona 有一棵包含 #cf_span[n] 个顶点的树。树的根是顶点 #cf_span[1]。在每个顶点中,Alyona 写了一个正整数,顶点 #cf_span[i] 中写的是 #cf_span[ai]。此外,女孩在树的每条边上也写了一个正整数(不同边上的整数可能不同)。\n\n定义 #cf_span[dist(v, u)] 为从顶点 #cf_span[v] 到顶点 #cf_span[u] 的简...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ n \\in \\mathbb{Z}^+ $ be the number of vertices. \nLet $ a_i \\in \\mathbb{Z}^+ $ be the value written at vertex $ i $, for $ i \\in \\{1, \\dots, n\\} $. \nLet $ T = (V, E) $ be a ro...",
"is_translate": false,
"language": "Formal"
}
]
}