Learning to Solve Domain-Specific Calculation Problems with Knowledge-Intensive Programs Generator