/*
References:
[1] jiegec, duck.ac submission 48022,
https://duck.ac/submission/48022
Directly reused the a*b-a-b computation, DuckInfo input/output ABI, and direct startup exit. Original source
attributions, if any, are preserved directly below this header. No
separate license notice appears on the cited public submission page;
this attributed derivative is submitted to the same public judge.
Approach:
Use the cited input parsing and arithmetic calculation
for the current noip17a test set. The implementation is credited to [1];
no new algorithmic optimization is claimed in this initial submission.
*/
// This code is AI-generated. (AI 生成的代码)
// NOIP2017 小凯的疑惑: largest non-representable value with coprime a,b is
// a*b-a-b. Read a,b from DuckInfo and print it directly.
typedef unsigned long long u64;
struct DuckInfo {
u64 abi;
const char *in; u64 in_size;
char *out; u64 out_limit; u64 out_size;
char *err; u64 err_limit; u64 err_size;
const char *ib; u64 ib_limit;
char *ob; u64 ob_limit; u64 tsc;
} __attribute__((packed));
int main(void) { return 0; }
void __libc_start_main(int (*mf)(int, char **, char **), int ac, char **av) {
(void)mf;
struct DuckInfo *d = (struct DuckInfo *)((u64 *)av)[29];
const char *s = d->in;
u64 a = 0, b = 0;
while (*s != ' ') a = a * 10 + (u64)(*s++ - '0');
++s;
while (*s >= '0' && *s <= '9') b = b * 10 + (u64)(*s++ - '0');
u64 r = a * b - a - b;
char *o = d->out, *st = o;
do { *o++ = (char)('0' + r % 10); r /= 10; } while (r);
*o++ = '\n';
char *e = o - 2;
while (st < e) { char t = *st; *st = *e; *e = t; ++st; --e; }
d->out_size = (u64)(o - d->out);
__asm__ volatile("mov $60,%%eax; xor %%edi,%%edi; syscall" ::: "rax","rdi","rcx","r11","memory");
__builtin_unreachable();
}