awk '$2>m{m=$2}{A[$3]=$1;B[$3]=$2}END{for(i=1;i<=m;i++){t=0;for(j in A)if(i>=A[j]&&i<=B[j])t+=j;print i,t}}' infile
While reading the files, you need to store the minimum values and maximum values for which the amount applies.. I used arrays A and B for this. Also we need to determine the max value for which any rule applies. I used m for this. Then after the reading is over we have collected all the files and we can enumerate the values between 1 and max value and see what values should be added.