Problem Description
Connecting the display screen and signal sources which produce different color signals by cables, then the display screen can show the color of the signal source.Notice that every signal source can only send signals to one display screen each time. 
Now you have M display screens and K different signal sources(K≤M≤232−1). Select K display screens from M display screens, how many cables are needed at least so that **any** K display screens you select can show exactly K different colors.
Input
Multiple cases (no more than 100), for each test case:
there is one line contains two integers M and K.
Output
Output the minimum number of cables N.
Sample Input
3 2
20 15
 
Sample Output
4
90

没什么要说的

 #include <bits/stdc++.h>
using namespace std;
int main(){
long long n,m;
while(cin>>n>>m){
if(n<=m){
cout<<n<<endl;
}else{
cout<<(n-m+)*m<<endl;
}
}
return ;
}

最新文章

  1. ASP.NET Core服务器综述
  2. 在MonthCalendar控件中选中日期
  3. BZOJ3226: [Sdoi2008]校门外的区间
  4. 最长上升子序列[LIS]
  5. oracle连接的三个配置文件(转)
  6. 【阿里云产品公测】以开发者角度看ACE服务『ACE应用构建指南』
  7. Ajax时代 SQL注入依然是隐患
  8. 学习hash_map从而了解如何写stl里面的hash函数和equal或者compare函数
  9. Button UI Kit CSS3美丽Buttonbutton
  10. C#基础之------委托
  11. JS验证两次输入密码是否相同
  12. GridView 多余字符显示省略号,并在Tooltip中显示完整信息
  13. PHP算法学习(4) 随机算法
  14. EF Core中,通过实体类向SQL Server数据库表中插入数据后,实体对象是如何得到数据库表中的默认值的
  15. 第七章 鼠标(CONNECT)
  16. SqlServer 中的触发器
  17. APP-1-相关介绍及资料
  18. PowerDesigner导入sql脚本生成物理模型
  19. webpack+sass+vue 入门教程(一)
  20. 微信小程序尝鲜一个月现状分析

热门文章

  1. z+f profiler 9012
  2. matlab之text()函数
  3. static语句块的执行时间
  4. codeforces 660A A. Co-prime Array(水题)
  5. DataGrid当列宽超出当前宽度时,没有数据也恒有滚动条
  6. Spring boot 学习 五:domain的定义
  7. IOS深入学习
  8. 你所不知道的html5与html中的那些事(四)——文本标签
  9. 一次ssh被植入后门的经历及解决方案
  10. 怎么解决sublime的插件自动被禁用