| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1234532 | dtk245 | Trol (COCI19_trol) | C++20 | 1 ms | 328 KiB | 
#include <bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		unsigned long long a,b;
		cin>>a>>b;
		unsigned long long hasil=0;
	    unsigned long long has=0;
		if(b-a>0){
			cout<<(b*(b+1))/2<<endl;
		}
		else {
			while(a>0){
				hasil+=a%10;
				a/=10;
			}
			while(hasil>0){
				has+=hasil%10;
				hasil/=10;
			}
			cout<<has<<endl;
			
			
		}
		
	}
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
