Submission #866340

#TimeUsernameProblemLanguageResultExecution timeMemory
866340vjudge1Euklid (COCI20_euklid)C++14
110 / 110
1 ms600 KiB
#include<cstdio>
typedef long long ll;
int main(){
	int T;
	ll g,h,hk,a,b;
	scanf("%d",&T);
	while(T--){
		scanf("%lld%lld",&g,&h);
		hk=h;
		while(hk<=g)hk*=h;
		b=(hk+g-1)/g*g,a=h*b+g;
		printf("%lld %lld\n",a,b);
	}
	return 0;
}

Compilation message (stderr)

euklid.cpp: In function 'int main()':
euklid.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d",&T);
      |  ~~~~~^~~~~~~~~
euklid.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |   scanf("%lld%lld",&g,&h);
      |   ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...