-
Notifications
You must be signed in to change notification settings - Fork 1
/
day5.cs
33 lines (32 loc) · 875 Bytes
/
day5.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.IO;
using static System.Console;
class Solution
{
static void Main(String[] args)
{
int line = Convert.ToInt32(ReadLine());
for (int i = 0; i < line; i++)
{
string l = ReadLine();
string[] data = l.Split(' ');
int a = Convert.ToInt32(data[0]);
int b = Convert.ToInt32(data[1]);
int n = Convert.ToInt32(data[2]);
double res = a + b;
if (n > 1)
Write($"{res} ");
else
WriteLine($"{res}");
for (int idx = 1; idx < n; idx++)
{
res += b * Math.Pow(2d, idx);
if (idx + 1 == n)
WriteLine(res);
else
Write($"{res} ");
}
}
}
}