Hazel would like to find out everything about the binary tree.
She has a **full** binary tree ,each point has different labels.
regarding each point of tree ,Hazel defines its height hi being the number of points which the shortest path from this point to a leaf has.
each point has weight Ai which be defined as Xhi.
Hazel wants to paint every points by color Bi,Observing the following rules:
∙ ∀i∈T,Bi∈N
∙ ∀i∈T,Bi≥Bfai
∙ Y≥2×∑i∈leafBi−∑i∈TBi
(define Bfaroot=0 )
Hazel defines the contribution of the tree S as ∑i∈TAi×Bi.
She wants to know how many legal methods can she paint the tree,which cause S is multiple of P.
You need to print ans mod(10^9+7).
She has a **full** binary tree ,each point has different labels.
regarding each point of tree ,Hazel defines its height hi being the number of points which the shortest path from this point to a leaf has.
each point has weight Ai which be defined as Xhi.
Hazel wants to paint every points by color Bi,Observing the following rules:
∙ ∀i∈T,Bi∈N
∙ ∀i∈T,Bi≥Bfai
∙ Y≥2×∑i∈leafBi−∑i∈TBi
(define Bfaroot=0 )
Hazel defines the contribution of the tree S as ∑i∈TAi×Bi.
She wants to know how many legal methods can she paint the tree,which cause S is multiple of P.
You need to print ans mod(10^9+7).