⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toj_2922.cpp

📁 Tianjin University Online Judge 的80多道题目 .
💻 CPP
字号:
/*G.   Counting RegionTime Limit: 1.0 Seconds   Memory Limit: 65536KTotal Runs: 134   Accepted Runs: 16In this problem you are given a circle and the number of tangent. You have to find out the maximum number of region can exist.In the above figure the circle is of 6 unit radius and the tangent generates 3 regions.InputEach line of input set contains the radius r and the number of tangent t of the circle.OutputThe output file contains the maximum number of region. You are assured that output must be fit in 64 bit unsigned integer.Sample Input6 112 2Sample Output36Problem Setter: M.H. Rasel.Source:  CUET individual contest*/#include<cstdio>int main(){  unsigned long long result , n;  while ( scanf( "%*[^ ]%llu" , &n ) != EOF )    {      result = n * ( n + 3 ) / 2 + n;      printf( "%llu\n" , result );    }  return 0;}	      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -