题目链接:

  http://acm.fzu.edu.cn/problem.php?pid=2244

题目大意:

  每月还款额=贷款本金×[月利率×(1+月利率)^还款月数]÷[(1+月利率)^还款月数-1]

  由于商业贷款利率高于公积金贷款利率,优先公积金贷款,超出部分再采用商业贷款.

  银行至多给予贷款总额最多不超过70%,且数额必须为万的整数倍,daxia想尽量少首付多贷款.

题目思路:

  【模拟】

  直接模拟就行,连快速幂都可以不用。

  注意不能*0.7要*7/10!!!!!!

 //
//by coolxxx
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<map>
#include<memory.h>
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//#include<stdbool.h>
#include<math.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) ((a)*(a))
#define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
#define mem(a,b) memset(a,b,sizeof(a))
#define eps (1e-8)
#define J 10
#define MAX 0x7f7f7f7f
#define PI 3.14159265358979323
#define N 224
using namespace std;
typedef long long LL;
int cas,cass;
int n,m,lll,ans;
double mi(double x,int y)
{
double sum=;
while(y)
{
if(y&)sum=sum*x;
x=x*x;
y>>=;
}
return sum;
}
int main()
{
#ifndef ONLINE_JUDGE
// freopen("1.txt","r",stdin);
// freopen("2.txt","w",stdout);
#endif
int i,j,k,y,dk,dk1,dk2;
double r1,r2,y1,y2;
// for(scanf("%d",&cas);cas;cas--)
// for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
while(~scanf("%d",&n))
// while(~scanf("%d",&n))
{
scanf("%d",&m);
scanf("%lf%lf",&r1,&r2);
scanf("%d",&y);y=y*;
dk=n*/;r1/=;r2/=;
dk2=min(dk,m);dk1=dk-dk2;
n-=dk;
y1=mi(+r1,y);
y1=*dk1*r1*y1/(y1-);
//if(int(y1*10)%10>=5)y1+=1;
y2=mi(+r2,y);
y2=*dk2*r2*y2/(y2-);
//if(int(y2*10)%10>=5)y2+=1;
printf("%d %d\n",n,int(y1+y2+0.5000001));
}
return ;
}
/*
// //
*/

最新文章

  1. ASP.NET Core 中文文档 第四章 MVC(4.1)Controllers, Actions 和 Action Results
  2. nginx 安全优化
  3. iOS 学习 - 22 异步解析 JSON,使用 FMDB 存储,TableView 显示
  4. SQL --Chapter 04 数据更新
  5. OEM代工厂产品经理个人经历谈
  6. hiho一下 第一百零七周 Give My Text Back(微软笔试题)
  7. oracle定时器,调用存储过程,定时从n张表中取值新增到本地一张表中
  8. Tomcat数据库连接池的配置方法总结
  9. python之supervisord启动脚本
  10. VS2012新建项目出错:未找到与约束
  11. Linux的nginx环境的vue 部署
  12. 升级gitlab
  13. 关于jquery日期控件及时间格式转换2017.05.27
  14. 两个inline-block中间有空白,解决inline-block 元素之间的空白问题
  15. Java使用RSA加密解密签名及校验
  16. springmvc功能以及源码实现分析
  17. Django urls 路由
  18. 使用博客系统发生_STORAGE_WRITE_ERROR_错误
  19. 完全使用css编写复选框
  20. net 把指定 URI 的资源下载到本地

热门文章

  1. Hex编码 十六进制编码
  2. MySQL性能状态查看方式
  3. oracle官方文档- length篇
  4. jQuery 效果 - 滑动
  5. Spring 中各种通知
  6. javascript——归并方法
  7. jQuery慢慢啃筛选(四)
  8. Magento 编译 php5.6.21 命令
  9. PHPCMS二层栏目调用
  10. spoj SORTBIT - Sorted bit squence