easy hard version actually different problem advise read statement carefullyYou give weight rooted tree vertex 1 root tree also edge costA tree connect graph cycle a rooted tree special vertex call root a parent vertex v different v vertex path root vertex v Children vertex v vertex v parent a vertex leaf child the weight tree tree edge tree weightThe weight path sum edge weight path the weight path vertex 0you sequence zero move on select edge divide weight 2 round more formally choose edge divide weight 2 round w_i leftlfloorfracw_i2rightrfloorEach edge associated cost c_i 1 2 coin each edge cost c_i coinsyour task find minimum total cost sum weight path root leaf s in word wi j weight path vertex vertex j sumlimits_v leave wroot v le S leave list leavesyou answer t independent test case