I have learned the normal version of CHT quite long ago. But I am having trouble implementing the dynamic version of it. I searched for some implementations and found this. Though its pretty short, I can't understand it much :( and I will be participating in my country's OI competition soon. There I can't bring templates with me. So, if anyone can provide me with an easier code, it will be really helpful. :)