function processData(input) { //***************** // Define variables //***************** var inputs = input.trim().replace(/\s+/g, " ").split(" ").map(Number), numberOfCells = 1, firstGrowthFactor = inputs[0], secondGrowthFactor = inputs[1], numberOfMilliseconds = inputs[2], resultingCells = 0; //******************** // Perform calculation //******************** resultingCells = 0.5*firstGrowthFactor*numberOfMilliseconds + 0.5*secondGrowthFactor*numberOfMilliseconds resultingCells = resultingCells % (Math.pow(10,9) + 7); //*************** // Print solution //*************** console.log(resultingCells); } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });