Could anyone give a solution to the problem below with $$$O(n\log n)$$$ or $$$O(n\log^2n)$$$ time plz?
Given two sequences $$$g,h$$$ with length $$$n$$$ and a binary function $$$F(n,k)$$$, calculate the sequence $$$f$$$ which satisfies:
And $$$F(n,k)$$$ can be $$$1$$$, $$$\binom{n}{k}$$$, $$$n^k$$$ or $$$k^n$$$.