var x1 =10;
var x2 =100;
var y1 =2;
var y2 =15;
var x_inp =60;
var y_out =???
How do I calculate discount? A shopkeeper gives a discount of min 2 on purchase of 10, and max 15 on 100. What will be discount on a purchase of 1->30, 2 ->65 (formula please)?