# Path: kaidoku/misc.py
# def blank(s):
#     """Count numbers of blank cells."""
#     blank = 0
#     for i in range(81):
#         if s[i] == 0:
#             blank = blank + 1
#     return (blank)
# 
# Path: kaidoku/misc.py
# def cell(i):
#     """Address of the cell."""
#     return ('R' + str(i // 9 + 1) + 'C' + str(i % 9 + 1))


import copy
import datetime
from kaidoku.misc import blank
from kaidoku.misc import cell
    from kaidoku.calc import hidsing
    from kaidoku.calc import naksing
    from kaidoku.misc import check
    from kaidoku.calc import (solveone)
"""Trial and search."""



def trial(s, p, linescan, maxstep, verbose, b, pair):
    """Trial."""
    if len(pair) == 0:
        return (s, p, 0, 100, '', False, False)
    mincell = 100
    minbla = 100
    for x in pair:
        i = x[0]
        bla = 0
        for j in x[1:]:
            s2 = copy.deepcopy(s)
            p2 = copy.deepcopy(p)
            s2[i] = j
            p2[i] = [10]
            found = True
            minblank = blank(s2) - maxstep
            if minblank < 0:
                minblank = 0
            message2 = ''
            line = 1

# Path: kaidoku/misc.py
# def blank(s):
#     """Count numbers of blank cells."""
#     blank = 0
#     for i in range(81):
#         if s[i] == 0:
#             blank = blank + 1
#     return (blank)
# 
# Path: kaidoku/misc.py
# def cell(i):
#     """Address of the cell."""
#     return ('R' + str(i // 9 + 1) + 'C' + str(i % 9 + 1))


# Path: kaidoku/search.py
import copy
import datetime
from kaidoku.misc import blank
from kaidoku.misc import cell
    from kaidoku.calc import hidsing
    from kaidoku.calc import naksing
    from kaidoku.misc import check
    from kaidoku.calc import (solveone)

"""Trial and search."""



def trial(s, p, linescan, maxstep, verbose, b, pair):
    """Trial."""
    if len(pair) == 0:
        return (s, p, 0, 100, '', False, False)
    mincell = 100
    minbla = 100
    for x in pair:
        i = x[0]
        bla = 0
        for j in x[1:]:
            s2 = copy.deepcopy(s)
            p2 = copy.deepcopy(p)
            s2[i] = j
            p2[i] = [10]
            found = True
            minblank = blank(s2) - maxstep
            if minblank < 0:
                minblank = 0
            message2 = ''
            line = 1

            while found and blank(s2) > minblank: