using System; using System.Collections.Generic; using System.Numerics; using System.IO; class Solution { static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ BigInteger[] intInput = Array.ConvertAll(Console.ReadLine().Split(' '), BigInteger.Parse); DangerousVirus virus = new DangerousVirus(); BigInteger cells = virus.VirusCellGrowth(intInput[0], intInput[1], intInput[2]); int output; int.TryParse(cells.ToString(), out output); Console.WriteLine(output); } } class DangerousVirus { public BigInteger VirusCellGrowth(BigInteger growthA, BigInteger growthB, BigInteger time) { //((growthA + growthB) / 2)^time; BigInteger aa = (growthA + growthB)/2; return BigInteger.ModPow(aa, time, 1000000007); } }