Search is not available for this dataset
name
stringlengths 2
88
| description
stringlengths 31
8.62k
| public_tests
dict | private_tests
dict | solution_type
stringclasses 2
values | programming_language
stringclasses 5
values | solution
stringlengths 1
983k
|
---|---|---|---|---|---|---|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Main {
public static void main(String args[]) {
int debt = 100000;
int nWeeks = Integer.parseInt(new Scanner(System.in).next());
for(int i = 0; i < nWeeks; i++) {
debt = new BigDecimal(debt * 1.05).setScale(-3, RoundingMode.CEILING).intValue();
}
System.out.println(debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int n;
int ans=100000;
cin>>n;
for(int i=0;i<n;++i){
ans=ans*1.05;
if(ans%1000>0) ans=ans-ans%1000+1000;
}
cout<<ans<<endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int money = 100;
for(int i=0;i<n;i++)
money=(int) Math.ceil(money*1.05);
System.out.println(money*1000);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int n=100000,money;
cin >> money;
for(int i=0;i<money;i++){
n*=1.05;
n+=999;
n-=n%1000;
}
cout << n << endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int n,debt = 100000;
cin >>n;
for(int i=0; i<n; i++){
debt *=1.05;
int k = debt/1000*1000;
if(debt != k){debt = k+1000;}
}
cout <<debt<<endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | import math
n=input()
m=10**2
for i in range(n):
m=m*1.05
m=math.ceil(m)
print int(m*(10**3)) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
r = 100000
for i in range(int(input())): r = math.ceil(r*1.05/1000)*1000
print(r)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(void){
int n;
int debt = 100;
cin >> n;
for(int i=0;i<n;i++){
debt = ceil(debt*1.05);
}
cout << debt*1000 << endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | D = 100000
N = int(raw_input())
for i in xrange(N):
D += D/20
if D % 1000 > 0:
D += 1000-D%1000
print D |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(calcDebt(n));
}
static int calcDebt(int a) {
int debt = 100000;
for (int i = 0; i < a; i++) {
debt *= 1.05;
debt = (int)Math.ceil((debt / 1000.0)) * 1000;
}
return debt;
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int n,ans,a;
cin>>n;
ans=100000;
for(int i=0;i<n;i++){
ans*=1.05;
a=ans%1000;
if(a!=0){
ans=ans-a+1000;}}
cout<<ans<<endl;} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
double debt=100000;
for(int i=0;i<n;i++){
debt=debt+debt*0.05;
debt=Math.ceil(debt/1000)*1000;
}
System.out.println((int)debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int Debt = 100000;
Debt= ratecal(N,Debt);
System.out.println(Debt);
}
public static int ratecal(int N, int Debt ){
while(N > 0){
Debt = (int)(Debt * 1.05);
if(Debt % 1000 > 0 ){
Debt = ((Debt/1000) + 1) * 1000;
}
else {
Debt = (Debt/1000) * 1000;
}
N--;
}
return Debt;
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
double debt = 100000;
for (int i = 1; i <= n; i++) {
debt = (debt * 1.05) / 1000;
debt = Math.ceil(debt) * 1000;
}
System.out.println((int)debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int n,ans=100000;
cin >> n;
for(int i=0;i<n;i++){
ans *= 1.05;
if(ans%1000!=0) ans += (1000-ans%1000);
}
cout << ans << endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
import java.util.Date;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int debt=100000;
double temp;
int n=sc.nextInt();
for(int i=0;i<n;i++){
temp=debt*1.05;
if(temp%1000>0){
temp=temp-temp%1000+1000;
}
debt=(int)temp;
}
System.out.println(debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | n = int(input())
x = 100000
for i in range(n):
x = int(x * 1.05)
if(x % 1000 != 0):
x = x/1000 + 1
x = x * 1000
print x |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | import math
n = input()
p = 0
money = 100
while p != n:
money = math.ceil(money * 1.05)
p += 1
print int(money * 1000) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | from math import ceil
n = int(input())
a = 100
for i in range(n):
a=ceil(1.05 * a)
print (a*1000) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
n=int(input())
m=100000
k=100000
for i in range(n):
m=1.05*k
m=m/1000
k=math.ceil(m)*1000
print(k)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | n=int(input())
A=100000
for i in range(n):
A=A*1.05
if (A%1000!=0):
A=(A-A%1000)+1000
print(int(A))
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int money;
int n;
n = sc.nextInt();
money = 100000;
for (int i = 0; i < n; i++) {
money *= 1.05;
money = (money % 1000 == 0) ? money : money - money % 1000 + 1000;
}
System.out.println(money);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | import math
n = int(raw_input())
money = 100000
for i in range(n):
money *= 1.05
money = math.ceil(money/1000) * 1000
print int(money) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
int main(){
int n,debt=100000;
std::cin>>n;
for(int i=0;i<n;i++){
debt*=1.05;
debt=debt%1000 ? debt/1000*1000+1000 : debt;
}
std::cout<<debt<<'\n';
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
int main(){
int a,b,i,n;
a=100000;
std::cin>>n;
for(i=0;i<n;i++){
a=a*1.05;
b=a;
if(a%1000!=0){
b=a-a%1000;
a=b+1000;
}
}
std::cout<<a<<std::endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
PAR = 0.05
sum = 100000
for i in range(int(input())):
sum += math.ceil(sum * PAR / 1000) * 1000
print(sum)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
res = 100
N = int(input())
for i in range(N):
res = math.ceil(res * 1.05)
print("%d000" % res)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | n = int(input())
m = 100000
for i in range(n):
m = 1.05 * m
r = m % 1000
if r > 0:
m = (m // 1000 + 1) * 1000
print(int(m)) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
n = int(input())
debt = 100000
for i in range(n):
debt += debt/20
debt = math.ceil(debt/1000)*1000
print(debt)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | N = input()
money = 100000
for i in range(N):
money = int(money *1.05)
if money % 1000 != 0:
money = (money // 1000 + 1) * 1000
print money |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int debt = 100;
for (int i = 0; i < n; i++) {
debt = (int)Math.ceil(debt * 1.05);
}
System.out.println(debt * 1000);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | money=100000
n=int(input())
for day in range(n):
money+=money*0.05
money=-(-money//1000)*1000
print(int(money))
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<cmath>
int main()
{
int n;
std::cin>>n;
int i;
int sum=100;
for(i=0;i<n;i++)
{
sum+=std::ceil(sum*0.05);
}
std::cout<<sum*1000<<std::endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | n=int(input())
S=100000
for i in range(n):
S = S*1.05
R = S%1000
if R:
S = S-R+1000
print(int(S))
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
a=100
n=int(input())
for i in range(n):
a*=1.05
a=math.ceil(a)
print(a*1000)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | n = input()
money = 100000
for i in range(n):
money = int(money * 1.05)
if money != money / 1000 * 1000:
money = money / 1000 * 1000 + 1000
print money |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | # -*-coding:utf-8
#???????¨????
import math
def main():
debtTime = int(input())
ans = int(culcDebt(debtTime))
print(ans)
def culcDebt(t):
debt = 100000
for i in range(t):
debt = debt * 1.05
debt = 1000 * math.ceil(debt/1000)
return debt
if __name__ == '__main__':
main() |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int c = 100;
for(int i=0; i<n; i++){
c = (c*105+99)/100;
}
cout << c*1000 << endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | import math
n = int(raw_input())
r = 100000
for i in range(n):
r *= 1.05
r = math.ceil(r/1000) * 1000
print int(r) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
s=int(input())
t=100
for i in range(0,s):
t=math.ceil(t*1.05)
print(1000*t)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
int main()
{
int debt = 100000;
int n;
std::cin >> n;
for (int i = 0; i < n; ++i) {
debt = int((debt * 1.05 + 999) / 1000) * 1000;
}
std::cout << debt << std::endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int result = 100000;
for(int i = 0; i < n; i++) {
result+=result * 0.05;
result = (int)Math.ceil((double)result / 1000) * 1000;
}
System.out.println(result);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
loan = 100000
n = int(input())
for i in range(n):
interest = math.ceil(loan * 0.05 / 1000) * 1000
loan += interest
print(loan) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int n = sc.nextInt();
long amount = 100000;
for (int i = 0; i < n; i++) {
amount *= 1.05;
amount += 999;
amount /= 1000;
amount *= 1000;
}
System.out.println(amount);
}
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.io.*;
class Main{
public static void main(String[] args)throws IOException{
BufferedReader br=
new BufferedReader(new InputStreamReader(System.in));
String buf;
buf=br.readLine();
int n=Integer.parseInt(buf);
int money=100000;
for(int i=1;i<=n;i++){
money*=1.05;
if(money%1000>0){
money/=1000;
money++;
}else{
money/=1000;
}
money*=1000;
}
System.out.println(money);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
n = int(input())
result = 100
for i in range(n):
result = math.ceil(result*1.05)
print(result*1000)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
@SuppressWarnings({"resource" })
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
int debt = 100000;
for(int j=0;j<i;j++){
debt = f_debt(debt);
}
System.out.println(debt);
}
private static int f_debt(int n){
n = (int)(n * 1.05);
if(n % 1000 != 0){
n = n - (n%1000) + 1000;
}
return n;
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int ans=100000;
for(int i=0;i<n;i++){
ans+=ans*5/100;
if(ans%1000)ans+=(1000-ans%1000);
}
cout<<ans<<endl;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int m = 100000;
int n = cin.nextInt();
for(int i=0; i<n; i++)
{
m *= 1.05;
m = (m+999)/1000*1000;
}
System.out.println(m);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
class Main {
public static void main (String args[]) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
double debt = 100; //100,000 / 1,000
double interest = 0;
for (int i=0; i<n; i++) {
interest = debt * 0.05;
debt += interest;
debt = Math.ceil(debt);
}
System.out.printf("%.0f\n", (debt*1000));
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | import math
while True:
try:
n=input()
x=100000
for i in xrange(n):
x=math.ceil(x*1.05/1000)*1000
print(int(x))
except EOFError: break |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
import java.math.BigDecimal;
public class Main {
public static void main(String args[]){
new Main().run();
}
void run(){
double loan = 100000;
BigDecimal bd;
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
for(int i=0; i < a; i++){
bd = new BigDecimal(loan * 1.05);
BigDecimal bdup = bd.setScale(-3, BigDecimal.ROUND_UP);
loan = bdup.doubleValue();
}
System.out.println((int)loan);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | print(lambda f,n:f(f,n))(lambda f,n:n==0 and 100000 or(lambda x:x%1000>0 and x-x%1000+1000 or x)(f(f,n-1)*105/100),int(raw_input())) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <stdio.h>
int main()
{
int i,w;
long long debt=100000;
scanf("%d",&w);
for(i=0;i<w;i++){
debt*=1.05;
if(debt%1000!=0)debt=debt+1000-debt%1000;
}
printf("%lld\n",debt);
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
long c = 100000;
for (int i = n; i > 0; i--) {
c = ceil(c * 1.05 / 1000) * 1000;
}
cout << c << endl;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public long calcBalance(long first, int weeks) {
if (weeks == 0) { return first;
} else {
return calcBalance((long)(1000*Math.ceil((first*1.05)/1000.0)), weeks-1);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println((new Main()).calcBalance(100000, sc.nextInt()));
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
using namespace std;
int main() {
int n, d=100000;
cin >> n;
for(int i=0; i<n; i++){
d *= 1.05;
int a = d % 1000;
if(a != 0){
d -= a;
d += 1000;
}
}
cout << d << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
double debt = 100000.0;
int nWeeks = new Scanner(System.in).nextInt();
for(int i = 0; i < nWeeks; i++) {
debt = ((int)(debt * 0.00105 + 0.99)) * 1000.0;
}
System.out.println((int)debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
a=100
for _ in range(int(input())):a=math.ceil(a*1.05)
print(a*1000) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int amount=100000;
for(int i=0;i<n;i++) {
amount*=1.05;
amount=amount%1000>0?(amount/1000+1)*1000:amount;
}
System.out.println(amount);
sc.close();
}
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s=r.readLine();
int n = Integer.parseInt(s);
int money=100000;
try {
for(;n>0;n--){
money*=1.05;
if (money%1000>0){
money = ((money/1000)+1)*1000;
}
}
System.out.println(money);
} catch (Exception err) {
System.exit(0);
}
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | v = 100000
for i in range(int(input())):
v *= 1.05
if v % 1000 != 0:
v = v - (v % 1000) + 1000
print(int(v)) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
int main(){int w,m=100000;for(std::cin>>w;w--;m=(m+999)/1000*1000)m+=m*5/100;std::cout<<m<<'\n';}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | # -*- coding: utf-8 -*-
import math
PRINCIPAL = 100000
RATE = 0.05
ABOVE = 1000
n = int(raw_input())
debt = PRINCIPAL
for i in range(n):
debt = int(math.ceil(float(debt)*(1+RATE)/ABOVE))*ABOVE
print debt |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long d = 100000;
for (int i = 0; i < n; ++i) {
d *= 1.05;
if (d % 1000) { d += 1000 - d % 1000; }
}
cout << d << endl;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <stdio.h>
int main(){
long debt = 100;
int n;
int i;
scanf("%d",&n);
for(i=0;i<n;i++){
debt = (long)(debt*1.05+0.99);
}
printf("%ld\n",debt*1000);
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
N=int(input())
a=100000
for i in range(N):
b=a/1000
a=math.ceil(b*1.05)
a=a*1000
print(a)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
a = 100
b = int(input())
for _ in range(b):
a = math.ceil(a * 1.05)
a *= 1000
print(a)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
using namespace std;
int main(){
int a,sum=100000,b;
cin >>a;
for(int i=0;i<a;i++){
b=sum/20;
if(b%1000==0)sum+=b;
else sum+=(b/1000+1)*1000;
}
cout <<sum<<endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
class Main {
public static void main (String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int weeks = sc.nextInt();
int debt = 100000;
for (int i = 0; i < weeks; i++) {
debt = (int) Math.ceil((debt * 1.05) / 1000) * 1000;
}
System.out.println(debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
System.out.println( calc_debt( sc.nextInt() ) );
sc.close();
}
private static long calc_debt(int nextInt) {
int n = nextInt;
long d = 100;
for (int i = 0; i < n; i++) {
d = (long)Math.ceil( d * 1.05);
}
long debt = d * 1000;
return debt;
}
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | n=int(input())
a=100000
while n!=0:
a=a*1.05
if a%1000!=0:
a=a-(a%1000)+1000
n=n-1
print(int (a))
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main()
{
int n,x,e = 100000;
cin >> n;
for(int i=0;i<n;++i){
e *= 1.05;
x = e % 1000;
if(x != 0){
e += (1000-x);
}
}
cout << e << endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(void){
int n,a=100000;
cin >> n;
while(n--){
a=a*5/100+a;
if(a%1000){
a/=1000;
a=a*1000+1000;
}
}
cout << a << endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int x=100000;
for(int i=0;i<n;i++){
x=(int) (1.05*x);
if(x%1000!=0){
x=((x/1000)+1)*1000;
}
}
System.out.println(x);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
long debt = 100000;
for (int i = 0; i < n; i++) {
debt = (long) (debt * 1.05);
if (debt % 1000 > 0) {
debt = (debt / 1000 + 1) * 1000;
}
}
System.out.println(debt);
}
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int a,b,rone=100000;
cin>>a;
for(int i=0;i<a;i++){
rone *=1.05;
b = rone % 1000;
rone -= b;
if(b>0){b=1000;
rone += b;
}
}
cout<<rone<<endl;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int money = 100000;
for (int i = 0; i < n; i++) {
money *= 1.05;
if (money % 1000 != 0) {
money += 1000 - money % 1000;
}
}
System.out.println(money);
}
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | from math import ceil
yen = 100000
for i in range(int(input())):
yen = ceil((yen*1.05)/1000)*1000
print(yen) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
s=int(input())
m=100000
for i in range(s):
m=math.ceil((m*1.05)/1000)*1000
print(m)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | debt=100000
week=input()
for i in range(week):
debt=debt*1.05
if debt%1000!=0:
debt=int(debt/1000)*1000+1000
print debt |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
long long int N,x=100000,y;
cin >> N;
for(int i=0;i<N;i++){
x = x * 105 / 100;
y = x/1000;
if((x%1000)!=0) x = (y+1)*1000;
}
cout << x << endl;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
using namespace std;
int main(){
int n,s=100000;
cin>>n;
for(int i=0;i<n;i++){
s*=1.05;
if(s%1000!=0){
s/=1000;
s*=1000;
s+=1000;
}
}
cout<<s<<endl;
cin>>n;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <cstdio>
#include <cmath>
using namespace std;
int main(){
int n;
scanf("%d",&n);
long debt=100000;
for(int i=0;i<n;i++)
debt=(long)(ceil(debt*1.05/1000.0))*1000;
printf("%ld\n",debt);
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<stdio.h>
int main(void){
unsigned int ans=100000,n;
scanf("%d",&n);
for(int i=0;i<n;i++){
ans=(ans*105)/100;
ans=ans/1000+(ans%1000>0?1:0);
ans*=1000;
}
printf("%d\n",ans);
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
using namespace std;
int main(){
int n,b=100000;
cin>>n;
for(int i=0;i<n;i++){
b*=1.05;
if(b%1000!=0)b=(b/1000+1)*1000;
}
cout<<b<<endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main(){
int m=100000,n;
cin>>n;
for(int i=0;i<n;i++){
m=m/20*21;
m+=(1000-(m-1)%1000)-1;
}
cout<<m<<endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | import math
n = input()
a = 100000
for i in range(n):
a = 1.05 * a
a /= 1000
a = int(math.ceil(a) * 1000)
print (a) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
n=int(input())
i=0
E=100
while(i<n):
E=E*1.05
E=math.ceil(E)
i=i+1
print(E*1000)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
import java.math.BigDecimal;
public class Main {
public static void main(String args[]) {
int debt = 100000;
int nWeeks = Integer.parseInt(new Scanner(System.in).next());
for(int i = 0; i < nWeeks; i++) {
debt = new BigDecimal(debt * 1.05).setScale(-3, BigDecimal.ROUND_CEILING).intValue();
}
System.out.println(debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
double s = 100;
while (scanner.hasNext()) {
int w = scanner.nextInt();
for (int ii = 0; ii < w; ii++) {
s = Math.ceil(s * 1.05);
}
System.out.println((int)(s * 1000));
}
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
n = int(input())
debt = 100
for i in range(n):
debt = math.ceil(debt * 1.05)
print(str(debt * 1000))
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
public class Main {
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int N=s.nextInt();
int Debt=100000;
for(int i=0;i<N;i++){
Debt=Debt*105/100;
if(Debt%1000!=0)Debt=Debt+1000-Debt%1000;
}
System.out.println(Debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include<stdio.h>
#include<math.h>
int main(){
int a,i;
double b=100,d=0,c=0;
scanf("%d",&a);
for(i=0;i<a;i++){
b*=1.05;
b+=0.9999;
double c=floor(b);
b=c;
}
printf("%d\n",(int)b*1000);
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python3 | import math
n = int(input())
d = 100000
for i in range(n):
d *= 1.05
d = math.ceil((d/1000))*1000
print(d) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
double tmp = 100000.0;
for (int i = 0; i < n; i++) {
tmp *= 1.05;
tmp /= 1000;
tmp = Math.ceil(tmp);
tmp *= 1000;
}
System.out.println((int)tmp);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | python2 | a = 100000
b = 1000
for i in range(input()):
a *= 1.05
if a % b > 0:
a = a - a % b + b
print int(a) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | cpp | #include <cstdio>
int main() {
int n,debt=100000;
scanf("%d",&n);
for(int i=0;i<n;i++) {
debt=debt*1.05;
if(debt%1000>0) {
debt-=debt%1000;
debt+=1000;
}
}
printf("%d\n",debt);
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
//??????????????????????????°
public static void main(String[] args) {
int debt = 100000;
int temp = 0;
Scanner stdin = new Scanner(System.in);
int week = stdin.nextInt();
for(int i = 0; i < week; i++) {
debt *= 1.05;
if(debt % 1000 != 0) {
temp = ((debt / 1000) * 1000 + 1000);
debt = temp;
}
}
System.out.println(debt);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int inputNum = in.nextInt();
System.out.println(getNowShakkin(inputNum));
}
public static int getNowShakkin(int weekInterval) {
double result = 100;
for (int i = 0; i < weekInterval; i++) {
result = result + (result * 0.05);
result = (Math.ceil((double) result));
}
return (int)result * 1000;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.