mathematical knowledge
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
int t;
long long m,n;
cin>>n>>m;
cout<<(m-n%m)*(n/m)*(n/m-1)/2+(n%m)*(n/m+1)*(n/m)/2<<" "<<(n-m+1)*(n-m)/2<<endl;
return 0;
}
Read More:
- Random number random reports an error. Illegalargumentexception: bound must be positive
- Random forest algorithm learning
- numpy.random.rand()
- 26 English letters in upper and lower case and 0-9 to generate 8-bit random password
- Tensorflow image random_ There seems to be something wrong with the shift function
- Out of bag error in Random Forest
- Python random selects elements randomly from a collection
- Matlab: Three forms of random number generated (Rand, Randi and Randn)
- Solve the problem of postgre error #22p02 malformed array literal
- P2V error log
- Unexpected token o in JSON at p
- Webpack report error: unknown option ‘- p’ solution
- Solution to PCL XL error of HP p2055d laser printer
- SAP mm receives the purchase order and reports an error – table t169p entry znmi does not exist-
- Error: syntax error – unexpected token P in JSON at position 0
- Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request p
- Error casting p_sequencer, please verify that this sequence/sequence item is intended to execute
- NPM err! Invalid name: “{{name}} in nuxt installation in p166 of Shangsi Valley online education project“
- Docker starts the image and reports an error. Iptables failed: iptables — wait – t NAT – a docker – P TCP
- Android 9 (P) recovery upgrade Map of ‘@/cache/recovery/block.map’ failed problem analysis guide