Exact and greedy solutions of the knapsack problem: the ratio of values of objective functions