Submission #473661

#TimeUsernameProblemLanguageResultExecution timeMemory
473661CaroLindaEuklid (COCI20_euklid)C++14
110 / 110
1 ms292 KiB
#include <bits/stdc++.h>

using namespace std ;

long long g , h ;

int main()
{
	int T; 
	scanf("%d", &T ) ;
	while(T--)
	{
		scanf("%lld %lld", &g, &h ) ;
		
		long long G = g , H = h ;
		
		while(H <= G ) H = H*h ;
		
		long long p = H%G ;
		p = G-p ;		
		H += p ;
		
		printf("%lld %lld\n", H*h + G , H ) ;
		
	}
}

Compilation message (stderr)

euklid.cpp: In function 'int main()':
euklid.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d", &T ) ;
      |  ~~~~~^~~~~~~~~~~
euklid.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   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...