Language: C++

#include <bits/stdc++.h>
using namespace std;

inline int Isdigit(char c) {
	if (c < '0' || c > '9') return 0;
	return 1;
}
inline int readint(){
    register int x = 0, flag = 1;
    register char ch;
    while (!Isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), Isdigit(ch = getchar()));
	return x * flag;
}

inline long long readlong() {
	register long long x = 0, flag = 1;
	register char ch;
	while (!Isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), Isdigit(ch = getchar()));
	return x * flag;
}
template <class T>
inline void write(T x){
    if (x < 0)
        putchar('-'), x = -x;
    if(x >= 10) write(x / 10); 
    putchar(x % 10 + '0');
}

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }

#define For(i, x, y) for (int i = (x); i <= (y); i++) 
#define Rep(i, x, y) for (int i = (x); i >= (y); i--) 
#define ri readint
#define rl readlong

int A, B;
int main() {
	cin >> A >> B;
	int ans = 0;
	for (ans = 0; ans <= 10000; ans++) {
		double k = ans * 1.0;
		int tmp = floor((0.1 * k));
		if (tmp != B) continue;
		tmp = floor((0.08 * k));
		if (tmp != A) continue;
		printf("%d\n", ans); return 0;
	}
	printf("-1"); return 0;
}

(19时39分50秒) CXYO7:
/*
Arthor : Ender_zzm
E-mail zzm_ender_wiggin@outlook.com
Blog ender-zzm.enbar.cn
*/
#include <bits/stdc++.h>
using namespace std;

inline int Isdigit(char c) {
	if (c < '0' || c > '9') return 0;
	return 1;
}
inline int readint(){
    register int x = 0, flag = 1;
    register char ch;
    while (!Isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), Isdigit(ch = getchar()));
	return x * flag;
}

inline long long readlong() {
	register long long x = 0, flag = 1;
	register char ch;
	while (!Isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), Isdigit(ch = getchar()));
	return x * flag;
}
template <class T>
inline void write(T x){
    if (x < 0)
        putchar('-'), x = -x;
    if(x >= 10) write(x / 10); 
    putchar(x % 10 + '0');
}

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }

#define For(i, x, y) for (int i = (x); i <= (y); i++) 
#define Rep(i, x, y) for (int i = (x); i >= (y); i--) 
#define ri readint
#define rl readlong

int A, B;
int main() {
	cin >> A >> B;
	int ans = 0;
	for (ans = 0; ans <= 10000; ans++) {
		double k = ans * 1.0;
		int tmp = floor((0.1 * k));
		if (tmp != B) continue;
		tmp = floor((0.08 * k));
		if (tmp != A) continue;
		printf("%d\n", ans); return 0;
	}
	printf("-1"); return 0;
}


Compiler output:
a.cc: In function 'int readint()':
a.cc:9:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    9 |     register int x = 0, flag = 1;
      |                  ^
a.cc:9:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    9 |     register int x = 0, flag = 1;
      |                         ^~~~
a.cc:10:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   10 |     register char ch;
      |                   ^~
a.cc: In function 'long long int readlong()':
a.cc:17:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |         register long long x = 0, flag = 1;
      |                            ^
a.cc:17:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |         register long long x = 0, flag = 1;
      |                                   ^~~~
a.cc:18:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |         register char ch;
      |                       ^~
a.cc: At global scope:
a.cc:54:2: error: expected unqualified-id before numeric constant
   54 | (19时39分50秒) CXYO7:
      |  ^~~~~~~~~~~~
a.cc:54:2: error: expected ')' before numeric constant
   54 | (19时39分50秒) CXYO7:
      | ~^~~~~~~~~~~~
      |  )
a.cc:63:12: error: redefinition of 'int Isdigit(char)'
   63 | inline int Isdigit(char c) {
      |            ^~~~~~~
a.cc:4:12: note: 'int Isdigit(char)' previously defined here
    4 | inline int Isdigit(char c) {
      |            ^~~~~~~
a.cc:67:12: error: redefinition of 'int readint()'
   67 | inline int readint(){
      |            ^~~~~~~
a.cc:8:12: note: 'int readint()' previously defined here
    8 | inline int readint(){
      |            ^~~~~~~
a.cc: In function 'int readint()':
a.cc:68:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   68 |     register int x = 0, flag = 1;
      |                  ^
a.cc:68:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   68 |     register int x = 0, flag = 1;
      |                         ^~~~
a.cc:69:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   69 |     register char ch;
      |                   ^~
a.cc: At global scope:
a.cc:75:18: error: redefinition of 'long long int readlong()'
   75 | inline long long readlong() {
      |                  ^~~~~~~~
a.cc:16:18: note: 'long long int readlong()' previously defined here
   16 | inline long long readlong() {
      |                  ^~~~~~~~
a.cc: In function 'long long int readlong()':
a.cc:76:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   76 |         register long long x = 0, flag = 1;
      |                            ^
a.cc:76:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   76 |         register long long x = 0, flag = 1;
      |                                   ^~~~
a.cc:77:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   77 |         register char ch;
      |                       ^~
a.cc: At global scope:
a.cc:83:13: error: redefinition of 'template<class T> void write(T)'
   83 | inline void write(T x){
      |             ^~~~~
a.cc:24:13: note: 'template<class T> void write(T)' previously declared here
   24 | inline void write(T x){
      |             ^~~~~
a.cc:90:31: error: redefinition of 'template<class T> bool Chkmax(T&, const T&)'
   90 | template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
      |                               ^~~~~~
a.cc:31:31: note: 'template<class T> bool Chkmax(T&, const T&)' previously declared here
   31 | template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
      |                               ^~~~~~
a.cc:91:31: error: redefinition of 'template<class T> bool Chkmin(T&, const T&)'
   91 | template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }
      |                               ^~~~~~
a.cc:32:31: note: 'template<class T> bool Chkmin(T&, const T&)' previously declared here
   32 | template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }
      |                               ^~~~~~
a.cc:98:5: error: redefinition of 'int A'
   98 | int A, B;
      |     ^
a.cc:39:5: note: 'int A' previously declared here
   39 | int A, B;
      |     ^
a.cc:98:8: error: redefinition of 'int B'
   98 | int A, B;
      |        ^
a.cc:39:8: note: 'int B' previously declared here
   39 | int A, B;
      |        ^
a.cc:99:5: error: redefinition of 'int main()'
   99 | int main() {
      |     ^~~~
a.cc:40:5: note: 'int main()' previously defined here
   40 | int main() {
      |     ^~~~