The city administration of IT City decided to fix up a symbol of scientific and technical progress in the city's main square, namely an indicator board that shows the effect of Moore's law in real time.
Moore's law is the observation that the number of transistors in a dense integrated circuit doubles approximately every 24 months. The implication of Moore's law is that computer performance as function of time increases exponentially as well.
You are to prepare information that will change every second to display on the indicator board. Let's assume that every second the number of transistors increases exactly 1.000000011 times.
Input
The only line of the input contains a pair of integers n (1000 ≤ n ≤ 10 000) and t (0 ≤ t ≤ 2 000 000 000) — the number of transistors in the initial time and the number of seconds passed since the initial time.
Output
Output one number — the estimate of the number of transistors in a dence integrated circuit in t seconds since the initial time. The relative error of your answer should not be greater than 10 - 6.
Examples
Input
1000 1000000
Output
1011.060722383550382782399454922040
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
We need to calculate n * (1.000000011)^t. n and t are integers, n up to 10000, t up to 2e9. Compute result with high precision: relative error ≤ 1e-6.
The factor is extremely close to 1. Exponential growth small factor over huge t. The straightforward approach would be to compute pow(1.000000011, t) * n. But t can be huge (2e9). We need to compute exponent with high precision and within feasible time.
We can compute exponent using exponentiation by squaring with high-precision floating point (like double) as double has about 15 decimal digits of precision. Since factor is 1 + 1.1e-8 (approx), the exponent after 2e9 is about (1+1.1e-8)^{2e9} = exp(2e9 * log(1+1.1e-8)). log(1+1.1e-8) ≈ 1.09999999e-8? Actually log(1+x) ≈ x - x^2/2 + ... For x=1.1e-8, log(1+x) = 1.0999999945e-8 (approx). Then exponent = exp(2e9 * 1.1e-8) = exp(22) ≈ 3.5849e9. Times n up to 10000 => up to ~3.6e13. That's within double range (max ~1e308). So double can hold the result with enough precision? Relative error of double is about 1e-15. But we need output with relative error 1e-6. So double is definitely enough. However, exponentiation by squaring with double: we can compute pow(1.000000011, t) using exponentiation by squaring in O(log t) multiplications. But note that 1.000000011 is close to 1, but multiplying many times may cause some error but still within tolerance.
But there's a potential pitfall: t up to 2e9, log2(t) ≈ 31, so only about 31 multiplications. That's fine. But the multiplications are of double numbers. The result might be huge. However, double can handle. So we can simply compute pow(1.000000011, t) using fast exponentiation.
Alternatively, we could compute using built-in pow function in C++ with double arguments: double base = 1.000000011, exponent = t. The standard pow() for floating-point might compute using log and exp, which could have error. But often it's accurate enough. However, to be safe, we can implement fast exponentiation.
But careful: base = 1.000000011 exactly? It is a decimal representation. Actually, 1.000000011 cannot be represented exactly in binary floating point. However, double has about 15 decimal digits, so 1.000000011 is represented with error ~1e-16? Let's check: 1.000000011 = 1 + 11e-9? Actually 1.000000011 = 1 + 1.1e-8? Wait: 1.000000011 = 1 + 0.000000011 = 1 + 1.1e-8? 0.000000011 = 1.1e-8? Actually 0.000000011 = 1.1 * 10^-8? No: 0.000000011 = 1.1e-8? 1.1e-8 = 0.000000011, correct. So base = 1 + 1.1e-8. In double, the closest representable value is something like 1.000000011000000... It will have relative error about machine epsilon (2^-52 ≈ 2.22e-16). That's far below required 1e-6. So fine.
But what about computing pow(1.000000011, t) via fast exponentiation? The product will be calculated as multiplication of double. For t up to 2e9, the exponent value is huge ~e^22 ≈ 3.5e9. The multiplication of numbers of order ~1 and the base gradually grow. The number of bits used in double might cause rounding errors. However, since we have only ~31 multiplications, the error should be within tolerance. But we must also consider that the intermediate results could be large; but the exponentiation method will multiply large numbers at later stages. For example, if we compute exponentiation by squaring, we might compute base^2, base^4, etc. Those numbers become huge quickly. For t=2e9, the largest intermediate power could be base^(2^31) ≈ base^(2e9) is the final result. But we only compute squares: base, base^2, base^4, base^8, ... up to base^(2^30). That intermediate at 2^30 ~1e9, but that's within range. Actually base^(2^30) is about exp(2^30 * log(base)). 2^30 = 1073741824 ≈ 1e9. That's similar to final result. So intermediate numbers are as large as final. So that's fine.
But maybe we could compute more directly: result = n * exp(t * log(1.000000011)). Using double, it's a single multiplication and exponentiation. That's even simpler. The error from log and exp should be within 1e-15 relative, which is sufficient. However, we must be careful: t * log(base) could be about 22, and exp(22) is computed accurately within double (error < 1e-15 relative). So that should be fine. But t is integer up to 2e9, and log(base) is around 1.1e-8, their product is around 22, within double precision (no catastrophic cancellation). So likely okay.
But the problem might be from Codeforces? Actually it's from Codeforces problem "Moore's Law" (cf 630B?). I recall a problem: given n and t, output n * 1.000000011^t. And many solutions use double and pow. So it's safe.
We need to output with enough digits. We can use printf("%.15f") or something. The relative error 1e-6 means absolute error / value <= 1e-6. If we output e.g. 15 decimal digits, it's fine.
But maybe we need to be careful with large t and small n: n could be as low as 1000, result ~1000*e^22 ~3.6e12. That's large. If we output as double with default format, it may output scientific notation? The problem likely expects decimal representation? The examples show decimal with many digits: "1011.060722383550382782399454922040". That's just example; I think any output with relative error ≤1e-6 is accepted. So we can output using e.g. cout << fixed << setprecision(12) << result; Or printf("%.12f", result). But ensure enough digits to meet relative error. Actually with relative error 1e-6, we need about 6 significant digits accurate. So printing with, say, 12 decimal digits after decimal point might be too many for large numbers; for numbers ~1e13, the decimal part after decimal might be many digits but that's okay. However, we must ensure the output is not in scientific notation. Usually Codeforces accepts both? The problem statement says "Output one number". Typically they expect decimal representation without exponent. But many solutions use printf("%.15f") or cout with fixed and setprecision.
I'll use: printf("%.15f", n * pow(1.000000011, t)); or compute via exp.
But double pow may use a slower algorithm? It's fine.
But t up to 2e9, is pow(1.000000011, t) computed efficiently? Many implementations of pow for double exponent and double base use exp(log(base)*exponent). That's O(1) and accurate enough. So that's fine.
To be extra safe, we could compute using long double for more precision, but not needed.
Thus solution: read n (int) and t (long long). Compute result = n * pow(1.000000011, t). Print with high precision.
But let's confirm the base: 1.000000011 exactly. Yes.
Edge cases: t=0 -> output n exactly. n is integer; printing as 1000.000000 maybe okay.
Thus solution straightforward.
We must consider that t can be up to 2e9 which fits in 32-bit signed? 2e9 > 2^31-1 = 2147483647? Actually 2e9 = 2000000000, which is less than 2^31-1 (2.147b). So int can hold up to 2.147b, but t <= 2e9, so it's safe in 32-bit int? 2e9 = 2,000,000,000 which is less than 2,147,483,647, so yes int can hold. But we'll use long long to be safe.
Implementation:
code
#include <bits/stdc++.h>
using namespace std;
int main() {
int n; long long t;
cin >> n >> t;
double base = 1.000000011;
double result = n * pow(base, (double)t);
printf("%.15f\n", result);
return 0;
}
Alternatively, use long double.
But some compilers may have pow for integer exponent? Actually there is overload for double pow(double base, int exponent) but not guaranteed. So we can cast t to double.
Check: pow(base, t) where t is long long, it will be converted to double, maybe lose precision? t up to 2e9 can be exactly represented as double (since double can represent integers exactly up to 2^53 ~9e15). So no problem.
But some might worry about rounding error in exponent? No.
Thus solved.
Now reflect: The problem originally maybe expects to compute n * 1.000000011^t. It's trivial.
I'll produce answer with explanation.
But I'm ChatGPT and need to output final answer? The user says: "The city administration of IT City decided to fix up a symbol ...". They want a solution? Actually the user gave the problem statement and expects me to provide a solution? Probably they want code. But the instruction says: "You are to prepare information that will change every second to display on the indicator board." Actually it's a problem description. The user wants me to solve it? Typically on Codeforces, you need to write program. As ChatGPT, I should output the code? The user says: "Input: The only line... Output: Output one number..." It's a typical competitive programming problem. They likely want a solution in C++ or Python.
But the conversation: The user hasn't explicitly asked for code. They just gave the problem statement. Possibly they want an explanation? But since this is a chat, I'll respond with solution approach and code.
Better to include explanation and code.
Thus I'll write: Approach: Compute n * (1.000000011)^t using floating point exponentiation. Use double and pow. Print with sufficient precision.
Then provide code in C++.
I'll also show Python solution as alternative? But typical language is C++. I'll stick to C++.
Now, in some judges, using pow directly may cause a small error. But it's fine.
Maybe there's a better way: Use exponentiation by squaring on long double for more precision. But not needed.
I'll produce answer accordingly.
Also note that the problem might be from Codeforces Round # (I think it's 630B). The constraints allow simple approach.
Thus final answer: Provide C++ code.
I'll output code with comments.
But note: The user might want only the number? They said "Output one number". Hmm. Usually they want a program. So I'll give the program.
I'll respond in the way: Here's the solution:
We compute result = n * (1.000000011)^t. Since t is large, we can use logarithm: result = n * exp(t * log(1.000000011)). Or simply use built-in pow. Ensure high precision output.
Code:
code
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
int n;
long long t;
cin >> n >> t;
double ans = n * pow(1.000000011, t);
cout << fixed << setprecision(15) << ans << endl;
return 0;
}
This will pass.
I'll also note that using double is sufficient.
That is the answer. ```cpp
#include
#include
#include
using namespace std;
int main() {
int n;
long long t;
cin >> n >> t;
code
double base = 1.000000011;
double ans = n * pow(base, t);
cout << fixed << setprecision(15) << ans << endl;
return 0;